02/02: print good link for edit. Print vote in edit mode
This is an automated email from the git hooks/post-receive script. unknown user pushed a commit to branch devel in repository Pollen. commit 1dd04392cb2279b008b82328d8749dc3cd73a820 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Fri May 23 15:50:46 2014 +0200 print good link for edit. Print vote in edit mode --- .../src/main/webapp/js/controllers/pollCtrl.js | 18 ++++++++++++++++-- .../src/main/webapp/partials/inline-poll.html | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) 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 1601454..19526d4 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -204,14 +204,15 @@ angular.module('pollControllers', []) }]) -.controller('PollEditCtrl', ['$scope', '$controller', '$routeParams', '$location', '$timeout', 'Poll', 'PollChoice', function ($scope, $controller, $routeParams, $location, $timeout, Poll, PollChoice) { +.controller('PollEditCtrl', ['$scope', '$controller', '$routeParams', '$location', '$timeout', 'Poll', 'PollChoice', 'PollVote', function ($scope, $controller, $routeParams, $location, $timeout, Poll, PollChoice, PollVote) { $controller('PollAdminCtrl', {$scope:$scope}); $scope.globalVariables.edit = true; $scope.globalVariables.hostName = $location.protocol()+'://'+$location.host(); + $scope.globalVariables.linkEdit = $location.protocol()+'://'+$location.host()+'/#/poll/edit/'+$routeParams.pollId if (angular.isDefined($routeParams.token)) { - $scope.globalVariables.linkEdit = $location.protocol()+'://'+$location.host()+'/#/poll/edit/'+$routeParams.pollId; + $scope.globalVariables.linkEdit += '?token='+$routeParams.token; } $scope.callBackAddChoice = function (choice) { @@ -257,6 +258,19 @@ angular.module('pollControllers', []) $scope.data.vote = {}; $scope.data.vote.choice = $scope.data.choices; }); + PollVote.query({pollId:$routeParams.pollId}, function (votes) { + $scope.data.votants = votes; + angular.forEach($scope.data.votants, function (vote) { + angular.forEach(vote.choice, function (choice) { + if (choice.voteValue != null && choice.voteValue != 0.0) { + choice.voteValue = true; + } + else { + choice.voteValue = false; + } + }) + }) + }) } initPoll(); 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 9d18149..528aab7 100644 --- a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html @@ -64,7 +64,7 @@ <!-- end input vote --> <!-- begin print vote --> - <tr ng-repeat="vote in data.votants track by $index" class="pollAnim" ng-show="!globalVariables.editMode"> + <tr ng-repeat="vote in data.votants track by $index" class="pollAnim"> <td class="pollChoice"> {{vote.voterName}}</td> <td ng-repeat="choice in vote.choice" class="pollChoice"> <input type="checkbox" ng-model="choice.voteValue" disabled /> -- To stop receiving notification emails like this one, please contact Chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
Chorem.org scm