aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/moon_gui/static/app/common
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2017-06-09 16:18:59 +0200
committerasteroide <thomas.duval@orange.com>2017-06-09 16:18:59 +0200
commit60bb98696ee93f979914d8e88ed4708f59fcff9c (patch)
treea404880ec261f95c69fa4a6a1edd50ef9a66d160 /moonv4/moon_gui/static/app/common
parent8039214d0caedfec5456bd8ee0898a1b9a55629a (diff)
Stable version
Change-Id: I70001bedbdf1823cb9e8dccd545800387777201b
Diffstat (limited to 'moonv4/moon_gui/static/app/common')
-rw-r--r--moonv4/moon_gui/static/app/common/header/header.controller.js5
-rw-r--r--moonv4/moon_gui/static/app/common/header/header.tpl.html6
2 files changed, 8 insertions, 3 deletions
diff --git a/moonv4/moon_gui/static/app/common/header/header.controller.js b/moonv4/moon_gui/static/app/common/header/header.controller.js
index dfab502f..13ef4d6f 100644
--- a/moonv4/moon_gui/static/app/common/header/header.controller.js
+++ b/moonv4/moon_gui/static/app/common/header/header.controller.js
@@ -27,6 +27,7 @@
header.isModelTabActive = menuService.isModelTabActive;
header.changeLocale = changeLocale;
header.logout = logout;
+ header.currentLanguage = $translate.use();
header.getUser = authenticationService.GetUser;
@@ -37,17 +38,19 @@
function changeLocale(localeKey, event) {
event.preventDefault();
-
$translate.use(localeKey);
$translate.preferredLanguage(localeKey);
+ header.currentLanguage = localeKey;
}
function logout(){
+
authenticationService.Logout();
$translate('moon.logout.success').then( function(translatedValue) {
alertService.alertSuccess(translatedValue);
});
+
}
}
})(); \ No newline at end of file
diff --git a/moonv4/moon_gui/static/app/common/header/header.tpl.html b/moonv4/moon_gui/static/app/common/header/header.tpl.html
index ad7b461d..f703fa79 100644
--- a/moonv4/moon_gui/static/app/common/header/header.tpl.html
+++ b/moonv4/moon_gui/static/app/common/header/header.tpl.html
@@ -14,13 +14,15 @@
<div class="col-md-3">
<span class="pull-right">
- <a href="" ng-click="header.changeLocale('fr', $event)"><img src="assets/img/arrow-link.gif" alt="fr_" />fr</a>
- <a href="" ng-click="header.changeLocale('en', $event)"><img src="assets/img/arrow-link.gif" alt="en_" />en</a>
+
+ <a href="" ng-click="header.changeLocale('fr', $event)" ng-class="{'strong' : header.currentLanguage === 'fr'}"><img src="assets/img/arrow-link.gif" alt="fr_" />fr</a>
+ <a href="" ng-click="header.changeLocale('en', $event)" ng-class="{'strong' : header.currentLanguage === 'en'}"><img src="assets/img/arrow-link.gif" alt="en_" />en</a>
<a href="" ng-if="connected" ng-click="header.logout()" class="left30">
<span class="glyphicon glyphicon-log-out"></span>
<span data-translate="moon.logout.title">Logout</span>(<span ng-bind="header.getUser().token.user.name"></span>)
</a>
+
<a href="" ng-if="!connected" class="left30">
<span class="glyphicon glyphicon-log-in"></span>
<span data-translate="moon.login.title">Login</span>