[pollen] branch develop updated (dc01d2d -> bd04e9d)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen. See http://git.chorem.org/pollen.git from dc01d2d Improve set tab in change page in poll part new 8b2ed91 change validate total for voteCounting-percentage new 2a8772a print alert info with link of my vote admin new bd04e9d alert can print html, url of vote is now in input The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit bd04e9d6ab03237dacb6b01afb88518811bf1d41 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Mon Jul 28 16:31:53 2014 +0200 alert can print html, url of vote is now in input commit 2a8772a2bbb41eefdfe4e61d946c675f8dee2f7b Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Mon Jul 28 15:15:21 2014 +0200 print alert info with link of my vote admin commit 8b2ed91db9d5017f38a6386b290cd40896042c14 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Mon Jul 28 15:13:57 2014 +0200 change validate total for voteCounting-percentage Summary of changes: .../services/service/VoteCountingService.java | 6 +++- .../src/main/webapp/js/controllers/alertCtrl.js | 8 ++++-- .../src/main/webapp/js/controllers/pollCtrl.js | 28 ++++++++++++++----- pollen-ui-angular/src/main/webapp/less/style.less | 32 +++++++++++++++++----- .../src/main/webapp/partials/alerts.html | 4 ++- .../src/main/webapp/partials/inline-poll.html | 6 +++- .../chorem/pollen/votecounting/VoteCounting.java | 2 +- .../pollen/votecounting/BordaVoteCounting.java | 2 +- .../pollen/votecounting/CondorcetVoteCounting.java | 2 +- .../pollen/votecounting/CoombsVoteCounting.java | 2 +- .../votecounting/InstantRunoffVoteCounting.java | 2 +- .../pollen/votecounting/NormalVoteCounting.java | 2 +- .../pollen/votecounting/NumberVoteCounting.java | 2 +- .../votecounting/PercentageVoteCounting.java | 4 +-- 14 files changed, 74 insertions(+), 28 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 8b2ed91db9d5017f38a6386b290cd40896042c14 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Mon Jul 28 15:13:57 2014 +0200 change validate total for voteCounting-percentage --- .../org/chorem/pollen/services/service/VoteCountingService.java | 6 +++++- .../src/main/java/org/chorem/pollen/votecounting/VoteCounting.java | 2 +- .../main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java | 2 +- .../java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java | 2 +- .../java/org/chorem/pollen/votecounting/CoombsVoteCounting.java | 2 +- .../org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java | 2 +- .../java/org/chorem/pollen/votecounting/NormalVoteCounting.java | 2 +- .../java/org/chorem/pollen/votecounting/NumberVoteCounting.java | 2 +- .../java/org/chorem/pollen/votecounting/PercentageVoteCounting.java | 4 ++-- 9 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteCountingService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteCountingService.java index 40ad59e..5471f15 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteCountingService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoteCountingService.java @@ -255,9 +255,13 @@ public class VoteCountingService extends PollenServiceSupport { protected ErrorMap voteIsValid(VoteBean vote, VoteCounting voteCounting) { ErrorMap errors = new ErrorMap(); - double total = 0; + Double total = null; for(VoteToChoiceBean choice: vote.getChoice()) { if (choice.getVoteValue() != null) { + if (total == null) { + total = 0.0; + } + total += choice.getVoteValue(); check(errors, diff --git a/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/VoteCounting.java b/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/VoteCounting.java index 6723ae3..368f5c5 100644 --- a/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/VoteCounting.java +++ b/pollen-votecounting-api/src/main/java/org/chorem/pollen/votecounting/VoteCounting.java @@ -118,7 +118,7 @@ public interface VoteCounting<S extends VoteCountingStrategy> { * @return {@code true} if the total values of a vote is valid, * {@code false} otherwhise. */ - boolean isTotalVoteValueValid(double totalValues); + boolean isTotalVoteValueValid(Double totalValues); /** * If the total values of a vote is not valid, gets the localized error diff --git a/pollen-votecounting-borda/src/main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java b/pollen-votecounting-borda/src/main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java index 3659edb..8f660aa 100644 --- a/pollen-votecounting-borda/src/main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java +++ b/pollen-votecounting-borda/src/main/java/org/chorem/pollen/votecounting/BordaVoteCounting.java @@ -89,7 +89,7 @@ public class BordaVoteCounting extends AbstractVoteCounting<BordaVoteCountingStr } @Override - public boolean isTotalVoteValueValid(double totalValues) { + public boolean isTotalVoteValueValid(Double totalValues) { // no validation on total value return true; } diff --git a/pollen-votecounting-condorcet/src/main/java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java b/pollen-votecounting-condorcet/src/main/java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java index 3f8cc81..e9af235 100644 --- a/pollen-votecounting-condorcet/src/main/java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java +++ b/pollen-votecounting-condorcet/src/main/java/org/chorem/pollen/votecounting/CondorcetVoteCounting.java @@ -89,7 +89,7 @@ public class CondorcetVoteCounting extends AbstractVoteCounting<CondorcetVoteCou } @Override - public boolean isTotalVoteValueValid(double totalValues) { + public boolean isTotalVoteValueValid(Double totalValues) { // no validation on total value return true; } diff --git a/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCounting.java b/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCounting.java index 9ebb2d3..39e1614 100644 --- a/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCounting.java +++ b/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCounting.java @@ -90,7 +90,7 @@ public class CoombsVoteCounting extends AbstractVoteCounting<CoombsVoteCountingS } @Override - public boolean isTotalVoteValueValid(double totalValues) { + public boolean isTotalVoteValueValid(Double totalValues) { // no validation on total value return true; } diff --git a/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java b/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java index 366d76f..2b5ea35 100644 --- a/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java +++ b/pollen-votecounting-instant-runoff/src/main/java/org/chorem/pollen/votecounting/InstantRunoffVoteCounting.java @@ -90,7 +90,7 @@ public class InstantRunoffVoteCounting extends AbstractVoteCounting<InstantRunof } @Override - public boolean isTotalVoteValueValid(double totalValues) { + public boolean isTotalVoteValueValid(Double totalValues) { // no validation on total value return true; } diff --git a/pollen-votecounting-normal/src/main/java/org/chorem/pollen/votecounting/NormalVoteCounting.java b/pollen-votecounting-normal/src/main/java/org/chorem/pollen/votecounting/NormalVoteCounting.java index 60e81c6..c56120f 100644 --- a/pollen-votecounting-normal/src/main/java/org/chorem/pollen/votecounting/NormalVoteCounting.java +++ b/pollen-votecounting-normal/src/main/java/org/chorem/pollen/votecounting/NormalVoteCounting.java @@ -75,7 +75,7 @@ public class NormalVoteCounting extends AbstractVoteCounting<NormalVoteCountingS } @Override - public boolean isTotalVoteValueValid(double totalValues) { + public boolean isTotalVoteValueValid(Double totalValues) { // no validation on total value return true; } diff --git a/pollen-votecounting-number/src/main/java/org/chorem/pollen/votecounting/NumberVoteCounting.java b/pollen-votecounting-number/src/main/java/org/chorem/pollen/votecounting/NumberVoteCounting.java index 0fc8bca..e704d48 100644 --- a/pollen-votecounting-number/src/main/java/org/chorem/pollen/votecounting/NumberVoteCounting.java +++ b/pollen-votecounting-number/src/main/java/org/chorem/pollen/votecounting/NumberVoteCounting.java @@ -75,7 +75,7 @@ public class NumberVoteCounting extends AbstractVoteCounting<NumberVoteCountingS } @Override - public boolean isTotalVoteValueValid(double totalValues) { + public boolean isTotalVoteValueValid(Double totalValues) { // no validation on total value return true; } diff --git a/pollen-votecounting-percentage/src/main/java/org/chorem/pollen/votecounting/PercentageVoteCounting.java b/pollen-votecounting-percentage/src/main/java/org/chorem/pollen/votecounting/PercentageVoteCounting.java index ef3d8d2..b9a1758 100644 --- a/pollen-votecounting-percentage/src/main/java/org/chorem/pollen/votecounting/PercentageVoteCounting.java +++ b/pollen-votecounting-percentage/src/main/java/org/chorem/pollen/votecounting/PercentageVoteCounting.java @@ -77,8 +77,8 @@ public class PercentageVoteCounting extends AbstractVoteCounting<PercentageVoteC } @Override - public boolean isTotalVoteValueValid(double totalValues) { - return totalValues == 100 || totalValues == 0; + public boolean isTotalVoteValueValid(Double totalValues) { + return totalValues == null || totalValues == 100; } @Override -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 2a8772a2bbb41eefdfe4e61d946c675f8dee2f7b Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Mon Jul 28 15:15:21 2014 +0200 print alert info with link of my vote admin --- .../src/main/webapp/js/controllers/pollCtrl.js | 24 +++++++++++++++------- .../src/main/webapp/partials/inline-poll.html | 6 +++++- 2 files changed, 22 insertions(+), 8 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 0e44e0c..cc02944 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -30,14 +30,18 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr ['$scope', '$rootScope', '$controller', '$sce', '$timeout', '$routeParams', '$location', 'SessionStorage', '$translate', '$route', '$q', 'Poll', 'PollenResource', 'Page', 'DateFormat', function ( $scope, $rootScope, $controller, $sce, $timeout, $routeParams, $location, SessionStorage, $translate, $route, $q, Poll, PollenResource, Page, DateFormat) { $scope.setTab = function (defaultValue) { - if (angular.isDefined($route.current.params.tab)) { - return $route.current.params.tab; - } - if (angular.isDefined($route.current)) { - var params = $route.current.$$route.originalPath.split('/'); - return params[2]; + if (angular.isDefined($route.current.params.tab)) { + return $route.current.params.tab; + } + + if (angular.isDefined($route.current.$$route) + && angular.isDefined($route.current.$$route.originalPath)) { + var params = $route.current.$$route.originalPath.split('/'); + + return params[2]; + } } if (angular.isDefined(defaultValue)) { @@ -1105,11 +1109,17 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.data.vote.id = returnRequest.id; $scope.data.vote.permission = returnRequest.permission; + angular.forEach($scope.data.vote.choice, function (choice) { + if (choice.voteValue == "") { + delete choice.voteValue; + } + }); + $scope.data.votants.push(angular.copy($scope.data.vote)); $rootScope.$broadcast('newSuccess', 'vote.added'); initVote(); - $rootScope.$on('newInfo', $scope.globalVariables.baseUrl+'#/poll/vote/'+$routeParams.pollId+'/'+ returnRequest.permission, -1); + $rootScope.$broadcast('newInfo', $scope.globalVariables.baseUrl+'#/poll/vote/'+$routeParams.pollId+'/'+ returnRequest.permission, -1); $location.url('/poll/vote/'+$routeParams.pollId+'/'+ returnRequest.permission); }, function (error) { if (angular.isDefined(error.data["voter.name"])) { 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 9137fa3..ebef8ae 100644 --- a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html @@ -86,7 +86,11 @@ <!-- begin print vote --> <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" ng-class="{voteTrue:choice.voteValue != null, voteFalse:(choice.voteValue == null || (choice.voteValue == false && data.voteCountingType.renderType == 'checkbox'))}"> + <td ng-repeat="choice in vote.choice" + class="pollChoice" + ng-class="{ + voteTrue:choice.voteValue != null, + voteFalse:(choice.voteValue == null || (choice.voteValue == false && data.voteCountingType.renderType == 'checkbox'))}"> <div ng-show="data.voteCountingType.renderType == 'checkbox'"> <input type="checkbox" ng-model="choice.voteValue" disabled /> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
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 bd04e9d6ab03237dacb6b01afb88518811bf1d41 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Mon Jul 28 16:31:53 2014 +0200 alert can print html, url of vote is now in input --- .../src/main/webapp/js/controllers/alertCtrl.js | 8 ++++-- .../src/main/webapp/js/controllers/pollCtrl.js | 6 +++- pollen-ui-angular/src/main/webapp/less/style.less | 32 +++++++++++++++++----- .../src/main/webapp/partials/alerts.html | 4 ++- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js index d388b25..85075fd 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/alertCtrl.js @@ -21,8 +21,8 @@ 'use strict'; angular.module('alertControllers', []) -.controller('printAlertCtrl', ['$scope', '$timeout', - function ($scope, $timeout) { +.controller('printAlertCtrl', ['$scope', '$timeout', '$sce', '$filter', + function ($scope, $timeout, $sce, $filter) { if (angular.isUndefined($scope.data)) { $scope.data = {} @@ -94,4 +94,8 @@ angular.module('alertControllers', []) $scope.data.alerts.splice(index, 1); } } + + $scope.toHTML = function (msg) { + return $sce.trustAsHtml($filter('translate')(msg)); + } }]) \ No newline at end of file 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 cc02944..12e37f3 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -1119,7 +1119,11 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $rootScope.$broadcast('newSuccess', 'vote.added'); initVote(); - $rootScope.$broadcast('newInfo', $scope.globalVariables.baseUrl+'#/poll/vote/'+$routeParams.pollId+'/'+ returnRequest.permission, -1); + $rootScope.$broadcast('newInfo', + '<input type="text" class="form-control" value="' + + $scope.globalVariables.baseUrl+'#/poll/vote/'+$routeParams.pollId+'/'+ returnRequest.permission + + '" readonly />' + , -1); $location.url('/poll/vote/'+$routeParams.pollId+'/'+ returnRequest.permission); }, function (error) { if (angular.isDefined(error.data["voter.name"])) { diff --git a/pollen-ui-angular/src/main/webapp/less/style.less b/pollen-ui-angular/src/main/webapp/less/style.less index 9321c36..e8159ec 100644 --- a/pollen-ui-angular/src/main/webapp/less/style.less +++ b/pollen-ui-angular/src/main/webapp/less/style.less @@ -358,14 +358,32 @@ font-size:1.1em; font-weight:bold; z-index: 100000; - opacity: 0.9; - .glyphicon { - display:inline-block; - font-size:1.4em; - top:5px; - font-weight:bolder; - margin-right: 15px; + .alert { + opacity:0.9; + + .transition(opacity @short-time-transition ease); + + &:hover { + opacity:0.7; + + .transition(opacity @short-time-transition ease); + } + + .glyphicon { + display:inline-block; + font-size:1.4em; + top:5px; + font-weight:bolder; + margin-right: 15px; + } + + .alert-message { + margin-right:20px; + margin-left: 30px; + margin-top: -12px; + + } } } diff --git a/pollen-ui-angular/src/main/webapp/partials/alerts.html b/pollen-ui-angular/src/main/webapp/partials/alerts.html index 7afa3ab..37bc807 100644 --- a/pollen-ui-angular/src/main/webapp/partials/alerts.html +++ b/pollen-ui-angular/src/main/webapp/partials/alerts.html @@ -1,3 +1,5 @@ <div ng-controller="printAlertCtrl" > - <alert ng-repeat="alert in data.alerts" type="{{alert.type}}" class="fakeLink" close="hideAlert(alert)" ng-click="hideAlert(alert)"><span class="glyphicon" ng-class="alert.glyphicon"></span> {{ alert.msg | translate }} </alert> + <alert ng-repeat="alert in data.alerts" + type="{{alert.type}}" + close="hideAlert(alert)"><span class="glyphicon" ng-class="alert.glyphicon"></span> <div class="alert-message" ng-bind-html="toHTML(alert.msg)"></div> </alert> </div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm