From 2b0f2577b54c055ff7997325a335a3020dd81651 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 28 Feb 2017 21:56:30 +0000 Subject: [PATCH] Uppercases the Section name in the page & if Deploy installed grab the CurrentWorkspace from the global JS obj --- src/Umbraco.Web.UI.Client/src/init.js | 29 +++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/init.js b/src/Umbraco.Web.UI.Client/src/init.js index 3300c47ab9..016c33015d 100644 --- a/src/Umbraco.Web.UI.Client/src/init.js +++ b/src/Umbraco.Web.UI.Client/src/init.js @@ -26,10 +26,35 @@ app.run(['userService', '$log', '$rootScope', '$location', 'navigationService', /** execute code on each successful route */ $rootScope.$on('$routeChangeSuccess', function(event, current, previous) { - if(current.params.section){ - $rootScope.locationTitle = current.params.section + " - " + $location.$$host; + var deployConfig = Umbraco.Sys.ServerVariables.deploy; + var deployEnv, deployEnvTitle; + if (deployConfig) { + deployEnv = Umbraco.Sys.ServerVariables.deploy.CurrentWorkspace; + deployEnvTitle = "(" + deployEnv + ") "; + } + + if(current.params.section) { + + //Uppercase the current section, content, media, settings, developer, forms + var currentSection = current.params.section.charAt(0).toUpperCase() + current.params.section.slice(1); + + var baseTitle = currentSection + " - " + $location.$$host; + + //Check deploy for Global Umbraco.Sys obj workspace + if(deployEnv){ + $rootScope.locationTitle = deployEnvTitle + baseTitle; + } + else { + $rootScope.locationTitle = baseTitle; + } + } else { + + if(deployEnv) { + $rootScope.locationTitle = deployEnvTitle + "Umbraco - " + $location.$$host; + } + $rootScope.locationTitle = "Umbraco - " + $location.$$host; }