This is an automated email from the git hooks/post-receive script. unknown user pushed a commit to branch devel in repository Pollen. commit 82c729951a7feab4c6a17cec2c3698aaf8c28bf0 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu May 22 18:27:41 2014 +0200 print result --- .../src/main/webapp/js/controllers/pollCtrl.js | 17 +++++++++++------ .../src/main/webapp/partials/poll-result.html | 7 +++++-- pollen-ui-angular/src/main/webapp/partials/poll.html | 7 ++++--- 3 files changed, 20 insertions(+), 11 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 02a6b82..da513f3 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -304,15 +304,20 @@ angular.module('pollControllers', []) } }) }) - }) + }); - Poll.get({pollId:$routeParams.pollId, cmd:'result'}, function (result) { + Poll.get({pollId:$routeParams.pollId, cmd:'results'}, function (result) { $scope.data.result = result; - angular.forEach(result.scores, function (value, key) { - value.choice = JSON.search($scope.data.choices, value.choiceId); + angular.forEach(result.scores, function(value, key) { + for (var i = 0; i < $scope.data.choices.length; i++) { + if ($scope.data.choices[i].id == value.choiceId) { + value.choice = $scope.data.choices[i]; + i = $scope.data.choices.length; + } + } }) - console.log(result); - }) + $scope.data.result.nbVotant = $scope.data.votants.length; + }); } initPoll(); diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-result.html b/pollen-ui-angular/src/main/webapp/partials/poll-result.html index ec74732..d21b64c 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-result.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-result.html @@ -1,4 +1,7 @@ -<h2> Résultats :</h2> +<h2> Résultats : {{data.result.nbVotant}}</h2> <div ng-repeat="score in data.result.scores"> - <h3> </h3> + <h4> {{score.choice.name}} </h4> + <p> + nb vote : {{score.scoreValue}} + </p> </div> \ No newline at end of file diff --git a/pollen-ui-angular/src/main/webapp/partials/poll.html b/pollen-ui-angular/src/main/webapp/partials/poll.html index cb1d550..54929d7 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll.html @@ -20,14 +20,13 @@ --> <form class="form-horizontal" novalidate> + <alert type="warning" ng-if="globalVariables.voted"> Les votes ont commencé, certaine modification sont inaccessible.. </alert> + <alert type="success" ng-if="globalVariables.edit"> Lien de vote : <a href="#/poll/vote/{{data.poll.id}}"> http://pollen/#/poll/vote/{{data.poll.id}}</a> </alert> <alert type="danger" class="alert-float" ng-if="restError.choice" close="restError.choice = false"> Vous devez avoir au moins 1 choix </alert> <alert type="success" class="alert-float" ng-if="globalVariables.editMode && globalVariables.saved" close="globalVariables.saved = false"> Sondage sauvegardé..</alert> <alert type="success" class="alert-float" ng-if="!globalVariables.editMode && globalVariables.saved" close="globalVariables.saved = false"> Vote effectué..</alert> - <alert type="warning" ng-if="globalVariables.voted"> Les votes ont commencé, certaine modification sont inaccessible.. </alert> - <alert type="warning" ng-if="globalVariables.created"> <a href="#/poll/edit/{{pollId}}"> Edition du sondage </a>.. </alert> - <tabset> <tab heading="Sondage"> @@ -65,6 +64,8 @@ </tab> </tabset> + <div ng-include="'./partials/poll-result.html'"></div> + <div ng-if="globalVariables.create"> <hr/> <button type="button" class="btn btn-default" ng-model="globalVariables.editMode" btn-checkbox>Mode Edition</button> -- To stop receiving notification emails like this one, please contact Chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
Chorem.org scm