This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 738fe2749be2d1b92b77cf955f3b53e820efb50f Author: Yannick Martel <martel@©odelutin.com> Date: Wed Feb 18 12:12:01 2015 +0100 Logout cleanly user when authentication error are thrown by server internal-test #6524 --- coselmar-ui/src/main/webapp/i18n/en.js | 8 ++++ coselmar-ui/src/main/webapp/i18n/fr.js | 8 ++++ coselmar-ui/src/main/webapp/index.html | 30 ++++++------- .../src/main/webapp/js/coselmar-controllers.js | 52 +++++++++++++--------- .../src/main/webapp/views/documents/documents.html | 4 +- .../main/webapp/views/documents/editDocument.html | 2 +- .../main/webapp/views/documents/viewDocument.html | 2 +- coselmar-ui/src/main/webapp/views/errors/401.html | 4 +- coselmar-ui/src/main/webapp/views/errors/403.html | 4 +- coselmar-ui/src/main/webapp/views/errors/404.html | 4 +- coselmar-ui/src/main/webapp/views/home.html | 26 +++++------ .../main/webapp/views/questions/editquestion.html | 4 +- .../main/webapp/views/questions/newquestion.html | 4 +- .../src/main/webapp/views/questions/question.html | 8 ++-- .../src/main/webapp/views/questions/questions.html | 32 ++++++------- .../main/webapp/views/questions/viewquestion.html | 2 +- .../main/webapp/views/referential/referential.html | 2 +- .../src/main/webapp/views/users/adminUsers.html | 2 +- .../src/main/webapp/views/users/edituser.html | 10 ++--- .../src/main/webapp/views/users/newuser.html | 4 +- .../src/main/webapp/views/users/searchPart.html | 4 +- .../main/webapp/views/users/supervisorUsers.html | 2 +- coselmar-ui/src/main/webapp/views/users/user.html | 6 +-- coselmar-ui/src/main/webapp/views/users/users.html | 4 +- 24 files changed, 126 insertions(+), 102 deletions(-) diff --git a/coselmar-ui/src/main/webapp/i18n/en.js b/coselmar-ui/src/main/webapp/i18n/en.js index 8a6e6d1..2630856 100644 --- a/coselmar-ui/src/main/webapp/i18n/en.js +++ b/coselmar-ui/src/main/webapp/i18n/en.js @@ -236,6 +236,7 @@ var translateEN = { "user.message.disable" : "User well disable.", "user.message.enable" : "User well enable.", "user.message.mail.alreadyExisting" : "The provided mail (or login) already exists.", +"user.message.login.fail" : "Fail to login, please try again.", "user.button.add" : "Add an user", "user.button.add.client" : "Add a client", @@ -310,4 +311,11 @@ var translateEN = { </p>", "home.connected.lastProjects" : "Last projects", +"error.message.authentication.title" : "Error with authentication", +"error.message.authentication.body" : "Error with authentication, please try to log again.", +"error.message.unauthorized.title" : "Not Authorized", +"error.message.unauthorized.body" : "You are not authorized to access this page.", +"error.message.notFound.title" : "Nothing Here", +"error.message.notFound.body" : "The page you try to access does not exist.", + } \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/i18n/fr.js b/coselmar-ui/src/main/webapp/i18n/fr.js index bff7778..0e97338 100644 --- a/coselmar-ui/src/main/webapp/i18n/fr.js +++ b/coselmar-ui/src/main/webapp/i18n/fr.js @@ -236,6 +236,7 @@ var translateFR = { "user.message.disable" : "Utilisateur désactivé.", "user.message.enable" : "Utilisateur réactivé.", "user.message.mail.alreadyExisting" : "Le courriel (ou identifiant) saisi est déjà attribué.", +"user.message.login.fail" : "La connexion a échoué, veuillez réessayer.", "user.button.add" : "Ajouter un utilisateur", "user.button.add.client" : "Ajouter un client", @@ -311,4 +312,11 @@ var translateFR = { </p>", "home.connected.lastProjects" : "Derniers projets", +"error.message.authentication.title" : "Échec d'authentification", +"error.message.authentication.body" : "Une erreur avec l'authentification est survenue, veuillez vous reconnecter svp.", +"error.message.unauthorized.title" : "Non autorisé", +"error.message.unauthorized.body" : "Vous n'êtes pas autorisé à consulter cette page.", +"error.message.notFound.title" : "Perdu ?", +"error.message.notFound.body" : "Vous êtes ici, mais il n'y a rien ici.", + } \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/index.html b/coselmar-ui/src/main/webapp/index.html index 53ef995..2f2ed88 100644 --- a/coselmar-ui/src/main/webapp/index.html +++ b/coselmar-ui/src/main/webapp/index.html @@ -92,34 +92,34 @@ <span class="title">{{ 'application.title' | translate}}</span> </a> - <li class="dropdown" ng-if="currentUser"> + <li class="dropdown" ng-if="context.currentUser"> <a class="dropdown-toggle" data-toggle="dropdown">{{ 'menu.item.questions' | translate}}<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#/questions" role="menuitem">{{ 'menu.item.questions.list' | translate}}</a></li> - <li><a href="#/questions/new" role="menuitem" ng-if="currentUser.role == 'SUPERVISOR'">{{ 'menu.item.questions.add' | translate}}</a></li> + <li><a href="#/questions/new" role="menuitem" ng-if="context.currentUser.role == 'SUPERVISOR'">{{ 'menu.item.questions.add' | translate}}</a></li> </ul> </li> - <li ng-if="currentUser"> + <li ng-if="context.currentUser"> <a href="#/documents" role="button" class="dropdown-toggle">{{ 'menu.item.documents' | translate}}</a> </li> - <li ng-if="currentUser"> + <li ng-if="context.currentUser"> <a href="#/referential" role="button" class="dropdown-toggle">{{ 'menu.item.referential' | translate}}</a> </li> - <li class="dropdown" ng-if="currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR'"> + <li class="dropdown" ng-if="context.currentUser.role == 'ADMIN' || context.currentUser.role == 'SUPERVISOR'"> <a class="dropdown-toggle" data-toggle="dropdown">{{ 'menu.item.users' | translate}}<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#/users" role="menuitem">{{ 'menu.item.users.list' | translate}}</a></li> - <li><a href="#/users/new" role="menuitem" ng-if="currentUser.role == 'ADMIN'">{{ 'menu.item.users.add' | translate}}</a></li> - <li><a href="#/users/new" role="menuitem" ng-if="currentUser.role == 'SUPERVISOR'">{{ 'menu.item.users.add.client' | translate}}</a></li> + <li><a href="#/users/new" role="menuitem" ng-if="context.currentUser.role == 'ADMIN'">{{ 'menu.item.users.add' | translate}}</a></li> + <li><a href="#/users/new" role="menuitem" ng-if="context.currentUser.role == 'SUPERVISOR'">{{ 'menu.item.users.add.client' | translate}}</a></li> </ul> </li> </ul> <!-- Login Part --> - <form class="navbar-form navbar-right" role="form" ng-if="!currentUser"> + <form class="navbar-form navbar-right" role="form" ng-if="!context.currentUser"> <div class="user-info"> {{ 'user.message.login' | translate}} (<a href="#/users/forgotPassword">{{ 'user.message.forgotPassword' | translate }}</a> ) </div> @@ -132,12 +132,12 @@ <button type="submit" class="btn btn-action" ng-click="login(loginMail, loginPassword)">{{ 'menu.button.login' | translate}}</button> </form> - <form class="navbar-form navbar-right" role="form" ng-if="currentUser"> + <form class="navbar-form navbar-right" role="form" ng-if="context.currentUser"> <div class="user-info text-center"> - {{currentUser.firstName}} {{currentUser.lastName}} <span class="user-role">({{currentUser.role}})</span> + {{context.currentUser.firstName}} {{context.currentUser.lastName}} <span class="user-role">({{context.currentUser.role}})</span> </div> <div class="form-group"> - <a href="#/users/{{currentUser.userId}}?edit" class="btn btn-action"> + <a href="#/users/{{context.currentUser.userId}}?edit" class="btn btn-action"> <span class="glyphicon glyphicon-user" aria-hidden="true"></span>{{ 'menu.button.profile' | translate}} </a> <button type="submit" class="btn btn-action" ng-click="logout()"> @@ -159,16 +159,16 @@ </nav> <nav class="visible-xs" collapse="!isCollapsed"> <ul class="nav navbar-nav"> - <li ng-if="currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR'"> + <li ng-if="context.currentUser.role == 'ADMIN' || context.currentUser.role == 'SUPERVISOR'"> <a href="#users" ng-click="isCollapsed = !isCollapsed">{{ 'menu.item.users' | translate}}</a> </li> - <li ng-if="currentUser"> + <li ng-if="context.currentUser"> <a href="#documents" ng-click="isCollapsed = !isCollapsed">{{ 'menu.item.documents' | translate}}</a> </li> - <li ng-if="currentUser"> + <li ng-if="context.currentUser"> <a href="#questions" ng-click="isCollapsed = !isCollapsed">{{ 'menu.item.questions' | translate}}</a> </li> - <li ng-if="currentUser"> + <li ng-if="context.currentUser"> <a href="#referential" ng-click="isCollapsed = !isCollapsed">{{ 'menu.item.referential' | translate}}</a> </li> </ul> diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 7b64073..81ff61a 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -24,12 +24,12 @@ var coselmarControllers = angular.module('coselmarControllers', ['ui.bootstrap', 'ui.select', 'ui.bootstrap.tooltip', 'pascalprecht.translate', 'tmh.dynamicLocale']); // Controller when the main page/view loads -coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$route', '$routeParams', '$locale', '$translate', 'tmhDynamicLocale', 'userService', 'jwtHelper', 'coselmar-config', - function ($scope, $http, $location, $route, $routeParams, $locale, $translate, tmhDynamicLocale, userService, jwtHelper, coselmarConfig) { +coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$route', '$routeParams', '$locale', '$translate', 'tmhDynamicLocale', 'userService', 'jwtHelper', 'coselmar-config', 'notify', + function ($scope, $http, $location, $route, $routeParams, $locale, $translate, tmhDynamicLocale, userService, jwtHelper, coselmarConfig, notify) { var jwtToken = localStorage.getItem('coselmar-jwt'); if (jwtToken && !jwtHelper.isTokenExpired(jwtToken)) { - $scope.currentUser = jwtHelper.decodeToken(jwtToken); + $scope.context = {currentUser : jwtHelper.decodeToken(jwtToken)}; } //Just get the version from a file @@ -41,7 +41,7 @@ coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$ro userService.login(mail, password, function(successResult) { // Store JsonWebToken to keep authentication localStorage.setItem('coselmar-jwt', successResult.jwt); - $scope.currentUser = jwtHelper.decodeToken(successResult.jwt); + $scope.context = { currentUser : jwtHelper.decodeToken(successResult.jwt) }; // Redirect on initial request page if ($location.search()["returnTo"]) { @@ -51,11 +51,19 @@ coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$ro // Reload page $route.reload(); } + }, function(error) { + // Mail already existing + notify({ + message: "user.message.login.fail", + classes: "alert-danger", + templateUrl: "views/notificationTemplate.html" + }); + }) } $scope.logout = function() { - delete $scope.currentUser; + delete $scope.context.currentUser; localStorage.removeItem('coselmar-jwt'); $location.path('/'); } @@ -95,18 +103,20 @@ coselmarControllers.controller("HomeCtrl", ['$scope', '$http', '$location', '$ro }]); // Controller when got 401 -coselmarControllers.controller("unauthorizedCtrl", ['$scope', function ($scope) { +coselmarControllers.controller("unauthorizedCtrl", ['$scope', '$location', function ($scope, $location) { // Just remove the current stored user - delete $scope.currentUser; - localStorage.removeItem('coselmar-jwt'); + if ($scope.context && $scope.context.currentUser) { + delete $scope.context.currentUser; + localStorage.removeItem('coselmar-jwt'); + } }]); // Controller for home when user connected, load 5 last projects coselmarControllers.controller("homeConnectedCtrl", ['$scope', 'questionsService', function ($scope, questionsService) { - if ($scope.currentUser) { + if ($scope.context && $scope.context.currentUser) { var searchOptions = {'limit' : 5, 'page' : 0}; @@ -160,7 +170,6 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara }; }]); - // Controller for new document View coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'notify', 'documentService', 'errorService', function($scope, $location, notify, documentService, errorService){ @@ -280,7 +289,7 @@ coselmarControllers.controller("DocumentViewCtrl", documentService.getDocument($routeParams.documentId, function(document) { $scope.document = document; $scope.canEdit = !(document.relatedQuestions && document.relatedQuestions.length > 0); - $scope.canEdit = $scope.canEdit && ($scope.currentUser.role == 'ADMIN' || $scope.currentUser.role == 'SUPERVISOR' || $scope.currentUser.userId == document.ownerId); + $scope.canEdit = $scope.canEdit && ($scope.context.currentUser.role == 'ADMIN' || $scope.context.currentUser.role == 'SUPERVISOR' || $scope.context.currentUser.userId == document.ownerId); if (document.publicationDate) { $scope.document.publicationDate = new Date(document.publicationDate); } @@ -333,7 +342,7 @@ coselmarControllers.controller("DocumentViewCtrl", isValid = isValid && $scope.document.authors && $scope.document.authors.length > 0; isValid = isValid && $scope.document.copyright && $scope.document.copyright.length > 0; isValid = isValid && $scope.document.summary && $scope.document.summary.length > 0; - if (!$scope.document.fileName && $scope.currentUser.role != 'ADMIN') { + if (!$scope.document.fileName && $scope.context.currentUser.role != 'ADMIN') { isValid = isValid && (($scope.document.externalUrl && $scope.document.externalUrl.length > 0) || $scope.upload.file); } return isValid; @@ -556,16 +565,15 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', }; }]); - // Controller for new user View coselmarControllers.controller("NewUserCtrl", ['$scope', '$route', '$location', 'userService', 'notify', 'errorService', function($scope, $route, $location, userService, notify, errorService) { - if (!$scope.currentUser) { + if (!$scope.context && $scope.context.currentUser) { errorService.reject401(); - } else if ($scope.currentUser.role == 'ADMIN') { + } else if ($scope.context.currentUser.role == 'ADMIN') { $scope.user = {'role' : 'EXPERT'}; - } else if ($scope.currentUser.role == 'SUPERVISOR') { + } else if ($scope.context.currentUser.role == 'SUPERVISOR') { $scope.user = {'role' : 'CLIENT'}; } else { $location.path("403"); @@ -693,7 +701,7 @@ coselmarControllers.controller("UserViewCtrl", templateUrl: "views/notificationTemplate.html" }); // On success, back on users list for admin or supervisor - if ($scope.currentUser.role == 'ADMIN' || $scope.currentUser.role == 'SUPERVISOR') { + if ($scope.context.currentUser.role == 'ADMIN' || $scope.context.currentUser.role == 'SUPERVISOR') { $location.path("/users"); } else { $location.search(""); @@ -707,13 +715,13 @@ coselmarControllers.controller("UserViewCtrl", classes: "alert-danger", templateUrl: "views/notificationTemplate.html" }); - } else if (error.status = 403) { + } else if (error.status == 403) { errorService.reject403(); - } else if (error.status = 401) { + } else if (error.status == 401) { errorService.reject401(); - } else if (error.status = 404) { + } else if (error.status == 404) { errorService.reject404(); } else { @@ -952,7 +960,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam // update scope about current user : if he is participant, more option enable in ui if ($scope.question.participants) { for (var i = 0; i < $scope.question.participants.length; i++) { - if ($scope.question.participants[i].id == $scope.currentUser.userId) { + if ($scope.question.participants[i].id == $scope.context.currentUser.userId) { $scope.isCurrentParticipant = true; // Should be able to put new documents in question $scope.question.newRelatedDocuments = []; @@ -1220,7 +1228,7 @@ coselmarControllers.controller("QuestionCtrl", ['$scope', '$route', '$routeParam $scope.isClient = function() { var isClient = false; angular.forEach($scope.question.clients, function(client) { - if (client.id == $scope.currentUser.id) { + if (client.id == $scope.context.currentUser.id) { isClient = true; } }); diff --git a/coselmar-ui/src/main/webapp/views/documents/documents.html b/coselmar-ui/src/main/webapp/views/documents/documents.html index b36686b..360bbeb 100644 --- a/coselmar-ui/src/main/webapp/views/documents/documents.html +++ b/coselmar-ui/src/main/webapp/views/documents/documents.html @@ -31,7 +31,7 @@ <div> <div> - <div class="form-group" ng-if="currentUser.role == 'EXPERT' || currentUser.role == 'SUPERVISOR'"> + <div class="form-group" ng-if="context.currentUser.role == 'EXPERT' || context.currentUser.role == 'SUPERVISOR'"> <a href="#/documents/new" class="form-inline navbar-left btn btn-primary">{{ 'document.button.add' | translate}}</a> </div> <form class="form-inline pull-right search-zone" role="documentOptions" ng-submit="searchDocuments()"> @@ -65,7 +65,7 @@ <td>{{document.ownerName}}</td> <td>{{document.depositDate | date:'mediumDate'}}</td> <td class="text-center">{{document.nbRelatedQuestions || 0}}</td> - <td ng-if="currentUser.role == 'ADMIN'"><a class="btn btn-action btn-disable" + <td ng-if="context.currentUser.role == 'ADMIN'"><a class="btn btn-action btn-disable" ng-confirm-message="document.message.delete" ng-confirm-click="deleteDocument(document.id)"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>{{ 'common.button.delete' | translate }}</a> diff --git a/coselmar-ui/src/main/webapp/views/documents/editDocument.html b/coselmar-ui/src/main/webapp/views/documents/editDocument.html index dcd81c1..27faa77 100644 --- a/coselmar-ui/src/main/webapp/views/documents/editDocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/editDocument.html @@ -166,7 +166,7 @@ </div> </div> - <p ng-show="!document.externalUrl && !document.fileName && !upload.file && currentUser.role != 'ADMIN'" + <p ng-show="!document.externalUrl && !document.fileName && !upload.file && context.currentUser.role != 'ADMIN'" class="help-block text-center clear">{{ 'document.message.requiredExternalUrlOrFile' | translate }}</p> </div> diff --git a/coselmar-ui/src/main/webapp/views/documents/viewDocument.html b/coselmar-ui/src/main/webapp/views/documents/viewDocument.html index 95ce5ed..c18b944 100644 --- a/coselmar-ui/src/main/webapp/views/documents/viewDocument.html +++ b/coselmar-ui/src/main/webapp/views/documents/viewDocument.html @@ -153,7 +153,7 @@ <a href="{{document.externalUrl}}" target="_blank" class="btn btn-action btn-success" ng-if="document.externalUrl"> <span class="fa fa-external-link" aria-hidden="true"></span>{{ 'document.button.openLink' | translate }} </a> - <a class="btn btn-action btn-disable" ng-if="currentUser.role == 'ADMIN'" + <a class="btn btn-action btn-disable" ng-if="context.currentUser.role == 'ADMIN'" ng-confirm-message="Do you really want to delete this document ?" ng-confirm-click="deleteDocument(document.id)"> <span class="fa fa-remove" aria-hidden="true"></span>{{ 'common.button.delete' | translate }} diff --git a/coselmar-ui/src/main/webapp/views/errors/401.html b/coselmar-ui/src/main/webapp/views/errors/401.html index e03a8d1..807b734 100644 --- a/coselmar-ui/src/main/webapp/views/errors/401.html +++ b/coselmar-ui/src/main/webapp/views/errors/401.html @@ -23,8 +23,8 @@ --> <div> <div> - <h1>Authentication Error</h1> - <p>Error with authentication, please try to log again.</p> + <h1>{{ 'error.message.authentication.title' | translate }}</h1> + <p>{{ 'error.message.authentication.body' | translate }}</p> </div> </div> \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/errors/403.html b/coselmar-ui/src/main/webapp/views/errors/403.html index 1caf1bd..700cc0e 100644 --- a/coselmar-ui/src/main/webapp/views/errors/403.html +++ b/coselmar-ui/src/main/webapp/views/errors/403.html @@ -22,6 +22,6 @@ #L% --> <div> - <h1>Not Authorized</h1> - <p>You are not authorized to access this page.</p> + <h1>{{ 'error.message.unauthorized.title' | translate }}</h1> + <p>{{ 'error.message.unauthorized.body' | translate }}</p> </div> \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/errors/404.html b/coselmar-ui/src/main/webapp/views/errors/404.html index f9ec037..277a6dc 100644 --- a/coselmar-ui/src/main/webapp/views/errors/404.html +++ b/coselmar-ui/src/main/webapp/views/errors/404.html @@ -22,6 +22,6 @@ #L% --> <div> - <h1>Nothing Here</h1> - <p>The page you try to access does not exist.</p> + <h1>{{ 'error.message.notFound.title' | translate }}</h1> + <p>{{ 'error.message.notFound.body' | translate }}</p> </div> \ No newline at end of file diff --git a/coselmar-ui/src/main/webapp/views/home.html b/coselmar-ui/src/main/webapp/views/home.html index e21988b..9b4c166 100644 --- a/coselmar-ui/src/main/webapp/views/home.html +++ b/coselmar-ui/src/main/webapp/views/home.html @@ -21,12 +21,12 @@ <http://www.gnu.org/licenses/gpl-3.0.html>. #L% --> -<div ng-if="!currentUser"> +<div ng-if="!context.currentUser"> <div translate="home.presentation.title"></div> <div style="margin-top : 50px" translate="home.presentation.body"></div> </div> -<div ng-if="currentUser"> +<div ng-if="context.currentUser"> <!-- In case of user connected, show five last projects --> <div translate="home.presentation.title"></div> <div> @@ -39,18 +39,18 @@ <th>{{ 'question.metadata.submissionDate' | translate }}</th> <th>{{ 'question.metadata.themes' | translate }}</th> <th>{{ 'question.metadata.deadline' | translate }}</th> - <th ng-if="currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">{{ 'question.metadata.clients' | translate }}</th> - <th ng-if="currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">{{ 'question.metadata.participants' | translate }}</th> - <th ng-if="currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">{{ 'question.metadata.relatedDocuments' | translate }}</th> + <th ng-if="context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">{{ 'question.metadata.clients' | translate }}</th> + <th ng-if="context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">{{ 'question.metadata.participants' | translate }}</th> + <th ng-if="context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">{{ 'question.metadata.relatedDocuments' | translate }}</th> </tr> </thead> <tbody> <tr ng-repeat="question in questions" > - <td ng-if="currentUser.role != 'MEMBER'"> + <td ng-if="context.currentUser.role != 'MEMBER'"> <span class="status-{{question.status|lowercase}}" title="{{question.status | translate}}"></span> <a href="#/questions/{{question.id}}" class="paddingLeft10" tooltip-placement="bottom" tooltip-html-unsafe="{{question.summary}}">{{question.title}}</a> </td> - <td ng-if="currentUser.role == 'MEMBER'">{{question.title}}</td> + <td ng-if="context.currentUser.role == 'MEMBER'">{{question.title}}</td> <td>{{question.submissionDate | date:'mediumDate'}}</td> @@ -59,22 +59,22 @@ <td>{{question.deadline | date:'mediumDate'}}</td> <!-- clients : we use ng-if for better tooltip management --> - <td ng-if="question.clients && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'"> + <td ng-if="question.clients && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.clients)}}" >{{question.clients.length}}</span> </td> - <td ng-if="!question.clients && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">0</td> + <td ng-if="!question.clients && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> <!-- participants --> - <td ng-if="question.participants && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'"> + <td ng-if="question.participants && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.participants)}}" >{{question.participants.length}}</span> </td> - <td ng-if="!question.participants && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">0</td> + <td ng-if="!question.participants && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> <!-- related documents --> - <td ng-if="question.relatedDocuments && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'"> + <td ng-if="question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> <span tooltip-placement="bottom" tooltip-html-unsafe="{{getDocumentTitles(question.relatedDocuments)}}" tooltip-trigger="mouseenter" >{{question.relatedDocuments.length}}</span> </td> - <td ng-if="!question.relatedDocuments && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">0</td> + <td ng-if="!question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> </tr> </tbody> diff --git a/coselmar-ui/src/main/webapp/views/questions/editquestion.html b/coselmar-ui/src/main/webapp/views/questions/editquestion.html index 549dc49..68e5750 100644 --- a/coselmar-ui/src/main/webapp/views/questions/editquestion.html +++ b/coselmar-ui/src/main/webapp/views/questions/editquestion.html @@ -180,7 +180,7 @@ <td><span class="status-{{parent.status|lowercase}}"></span>{{parent.status | translate}}</td> <td><a class="btn fa fa-minus" title="Remove parent question" ng-click="removeParent(parent)" - ng-if="currentUser.role == 'SUPERVISOR'"/></td> + ng-if="context.currentUser.role == 'SUPERVISOR'"/></td> </tr> </tbody> </table> @@ -223,7 +223,7 @@ <td>{{document.depositDate | date:'mediumDate'}}</td> <td><a class="btn fa fa-minus" title="Remove document" ng-click="removeDocument(document, question.relatedDocuments)" - ng-if="currentUser.role == 'SUPERVISOR'"/></td> + ng-if="context.currentUser.role == 'SUPERVISOR'"/></td> </tr> </tbody> </table> diff --git a/coselmar-ui/src/main/webapp/views/questions/newquestion.html b/coselmar-ui/src/main/webapp/views/questions/newquestion.html index 7f21552..c0ab8ff 100644 --- a/coselmar-ui/src/main/webapp/views/questions/newquestion.html +++ b/coselmar-ui/src/main/webapp/views/questions/newquestion.html @@ -27,7 +27,7 @@ <span translate="common.message.mandatoryFieldsInfo"></span> </div> - <div style="padding-bottom: 50px" ng-if="currentUser.role == 'SUPERVISOR'"> + <div style="padding-bottom: 50px" ng-if="context.currentUser.role == 'SUPERVISOR'"> <form name="questionForm" class="form-horizontal" role="form"> @@ -39,7 +39,7 @@ </form> </div> - <div style="padding-bottom: 50px" ng-if="currentUser.role != 'SUPERVISOR'"> + <div style="padding-bottom: 50px" ng-if="context.currentUser.role != 'SUPERVISOR'"> {{ 'question.message.notAllowedToCreate' | translate }} </div> diff --git a/coselmar-ui/src/main/webapp/views/questions/question.html b/coselmar-ui/src/main/webapp/views/questions/question.html index 84eb363..4b549b3 100644 --- a/coselmar-ui/src/main/webapp/views/questions/question.html +++ b/coselmar-ui/src/main/webapp/views/questions/question.html @@ -54,18 +54,18 @@ </div> <div ng-include="src='views/questions/closeQuestion.html'" - ng-if="currentUser.role == 'SUPERVISOR' && closeSession" + ng-if="context.currentUser.role == 'SUPERVISOR' && closeSession" class="clear"> </div> - <div class="actions" ng-if="question.closingDate && currentUser.role == 'SUPERVISOR' && editSession == false"> + <div class="actions" ng-if="question.closingDate && context.currentUser.role == 'SUPERVISOR' && editSession == false"> <a class="btn btn-action btn-success" ng-click="reopenQuestion()"> <span class="fa fa-check-square-o" aria-hidden="true"></span>{{ 'question.button.reopen' | translate }} </a> </div> - <div class="actions" ng-if="!question.closingDate && currentUser.role == 'SUPERVISOR' && editSession == false && !closeSession"> - <a class="btn btn-action btn-edit" ng-click="edit()" ng-if="editSession != true && currentUser.role == 'SUPERVISOR'"> + <div class="actions" ng-if="!question.closingDate && context.currentUser.role == 'SUPERVISOR' && editSession == false && !closeSession"> + <a class="btn btn-action btn-edit" ng-click="edit()" ng-if="editSession != true && context.currentUser.role == 'SUPERVISOR'"> <span class="fa fa-edit" aria-hidden="true"></span>{{ 'common.button.edit' | translate }} </a> diff --git a/coselmar-ui/src/main/webapp/views/questions/questions.html b/coselmar-ui/src/main/webapp/views/questions/questions.html index 4899300..371e94a 100644 --- a/coselmar-ui/src/main/webapp/views/questions/questions.html +++ b/coselmar-ui/src/main/webapp/views/questions/questions.html @@ -32,7 +32,7 @@ <div> <div> - <div class="form-group" ng-if="currentUser.role == 'SUPERVISOR'"> + <div class="form-group" ng-if="context.currentUser.role == 'SUPERVISOR'"> <a href="#/questions/new" class="form-inline navbar-left btn btn-primary">{{ 'question.button.add' | translate }}</a> </div> <form class="form-inline pull-right search-zone" role="questionOptions" ng-submit="searchQuestions()"> @@ -52,19 +52,19 @@ <th>{{ 'question.metadata.submissionDate' | translate }}</th> <th>{{ 'question.metadata.themes' | translate }}</th> <th>{{ 'question.metadata.deadline' | translate }}</th> - <th ng-if="currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">{{ 'question.metadata.clients' | translate }}</th> - <th ng-if="currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">{{ 'question.metadata.participants' | translate }}</th> - <th ng-if="currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">{{ 'question.metadata.relatedDocuments' | translate }}</th> - <th ng-if="currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'"></th> + <th ng-if="context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">{{ 'question.metadata.clients' | translate }}</th> + <th ng-if="context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">{{ 'question.metadata.participants' | translate }}</th> + <th ng-if="context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">{{ 'question.metadata.relatedDocuments' | translate }}</th> + <th ng-if="context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"></th> </tr> </thead> <tbody> <tr ng-repeat="question in questions" > - <td ng-if="currentUser.role != 'MEMBER'"> + <td ng-if="context.currentUser.role != 'MEMBER'"> <span class="status-{{question.status|lowercase}}" title="{{question.status | translate}}"></span> <a href="#/questions/{{question.id}}" class="paddingLeft10" tooltip-placement="bottom" tooltip-html-unsafe="{{question.summary}}">{{question.title}}</a> </td> - <td ng-if="currentUser.role == 'MEMBER'">{{question.title}}</td> + <td ng-if="context.currentUser.role == 'MEMBER'">{{question.title}}</td> <td>{{question.submissionDate | date:'mediumDate'}}</td> @@ -73,31 +73,31 @@ <td>{{question.deadline | date:'mediumDate'}}</td> <!-- clients : we use ng-if for better tooltip management --> - <td ng-if="question.clients && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'"> + <td ng-if="question.clients && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.clients)}}" >{{question.clients.length}}</span> </td> - <td ng-if="!question.clients && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">0</td> + <td ng-if="!question.clients && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> <!-- participants --> - <td ng-if="question.participants && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'"> + <td ng-if="question.participants && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.participants)}}" >{{question.participants.length}}</span> </td> - <td ng-if="!question.participants && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">0</td> + <td ng-if="!question.participants && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> <!-- related documents --> - <td ng-if="question.relatedDocuments && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'"> + <td ng-if="question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> <span tooltip-placement="bottom" tooltip-html-unsafe="{{getDocumentTitles(question.relatedDocuments)}}" tooltip-trigger="mouseenter" >{{question.relatedDocuments.length}}</span> </td> - <td ng-if="!question.relatedDocuments && currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'">0</td> + <td ng-if="!question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> - <td ng-if="currentUser.role != 'MEMBER' && currentUser.role != 'CLIENT'"> + <td ng-if="context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> <!--<a class="btn btn-action btn-disable" ng-click="closeQuestion(question.id)"--> - <!--ng-if="currentUser.role == 'SUPERVISOR'">--> + <!--ng-if="context.currentUser.role == 'SUPERVISOR'">--> <!--<span class="fa fa-close" aria-hidden="true"></span>Close</a>--> <a class="btn btn-action btn-disable" ng-confirm-message="question.message.delete" ng-confirm-click="deleteQuestion(question.id)" - ng-if="currentUser.role == 'SUPERVISOR' || currentUser.role == 'ADMIN'"> + ng-if="context.currentUser.role == 'SUPERVISOR' || context.currentUser.role == 'ADMIN'"> <span class="fa fa-close" aria-hidden="true"></span>{{ 'common.button.delete' | translate }}</a> </td> </tr> diff --git a/coselmar-ui/src/main/webapp/views/questions/viewquestion.html b/coselmar-ui/src/main/webapp/views/questions/viewquestion.html index 8699edb..3c7eae7 100644 --- a/coselmar-ui/src/main/webapp/views/questions/viewquestion.html +++ b/coselmar-ui/src/main/webapp/views/questions/viewquestion.html @@ -35,7 +35,7 @@ <dt>{{ 'question.metadata.summary' | translate }}</dt> <dd>{{question.summary}}</dd> </dl> - <dl ng-if="currentUser.role == 'SUPERVISOR' || isCurrentParticipant "> + <dl ng-if="context.currentUser.role == 'SUPERVISOR' || isCurrentParticipant "> <dt>{{ 'question.metadata.relatedDocuments' | translate }}</dt> <dd> diff --git a/coselmar-ui/src/main/webapp/views/referential/referential.html b/coselmar-ui/src/main/webapp/views/referential/referential.html index cf0d79c..c8cc60f 100644 --- a/coselmar-ui/src/main/webapp/views/referential/referential.html +++ b/coselmar-ui/src/main/webapp/views/referential/referential.html @@ -121,7 +121,7 @@ </thead> <tbody> <tr ng-repeat="question in result.questions"> - <td ng-if="currentUser.role != 'MEMBER'"> + <td ng-if="context.currentUser.role != 'MEMBER'"> <a href="#/questions/{{question.id}}" target="_blank" tooltip-placement="bottom" tooltip-html-unsafe="{{question.summary}}">{{question.title}}</a> </td> diff --git a/coselmar-ui/src/main/webapp/views/users/adminUsers.html b/coselmar-ui/src/main/webapp/views/users/adminUsers.html index ac17557..40eb185 100644 --- a/coselmar-ui/src/main/webapp/views/users/adminUsers.html +++ b/coselmar-ui/src/main/webapp/views/users/adminUsers.html @@ -22,7 +22,7 @@ #L% --> - <div class="table-responsive" ng-if="currentUser.role == 'ADMIN'"> + <div class="table-responsive" ng-if="context.currentUser.role == 'ADMIN'"> <div ng-include="src='views/users/searchPart.html'" /> diff --git a/coselmar-ui/src/main/webapp/views/users/edituser.html b/coselmar-ui/src/main/webapp/views/users/edituser.html index a768748..144d42e 100644 --- a/coselmar-ui/src/main/webapp/views/users/edituser.html +++ b/coselmar-ui/src/main/webapp/views/users/edituser.html @@ -21,7 +21,7 @@ <http://www.gnu.org/licenses/gpl-3.0.html>. #L% --> - <div class="" ng-if="currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR' || currentUser.userId == user.id"> + <div class="" ng-if="context.currentUser.role == 'ADMIN' || context.currentUser.role == 'SUPERVISOR' || context.currentUser.userId == user.id"> <div ng-if="messages"> <p ng-repeat="message in messages" class="block"> @@ -53,7 +53,7 @@ </div> </div> - <div class="form-group" ng-if="currentUser.role == 'ADMIN'"> + <div class="form-group" ng-if="context.currentUser.role == 'ADMIN'"> <label class="col-md-4 control-label">{{ 'user.metadata.role' | translate }} *</label> <div class="col-md-5"> @@ -68,7 +68,7 @@ </div> - <div class="form-group" ng-if="currentUser.role == 'SUPERVISOR' && currentUser.id != user.userId"> + <div class="form-group" ng-if="context.currentUser.role == 'SUPERVISOR' && context.currentUser.id != user.userId"> <label class="col-md-4 control-label">{{ 'user.metadata.role' | translate }} *</label> <div class="col-md-5"> @@ -92,7 +92,7 @@ placeholder="login" required ng-if="simpleLogin" /> - <p ng-show="currentUser && (currentUser.role == 'ADMIN' || currentUser.role == 'SUPERVISOR') && currentUser.userId != user.id"> + <p ng-show="context.currentUser && (context.currentUser.role == 'ADMIN' || context.currentUser.role == 'SUPERVISOR') && context.currentUser.userId != user.id"> <input type="checkbox" ng-model="simpleLogin">{{ 'user.message.wannaSimpleLogin' | translate }} </p> <p ng-show="userForm.mail.$invalid && !userForm.mail.$pristine" class="help-block" ng-if="!simpleLogin">{{ 'user.message.invalidMail' | translate }}</p> @@ -135,7 +135,7 @@ </div> - <div class="form-group" ng-if="currentUser && currentUser.userId == user.id" + <div class="form-group" ng-if="context.currentUser && context.currentUser.userId == user.id" ng-class="{'has-error' : userForm.password.$invalid && !userForm.password.$pristine}"> <label class="col-md-4 control-label">{{ 'user.label.currentPasswordToValidate' | translate }} *</label> diff --git a/coselmar-ui/src/main/webapp/views/users/newuser.html b/coselmar-ui/src/main/webapp/views/users/newuser.html index db88f4d..b11473d 100644 --- a/coselmar-ui/src/main/webapp/views/users/newuser.html +++ b/coselmar-ui/src/main/webapp/views/users/newuser.html @@ -27,10 +27,10 @@ <span translate="common.message.mandatoryFieldsInfo"></span> </div> - <div class="info-panel" ng-if="currentUser.role == 'ADMIN'"> + <div class="info-panel" ng-if="context.currentUser.role == 'ADMIN'"> <p translate="user.create.info"></p> </div> - <div class="info-panel" ng-if="currentUser.role == 'SUPERVISOR'"> + <div class="info-panel" ng-if="context.currentUser.role == 'SUPERVISOR'"> {{ 'user.create.client.info' | translate }} </div> <div style="padding-bottom: 50px" ng-include="src='views/users/edituser.html'"> diff --git a/coselmar-ui/src/main/webapp/views/users/searchPart.html b/coselmar-ui/src/main/webapp/views/users/searchPart.html index 915e20f..9f4e18d 100644 --- a/coselmar-ui/src/main/webapp/views/users/searchPart.html +++ b/coselmar-ui/src/main/webapp/views/users/searchPart.html @@ -25,11 +25,11 @@ <!-- Simple search part --> <div> <div class="form-group"> - <a href="#/users/new" class="form-inline navbar-left btn btn-primary" ng-if="currentUser.role == 'ADMIN'"> + <a href="#/users/new" class="form-inline navbar-left btn btn-primary" ng-if="context.currentUser.role == 'ADMIN'"> {{ 'user.button.add' | translate }} </a> - <a href="#/users/new" class="form-inline navbar-left btn btn-primary" ng-if="currentUser.role == 'SUPERVISOR'"> + <a href="#/users/new" class="form-inline navbar-left btn btn-primary" ng-if="context.currentUser.role == 'SUPERVISOR'"> {{ 'user.button.add.client' | translate }} </a> </div> diff --git a/coselmar-ui/src/main/webapp/views/users/supervisorUsers.html b/coselmar-ui/src/main/webapp/views/users/supervisorUsers.html index c87fd47..6945b52 100644 --- a/coselmar-ui/src/main/webapp/views/users/supervisorUsers.html +++ b/coselmar-ui/src/main/webapp/views/users/supervisorUsers.html @@ -22,7 +22,7 @@ #L% --> - <div class="table-responsive" ng-if="currentUser.role == 'SUPERVISOR'"> + <div class="table-responsive" ng-if="context.currentUser.role == 'SUPERVISOR'"> <div ng-include="src='views/users/searchPart.html'" /> diff --git a/coselmar-ui/src/main/webapp/views/users/user.html b/coselmar-ui/src/main/webapp/views/users/user.html index 611c96a..2d13054 100644 --- a/coselmar-ui/src/main/webapp/views/users/user.html +++ b/coselmar-ui/src/main/webapp/views/users/user.html @@ -60,13 +60,13 @@ <a class="btn btn-action btn-edit" ng-confirm-message="user.message.disable" ng-confirm-click="disableUser()" - ng-if="currentUser.role == 'ADMIN' && user.active">{{ 'user.button.disable' | translate }}</a> + ng-if="context.currentUser.role == 'ADMIN' && user.active">{{ 'user.button.disable' | translate }}</a> <a class="btn btn-action" ng-click="enableUser()" - ng-if="currentUser.role == 'ADMIN' && !user.active">{{ 'user.button.enable' | translate }}</a> + ng-if="context.currentUser.role == 'ADMIN' && !user.active">{{ 'user.button.enable' | translate }}</a> <a class="btn btn-action btn-disable" ng-confirm-message="user.message.delete" ng-confirm-click="deleteUser(user.id)" - ng-if="currentUser.role == 'ADMIN'">Delete</a> + ng-if="context.currentUser.role == 'ADMIN'">Delete</a> </div> </div> diff --git a/coselmar-ui/src/main/webapp/views/users/users.html b/coselmar-ui/src/main/webapp/views/users/users.html index 71babd0..99d39a2 100644 --- a/coselmar-ui/src/main/webapp/views/users/users.html +++ b/coselmar-ui/src/main/webapp/views/users/users.html @@ -29,8 +29,8 @@ </h1> </div> - <div ng-include="src='views/users/adminUsers.html'" ng-if="currentUser.role == 'ADMIN'"></div> - <div ng-include="src='views/users/supervisorUsers.html'" ng-if="currentUser.role == 'SUPERVISOR'"></div> + <div ng-include="src='views/users/adminUsers.html'" ng-if="context.currentUser.role == 'ADMIN'"></div> + <div ng-include="src='views/users/supervisorUsers.html'" ng-if="context.currentUser.role == 'SUPERVISOR'"></div> <p ng-if="users && users.length == 0" translate="common.search.noResult" class="info"/> </div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.