This is an automated email from the git hooks/post-receive script. New commit to branch feature/editVote in repository pollen. See http://git.chorem.org/pollen.git commit 587c4a0796392e3d658cb767fa61df15ceb727ce Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Jul 31 14:13:25 2014 +0200 improve message with url for edit poll --- pollen-ui-angular/src/main/webapp/i18n/en.js | 1 + pollen-ui-angular/src/main/webapp/i18n/fr.js | 1 + .../src/main/webapp/js/controllers/pollCtrl.js | 27 ++++++++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index e7060f5..3ad3439 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -71,6 +71,7 @@ var translateEN = { 'poll.edit' : 'Click to edit', 'poll.desc' : 'Description is optional. This message will not visible in vote page.', 'poll.saved' : 'Poll saved.', +'poll.created.printLink' : 'You can modify your poll to using this address when you are not connected: {{url}}', 'poll.cloned' : 'Poll cloned', 'poll.closed' : 'Poll closed', 'poll.deleted' : 'Poll deleted', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index f5c6714..81e089f 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -71,6 +71,7 @@ var translateFR = { 'poll.edit' : 'Clique pour éditer', 'poll.desc' : 'Description (Facultatif). Ce cadre disparait si aucune description n\'est mise', 'poll.saved' : 'Sondage sauvegardé', +'poll.created.printLink' : 'Garder le lien suivant pour pouvoir modifier votre sondage plus tard, lorsque vous n\'êtes pas connecté : {{url}}', 'poll.cloned' : 'Sondage cloné', 'poll.closed' : 'Sondage clos', 'poll.deleted' : 'Sondage supprimé', diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index 0896b82..c78c1a7 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -65,6 +65,14 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.globalVariables.toDay = new Date(); $scope.globalVariables.minify = $scope.session.menuMinify; + var baseUrl = window.location.protocol+'//'+window.location.hostname; + if (window.location.port != "") { + baseUrl += ':'+window.location.port; + } + baseUrl += window.location.pathname; + + $scope.globalVariables.baseUrl = baseUrl; + /** * Sauvegarde du token si non connecté */ @@ -132,13 +140,7 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr }) pollDeferred.promise.then(function () { - var baseUrl = window.location.protocol+'//'+window.location.hostname; - if (window.location.port != "") { - baseUrl += ':'+window.location.port; - } - baseUrl += window.location.pathname; - - $scope.globalVariables.baseUrl = baseUrl; + var baseUrl = $scope.globalVariables.baseUrl; $scope.globalVariables.linkHome = baseUrl; $scope.globalVariables.linkVote = baseUrl; $scope.globalVariables.linkComment = baseUrl; @@ -676,8 +678,8 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr // Admin create poll controller // ////////////////////////////////// -.controller('PollCreateCtrl', ['$scope', '$rootScope', '$controller', '$location', 'Poll', 'SessionStorage', 'PollVoterList', 'Page', - function ( $scope, $rootScope, $controller, $location, Poll, SessionStorage, PollVoterList, Page) { +.controller('PollCreateCtrl', ['$scope', '$rootScope', '$controller', '$location', '$filter', 'Poll', 'SessionStorage', 'PollVoterList', 'Page', + function ( $scope, $rootScope, $controller, $location, $filter, Poll, SessionStorage, PollVoterList, Page) { $controller('PollCtrl', {$scope:$scope}); $controller('PollAdminCtrl', {$scope:$scope}); @@ -723,6 +725,13 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr Poll.add(poll, function (data) { $rootScope.$broadcast('newSuccess', 'poll.saved'); + $rootScope.$broadcast('newInfo', + $filter('translate')('poll.created.printLink', {url: + '<input type="text" class="form-control" value="' + + $scope.globalVariables.baseUrl+'#/poll/edit/'+data.id+'/'+data.permission + + '" readonly />' + }) + , -1); if ($scope.data.poll.pollType != 'FREE') { SessionStorage.save({'voterList':$scope.data.voterList}) $location.url('/poll/edit/'+data.id+'/'+data.permission); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.