This is an automated email from the git hooks/post-receive script. New commit to branch devel in repository pollen. See http://git.chorem.org/pollen.git commit 052eee3d4ffd23351868b0381160f8dca9742b9f Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Mon Jun 2 14:06:20 2014 +0200 add menu for change locale --- pollen-ui-angular/src/main/webapp/img/en.png | Bin 0 -> 599 bytes pollen-ui-angular/src/main/webapp/img/fr.png | Bin 0 -> 545 bytes pollen-ui-angular/src/main/webapp/index.html | 18 +++++++++--- pollen-ui-angular/src/main/webapp/js/app.js | 2 +- .../src/main/webapp/js/controllers/localeCtrl.js | 32 +++++++++++++++++++++ 5 files changed, 47 insertions(+), 5 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/img/en.png b/pollen-ui-angular/src/main/webapp/img/en.png new file mode 100644 index 0000000..ff701e1 Binary files /dev/null and b/pollen-ui-angular/src/main/webapp/img/en.png differ diff --git a/pollen-ui-angular/src/main/webapp/img/fr.png b/pollen-ui-angular/src/main/webapp/img/fr.png new file mode 100644 index 0000000..8332c4e Binary files /dev/null and b/pollen-ui-angular/src/main/webapp/img/fr.png differ diff --git a/pollen-ui-angular/src/main/webapp/index.html b/pollen-ui-angular/src/main/webapp/index.html index 3a6f668..258f372 100644 --- a/pollen-ui-angular/src/main/webapp/index.html +++ b/pollen-ui-angular/src/main/webapp/index.html @@ -29,10 +29,10 @@ <script src="js/conf.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-route.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-resource.min.js"></script> - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-cookies.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-route.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-resource.min.js"></script> + <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-cookies.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.11.0/ui-bootstrap-tpls.min.js"></script> <script src="js/libs/ckeditor/ckeditor.js"></script> @@ -40,6 +40,7 @@ <script src="js/services.js"></script> <script src="js/controllers/pollCtrl.js"></script> <script src="js/controllers/userCtrl.js"></script> + <script src="js/controllers/localeCtrl.js"></script> </head> <body> @@ -48,6 +49,15 @@ <div class="navbar-header"> <a class="navbar-brand" href="#">Pollen</a> </div> + <ul class="nav navbar-nav pull-right" ng-controller="LocaleCtrl"> + <li dropdown class="dropdown-toggle"> + <a> <img src="img/{{locale}}.png" /></a> + <ul class="dropdown-menu"> + <li><a ng-click="switchLocale('fr')"><img src="img/fr.png" /> Français </a></li> + <li><a ng-click="switchLocale('en')"><img src="img/en.png" /> English </a> </li> + </ul> + </li> + </ul> <div class="collapse navbar-collapse" ng-controller="UserLoginCtrl"> <ul class="nav navbar-nav"> <li><a href="#/poll/create">Creer</a></li> diff --git a/pollen-ui-angular/src/main/webapp/js/app.js b/pollen-ui-angular/src/main/webapp/js/app.js index e310b8f..d25969c 100644 --- a/pollen-ui-angular/src/main/webapp/js/app.js +++ b/pollen-ui-angular/src/main/webapp/js/app.js @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * #L% */ -angular.module('pollen', ['pollenServices', 'ngRoute', 'pollControllers', 'userControllers', 'ui.bootstrap', 'ngCookies']) +angular.module('pollen', ['pollenServices', 'ngRoute', 'pollControllers', 'userControllers', 'localeControllers', 'ui.bootstrap', 'ngCookies']) .config(['$httpProvider', function($httpProvider) { // edit header for locale and sessionToken $httpProvider.interceptors.push('httpInterceptor'); diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js new file mode 100644 index 0000000..fe18e24 --- /dev/null +++ b/pollen-ui-angular/src/main/webapp/js/controllers/localeCtrl.js @@ -0,0 +1,32 @@ +/* + * #%L + * Pollen :: UI (Angular) + * %% + * Copyright (C) 2009 - 2014 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +angular.module('localeControllers', []) +.controller('LocaleCtrl', ['$scope', 'SessionStorage',function ($scope, SessionStorage) { + $scope.locale = SessionStorage.get().locale; + + $scope.switchLocale = function (locale) { + //change locale + if (locale != $scope.locale) { + SessionStorage.save({locale:locale}); + $scope.locale = locale; + } + } +}]) -- To stop receiving notification emails like this one, please contact Chorem.org SCM administrator <admin+scm@chorem.org>.