This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 20537501b85125aa8bb72afa1e298bd1e3101c40 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri Aug 1 17:14:34 2014 +0200 show when the vote don't view a choice --- 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 | 13 +++++++++++++ pollen-ui-angular/src/main/webapp/partials/inline-poll.html | 13 +++++++++---- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/i18n/en.js b/pollen-ui-angular/src/main/webapp/i18n/en.js index 63dd438..551e046 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/en.js +++ b/pollen-ui-angular/src/main/webapp/i18n/en.js @@ -109,6 +109,7 @@ var translateEN = { 'poll.config.value.visibility.creator' : 'Creator', 'poll.config.value.visibility.anonymous' : 'Anonymous', 'poll.config.value.visibility.nobody' : 'Nobody', +'poll.info.vote.noViewChoice' : 'This choice does not exist in the vote', 'poll.error.noResource' : 'No resource has send', 'poll.error.listEmpty' : 'No poll find', diff --git a/pollen-ui-angular/src/main/webapp/i18n/fr.js b/pollen-ui-angular/src/main/webapp/i18n/fr.js index c9dedc9..78c910d 100644 --- a/pollen-ui-angular/src/main/webapp/i18n/fr.js +++ b/pollen-ui-angular/src/main/webapp/i18n/fr.js @@ -109,6 +109,7 @@ var translateFR = { 'poll.config.value.visibility.creator' : 'Créateur', 'poll.config.value.visibility.anonymous' : 'Anonyme', 'poll.config.value.visibility.nobody' : 'Personne', +'poll.info.vote.noViewChoice' : 'Ce choix n\'existait pas lors du vote', 'poll.error.noResource' : 'Aucune ressource a envoyer', 'poll.error.listEmpty' : 'Aucun sondage trouvé', 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 1c8e103..faa9b13 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -1169,6 +1169,9 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr }); PollVote.get({pollId:$routeParams.pollId, voteId:returnRequest.id, permission:returnRequest.permission}, function (newVote) { + angular.forEach(newVote.choice, function (choice) { + choice.voteValue = $scope.getVoteValue(choice.voteValue); + }) $scope.data.votants.push(newVote); }) @@ -1246,6 +1249,16 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr // edit vote PollVote.update({pollId:$routeParams.pollId}, sendVote, function (data) { vote.onEdit = false; + for (var i = 0; i < data.choice.length; i++) { + for (var j = 0; j < vote.choice.length; j++) { + if (vote.choice[i].choiceId == data.choice[i].choiceId) { + vote.choice[i].id = data.choice[i].id; + vote.choice[i].voteValue = $scope.getVoteValue(data.choice[i].voteValue); + + break; + } + } + } delete $scope.data.vote.restError; $rootScope.$broadcast('newSuccess', 'vote.added'); diff --git a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html index dc36e4b..b330c1b 100644 --- a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html @@ -106,11 +106,16 @@ voteFalse:(choice.voteValue == null || (choice.voteValue == false && data.voteCountingType.renderType == 'checkbox'))}"> <div ng-hide="vote.onEdit"> - <div ng-show="data.voteCountingType.renderType == 'checkbox'" > - <span class="glyphicon glyphicon-ok text-success" ng-show="choice.voteValue"></span> + <div ng-show="choice.id"> + <div ng-show="data.voteCountingType.renderType == 'checkbox'" > + <span class="glyphicon glyphicon-ok text-success" ng-show="choice.voteValue"></span> + </div> + <div ng-show="data.voteCountingType.renderType != 'checkbox'"> + {{choice.voteValue}} + </div> </div> - <div ng-show="data.voteCountingType.renderType != 'checkbox'"> - {{choice.voteValue}} + <div ng-hide="choice.id"> + <span class="glyphicon glyphicon-eye-close text-danger" tooltip="{{ 'poll.info.vote.noViewChoice' | translate }}"></span> </div> </div> <div ng-show="vote.onEdit"> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.