diff --git a/services/web/app/views/layout.pug b/services/web/app/views/layout.pug index 81888dab03..ef5b6476f9 100644 --- a/services/web/app/views/layout.pug +++ b/services/web/app/views/layout.pug @@ -64,6 +64,7 @@ html( block head-scripts + meta(id="ol-usersEmail" content=getUserEmail()) script. window.sharelatex = { siteUrl: '#{settings.siteUrl}', diff --git a/services/web/app/views/layout/navbar.pug b/services/web/app/views/layout/navbar.pug index 540d3a2f44..62ccd27c16 100644 --- a/services/web/app/views/layout/navbar.pug +++ b/services/web/app/views/layout/navbar.pug @@ -82,7 +82,7 @@ nav.navbar.navbar-default.navbar-main b.caret ul.dropdown-menu li - div.subdued(ng-non-bindable) #{getUserEmail()} + div.subdued {{ usersEmail }} li.divider.hidden-xs.hidden-sm li a(href="/user/settings") #{translate('Account Settings')} diff --git a/services/web/frontend/js/base.js b/services/web/frontend/js/base.js index f83ce27c4f..d4660ab99a 100644 --- a/services/web/frontend/js/base.js +++ b/services/web/frontend/js/base.js @@ -72,7 +72,10 @@ const App = angular ) }) -App.run($templateCache => +App.run(($rootScope, $templateCache) => { + const usersEmailElement = document.getElementById('ol-usersEmail') + $rootScope.usersEmail = usersEmailElement && usersEmailElement.content + // UI Select templates are hard-coded and use Glyphicon icons (which we don't import). // The line below simply overrides the hard-coded template with our own, which is // basically the same but using Font Awesome icons. @@ -80,7 +83,7 @@ App.run($templateCache => 'bootstrap/match.tpl.html', '
{{$select.placeholder}}
' ) -) +}) const sl_debugging = __guard__(window.location != null ? window.location.search : undefined, x => diff --git a/services/web/frontend/js/main/affiliations/controllers/UserAffiliationsController.js b/services/web/frontend/js/main/affiliations/controllers/UserAffiliationsController.js index 137c570e15..761747bf35 100644 --- a/services/web/frontend/js/main/affiliations/controllers/UserAffiliationsController.js +++ b/services/web/frontend/js/main/affiliations/controllers/UserAffiliationsController.js @@ -9,6 +9,7 @@ import App from '../../../base' export default App.controller('UserAffiliationsController', function( $scope, + $rootScope, UserAffiliationsDataService, $q, $window @@ -195,6 +196,7 @@ export default App.controller('UserAffiliationsController', function( } userEmail.default = true window.usersEmail = userEmail.email + $rootScope.usersEmail = userEmail.email }) $scope.removeUserEmail = function(userEmail) {