This is an automated email from the git hooks/post-receive script. New commit to branch feature/Notification in repository pollen. See http://git.chorem.org/pollen.git commit fa6d20f44bbfc448c2481f6bc061ffa46bcf5234 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Tue Aug 26 10:36:56 2014 +0200 UI can validate email --- pollen-rest-api/src/main/resources/mapping | 2 +- pollen-ui-angular/src/main/webapp/i18n/en.js | 2 ++ pollen-ui-angular/src/main/webapp/i18n/fr.js | 2 ++ pollen-ui-angular/src/main/webapp/js/app.js | 2 +- pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js | 12 ++++++++++++ pollen-ui-angular/src/main/webapp/js/services.js | 4 ++++ pollen-ui-angular/src/main/webapp/partials/user-login.html | 2 +- 7 files changed, 23 insertions(+), 3 deletions(-) diff --git a/pollen-rest-api/src/main/resources/mapping b/pollen-rest-api/src/main/resources/mapping index f1d6520..3d07c2b 100644 --- a/pollen-rest-api/src/main/resources/mapping +++ b/pollen-rest-api/src/main/resources/mapping @@ -132,7 +132,7 @@ GET /v1/resources/{resourceId}/{n} forward:/v1/resources/{resour GET /v1/users PollenUserApi.getUsers GET /v1/users/{userId} PollenUserApi.getUser POST /v1/users PollenUserApi.createUser -PUT,POST /v1/users/{userId} PollenUserApi.editUser +POST /v1/users/{userId} PollenUserApi.editUser PUT,POST /v1/users/{userId}/password PollenUserApi.changePassword POST /v1/users/{userId}/admin PollenUserApi.adminUser DELETE /v1/users/{userId} PollenUserApi.deleteUser diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index 0266ea8..db8306a 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -48,6 +48,8 @@ var translateEN = { 'user.delete.success' : 'Delete user successfull', 'user.generatePassword' : 'Generate new password', 'user.generatePassword.success' : 'E-mail send with new password', +'user.validate.success' : 'You just validate you email, you can login now', +'user.validate.error' : 'Email already validate or invalid', 'user.error.password.diff' : 'Passwords not equal', 'user.error.mail.notFound' : 'E-mail not found', 'user.error.mail.empty' : 'E-mail can not be empty', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index cf577de..98f0a06 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -48,6 +48,8 @@ var translateFR = { 'user.delete.success' : 'Suppression de l\'utilisateur avec succès', 'user.generatePassword' : 'Générer un nouveau mot de passe', 'user.generatePassword.success' : 'Un mail avec le nouveau mot de passe vient d\'être envoyé..', +'user.validate.success' : 'Vous venez de valider votre courriel, connectez-vous dès maintenants.', +'user.validate.error' : 'Erreur lors de la validation, courriel déjà validé ou invalide', 'user.error.password.diff' : 'Mot de passe différent', 'user.error.mail.notFound' : 'Courriel n\'a pas été trouvé', 'user.error.mail.empty' : 'Courriel ne peux pas être vide', diff --git a/pollen-ui-angular/src/main/webapp/js/app.js b/pollen-ui-angular/src/main/webapp/js/app.js index 253e6dd..ee8b99f 100644 --- a/pollen-ui-angular/src/main/webapp/js/app.js +++ b/pollen-ui-angular/src/main/webapp/js/app.js @@ -122,7 +122,7 @@ angular.module('pollen', ['pollenDirective', 'pollenServices', 'ngRoute', 'Polle .when('/user/register', {templateUrl: './partials/user-register.html', controller:"UserRegisterCtrl"}) .when('/user/edit', {templateUrl: './partials/user-edit.html', controller:"UserEditCtrl"}) .when('/user/lostpassword', {templateUrl: './partials/user-lostPassword.html', controller:"UserLostPasswordCtrl"}) - .when('/user/:userId/:token', {templateUrl: './partials/user-lostPassword.html', controller:"UserLostPasswordCtrl"}) + .when('/user/:userId/:token', {templateUrl: './partials/home.html', controller:"UserValidateCtrl"}) .when('/favoriteList', {templateUrl: './partials/favoriteList-list.html', controller:"FavoriteListCtrl"}) .when('/favoriteList/new', {templateUrl: './partials/favoriteList-edit.html', controller:"FavoriteListEditCtrl"}) .when('/favoriteList/:favoriteListId', {templateUrl: './partials/favoriteList-edit.html', controller:"FavoriteListEditCtrl"}) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js index a0b8dd4..38d3a79 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/userCtrl.js @@ -76,7 +76,19 @@ angular.module('userControllers', []) } }]) +.controller('UserValidateCtrl', ['$scope', '$rootScope', '$routeParams', '$location', 'User', + function ($scope, $rootScope, $routeParams, $location, User) { + if (angular.isDefined($routeParams.userId) && angular.isDefined($routeParams.token)) { + User.validate({userId: $routeParams.userId, token:$routeParams.token}, null, function() { + $rootScope.$broadcast('newSuccess', 'user.validate.success'); + $location.url('/'); + }, function () { + $rootScope.$broadcast('newError', 'user.validate.error'); + $location.url('/'); + }); + } +}]) .controller('UserEditCtrl', ['$scope', '$rootScope', '$routeParams', '$route', '$location', '$translate', 'User', 'SessionStorage', 'Page', function ($scope, $rootScope, $routeParams, $route, $location, $translate, User, SessionStorage, Page) { diff --git a/pollen-ui-angular/src/main/webapp/js/services.js b/pollen-ui-angular/src/main/webapp/js/services.js index 51d46ff..55112f9 100644 --- a/pollen-ui-angular/src/main/webapp/js/services.js +++ b/pollen-ui-angular/src/main/webapp/js/services.js @@ -243,6 +243,10 @@ angular.module('pollenServices', ['ngResource']) 'ban' : { method:'DELETE', url: conf.restURL+'/users/:userId/ban' + }, + 'validate' : { + method:'PUT', + url: conf.restURL+'/users/:userId' } } ); diff --git a/pollen-ui-angular/src/main/webapp/partials/user-login.html b/pollen-ui-angular/src/main/webapp/partials/user-login.html index 5099fdc..0db15c4 100644 --- a/pollen-ui-angular/src/main/webapp/partials/user-login.html +++ b/pollen-ui-angular/src/main/webapp/partials/user-login.html @@ -19,7 +19,7 @@ #L% --> -<form id='loginForm' ng-submit="login()"> +<form class='loginForm' ng-submit="login()"> <div class="control-group"> <label class="control-label"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.