This is an automated email from the git hooks/post-receive script. New commit to branch feature/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 3ac30cf40c9702abd87c2db7fb580bdb04976951 Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 7 13:54:56 2019 +0200 Fix result detail displaying multi-questions --- pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html | 6 ++++-- .../src/main/web/tag/voteCountingType/BordaDetailResult.tag.html | 8 ++++++++ .../main/web/tag/voteCountingType/CondorcetDetailResult.tag.html | 9 +++++++++ .../main/web/tag/voteCountingType/CoombsDetailResult.tag.html | 7 +++++++ .../web/tag/voteCountingType/InstantRunoffDetailResult.tag.html | 8 ++++++++ .../tag/voteCountingType/MajorityJudgmentDetailResult.tag.html | 8 ++++++++ 6 files changed, 44 insertions(+), 2 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html index 2dc42be1..f3fd176d 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Results.tag.html @@ -47,6 +47,7 @@ import "../voteCountingType/MajorityJudgmentDetailResult.tag.html"; <Result question={question}/> + <style> <script type="es6"> import session from "../../js/Session"; import poll from "../../js/Poll.js"; @@ -94,17 +95,18 @@ import "../voteCountingType/MajorityJudgmentDetailResult.tag.html"; this.question = this.poll.questions[this.questionToVote]; this.bus.trigger("question", this.question); this.update(); + this.bus.trigger("question", this.question); }; - this.previousQuestion = (e) => { + this.previousQuestion = () => { this.questionToVote = this.questionToVote - 1; this.question = this.poll.questions[this.questionToVote]; this.bus.trigger("question", this.question); this.update(); + this.bus.trigger("question", this.question); }; </script> - <style> .result-body { display: flex; diff --git a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaDetailResult.tag.html b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaDetailResult.tag.html index f85bf786..6219b836 100644 --- a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaDetailResult.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/BordaDetailResult.tag.html @@ -57,6 +57,14 @@ import "../poll/ChoiceView.tag.html"; this.installBundle(session, "poll_results_borda"); this.poll = poll; + + this.question = this.poll.questions[this.questionToVote]; + + this.listen("question", (e) => { + this.question = e; + this.update(); + }); + this.onPollChange = poll2 => { //reload question _this=this; diff --git a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/CondorcetDetailResult.tag.html b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/CondorcetDetailResult.tag.html index 8014ba5c..70f1d8fd 100644 --- a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/CondorcetDetailResult.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/CondorcetDetailResult.tag.html @@ -53,6 +53,15 @@ import "../poll/ChoiceView.tag.html"; this.installBundle(session, "poll_results_condorcet"); this.poll = poll; + + + this.question = this.poll.questions[this.questionToVote]; + + this.listen("question", (e) => { + this.question = e; + this.update(); + }); + this.onPollChange = poll2 => { //reload question _this=this; diff --git a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/CoombsDetailResult.tag.html b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/CoombsDetailResult.tag.html index bd77832a..43f9841a 100644 --- a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/CoombsDetailResult.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/CoombsDetailResult.tag.html @@ -66,6 +66,13 @@ import "../poll/ChoiceView.tag.html"; this.poll = poll; + this.question = this.poll.questions[this.questionToVote]; + + this.listen("question", (e) => { + this.question = e; + this.update(); + }); + this.getRoundFirstScore = (choice, round) => { let rankScore = round.roundChoices.find(r => r.choiceId === choice.id); return rankScore ? rankScore.firstScore || 0 : ""; diff --git a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/InstantRunoffDetailResult.tag.html b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/InstantRunoffDetailResult.tag.html index 16705f86..34a15b0f 100644 --- a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/InstantRunoffDetailResult.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/InstantRunoffDetailResult.tag.html @@ -45,6 +45,14 @@ import "../poll/ChoiceView.tag.html"; this.installBundle(session, "poll_results_instantRunoff"); this.poll = poll; + + this.question = this.poll.questions[this.questionToVote]; + + this.listen("question", (e) => { + this.question = e; + this.update(); + }); + this.onPollChange = poll2 => { //reload question _this=this; diff --git a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/MajorityJudgmentDetailResult.tag.html b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/MajorityJudgmentDetailResult.tag.html index 9c613bce..1da5ad68 100644 --- a/pollen-ui-riot-js/src/main/web/tag/voteCountingType/MajorityJudgmentDetailResult.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/voteCountingType/MajorityJudgmentDetailResult.tag.html @@ -86,6 +86,14 @@ import "../poll/ChoiceView.tag.html"; this.update(); }; + + this.question = this.poll.questions[this.questionToVote]; + + this.listen("question", (e) => { + this.question = e; + this.update(); + }); + this.getColor = (index, s, l, a) => { let hue = 0 + 120 * index / (this.question.voteCountingConfig.grades.length - 1); return "hsla(" + hue + ", " + s + "%, " + l + "%, " + a + ")"; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.