branch develop updated (18553eab -> 470b9bb5)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from 18553eab correction affichage coombs new 470b9bb5 correction de petit bug (entre autre ref #142) The 1 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 470b9bb57c24a6622cc714bf1274f025bd9d070e Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Sep 13 16:55:19 2017 +0200 correction de petit bug (entre autre ref #142) Summary of changes: pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html | 2 +- pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html | 10 ++++------ .../chorem/pollen/votecounting/CoombsVoteCountingStrategy.java | 3 ++- .../resources/i18n/pollen-votecounting-coombs_en_GB.properties | 5 +---- .../resources/i18n/pollen-votecounting-coombs_fr_FR.properties | 5 +---- 5 files changed, 9 insertions(+), 16 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 https://gitlab.nuiton.org/chorem/pollen.git commit 470b9bb57c24a6622cc714bf1274f025bd9d070e Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Sep 13 16:55:19 2017 +0200 correction de petit bug (entre autre ref #142) --- pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html | 2 +- pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html | 10 ++++------ .../chorem/pollen/votecounting/CoombsVoteCountingStrategy.java | 3 ++- .../resources/i18n/pollen-votecounting-coombs_en_GB.properties | 5 +---- .../resources/i18n/pollen-votecounting-coombs_fr_FR.properties | 5 +---- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html index e734ee28..fb0c249e 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditPoll.tag.html @@ -190,7 +190,7 @@ require("../components/HumanInput.tag.html"); <style> .main-content { - margin-bottom: 56px; + margin-bottom: 144px; padding-bottom: 0; } diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html index 73e1314e..32b46804 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html @@ -136,7 +136,7 @@ require("../components/LazyLoad.tag.html"); </form> <!-- Show votes --> - <div class="voters" if="{poll.resultIsVisible}"> + <div class="voters" if="{poll.resultIsVisible && poll.voteCount > 0}"> <div class="row header separator-bottom"> <div></div> <div class="choices separator-left" if="{showChoiceHeader}"> @@ -242,14 +242,15 @@ require("../components/LazyLoad.tag.html"); this.refresh = () => { this.refs.lazyLoad && this.refs.lazyLoad.reload().then(() => { this.updateShowChoiceContainer(); + this.update(); }, () => {}); }; this.choiceToAdd = this.poll.initChoice(); this.updateShowChoiceContainer = () => { - let results0 = this.refs.lazyLoad.refs.results0; - this.showChoiceHeader = results0 && results0.offsetWidth / this.poll.choices.length >= MIN_CHOICE_COLUMN_WIDTH; + let results0 = this.refs.lazyLoad && this.refs.lazyLoad.refs.results0; + this.showChoiceHeader = results0 && this.poll.choices && results0.offsetWidth / this.poll.choices.length >= MIN_CHOICE_COLUMN_WIDTH; }; this.onPollChange = poll => { @@ -359,9 +360,6 @@ require("../components/LazyLoad.tag.html"); this.poll.addVote(vote).then(() => { this.resetPoll(); - if (this.poll.voteIsVisible) { - this.refresh(); - } if (this.poll.resultIsVisible) { this.poll.loadResults().then(() => { this.voting = false; diff --git a/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCountingStrategy.java b/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCountingStrategy.java index b66026ae..0ab194ee 100644 --- a/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCountingStrategy.java +++ b/pollen-votecounting-coombs/src/main/java/org/chorem/pollen/votecounting/CoombsVoteCountingStrategy.java @@ -116,7 +116,7 @@ public class CoombsVoteCountingStrategy extends AbstractVoteCountingStrategy { BigDecimal scoreValue = results.get(results.size() - 1).getScoreValue(); double max = scoreValue == null ? 0 : scoreValue.doubleValue(); - if (max <= totalWeight) { + if (max < totalWeight || max == totalWeight && idsToInclude.size() > 2) { // pas de majorité absolue, il faut éliminer le(s) choix les plus mauvais @@ -136,6 +136,7 @@ public class CoombsVoteCountingStrategy extends AbstractVoteCountingStrategy { } else { // majorité absolue trouvée plus rien à faire en fait :) + // ou 2 choix égaux } } } diff --git a/pollen-votecounting-coombs/src/main/resources/i18n/pollen-votecounting-coombs_en_GB.properties b/pollen-votecounting-coombs/src/main/resources/i18n/pollen-votecounting-coombs_en_GB.properties index 042ac609..b70fc7ef 100644 --- a/pollen-votecounting-coombs/src/main/resources/i18n/pollen-votecounting-coombs_en_GB.properties +++ b/pollen-votecounting-coombs/src/main/resources/i18n/pollen-votecounting-coombs_en_GB.properties @@ -1,7 +1,4 @@ pollen.error.vote.invalidCoombsVoteValue=The value '%2$s' of vote for choice %1$s is not valid, only integer values are authorized. pollen.voteCountingType.coombs=Coombs -pollen.voteCountingType.coombs.help=Rank choices by preference order from 1 to N (1\=favorite).\ - <br/>Only the rank is taken into account, not the values. Two choices can have the same value.\ - <br/>In this method, the choice which is last the most times is eliminated round by round until only one remains.\ - <br/>More about this method: <a href\='http\://en.wikipedia.org/wiki/Coombs%27_method' target\='\#doc'>http\://en.wikipedia.org/wiki/Coombs%27_method</a> +pollen.voteCountingType.coombs.help=Rank choices by preference order from 1 to N (1\=favorite).<br/>Only the rank is taken into account, not the values. Two choices can have the same value.<br/>In this method, the choice which is last the most times is eliminated round by round until only one remains.<br/>More about this method\: <a href\='http\://en.wikipedia.org/wiki/Coombs%27_method' target\='\#doc'>http\://en.wikipedia.org/wiki/Coombs%27_method</a> pollen.voteCountingType.coombs.shortHelp=Rank choices by preference order from 1 to N (1\=favorite). diff --git a/pollen-votecounting-coombs/src/main/resources/i18n/pollen-votecounting-coombs_fr_FR.properties b/pollen-votecounting-coombs/src/main/resources/i18n/pollen-votecounting-coombs_fr_FR.properties index ed836b57..6674d907 100644 --- a/pollen-votecounting-coombs/src/main/resources/i18n/pollen-votecounting-coombs_fr_FR.properties +++ b/pollen-votecounting-coombs/src/main/resources/i18n/pollen-votecounting-coombs_fr_FR.properties @@ -1,7 +1,4 @@ pollen.error.vote.invalidCoombsVoteValue=La valeur du vote '%2$s' pour le choix %1$s n'est pas correcte, seul des valeurs entières sont autorisées. pollen.voteCountingType.coombs=Coombs -pollen.voteCountingType.coombs.help=Classer les choix par ordre de préférence de 1 à N (1\=préféré).\ - <br/>Seul l'ordre des choix compte, peu importe les valeurs. Deux choix peuvent avoir la même valeur.\ - <br/>Dans cette méthode, le choix qui arrive le plus souvent en dernier de liste est éliminé à chaque tour, jusqu'à ce qu'il n'en reste qu'un.\ - <br/>Pour en savoir plus : <a href\='http\://fr.wikipedia.org/wiki/M%C3%A9thode_de_Coombs' target\='\#doc'>http\://fr.wikipedia.org/wiki/M%C3%A9thode_de_Coombs</a> +pollen.voteCountingType.coombs.help=Classer les choix par ordre de préférence de 1 à N (1\=préféré).<br/>Seul l'ordre des choix compte, peu importe les valeurs. Deux choix peuvent avoir la même valeur.<br/>Dans cette méthode, le choix qui arrive le plus souvent en dernier de liste est éliminé à chaque tour, jusqu'à ce qu'il n'en reste qu'un.<br/>Pour en savoir plus \: <a href\='http\://fr.wikipedia.org/wiki/M%C3%A9thode_de_Coombs' target\='\#doc'>http\://fr.wikipedia.org/wiki/M%C3%A9thod [...] pollen.voteCountingType.coombs.shortHelp=Classer les choix par ordre de préférence de 1 à N (1\=préféré). -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm