branch feature/multi-ui updated (6213b014 -> a5700ffd)
This is an automated email from the git hooks/post-receive script. New change to branch feature/multi-ui in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git from 6213b014 Edit the right question settings new 3ac30cf4 Fix result detail displaying multi-questions new a5700ffd Use toggle instead of classic checkbox The 2 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 a5700ffd83d912bcb8894e266c3c139eb3273560 Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 7 14:09:02 2019 +0200 Use toggle instead of classic checkbox commit 3ac30cf40c9702abd87c2db7fb580bdb04976951 Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 7 13:54:56 2019 +0200 Fix result detail displaying multi-questions Summary of changes: .../src/main/web/tag/poll/Description.tag.html | 22 +++++++++++++--------- .../src/main/web/tag/poll/Results.tag.html | 6 ++++-- .../voteCountingType/BordaDetailResult.tag.html | 8 ++++++++ .../CondorcetDetailResult.tag.html | 9 +++++++++ .../voteCountingType/CoombsDetailResult.tag.html | 7 +++++++ .../InstantRunoffDetailResult.tag.html | 8 ++++++++ .../MajorityJudgmentDetailResult.tag.html | 8 ++++++++ 7 files changed, 57 insertions(+), 11 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 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>.
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 a5700ffd83d912bcb8894e266c3c139eb3273560 Author: jcouteau <couteau@codelutin.com> Date: Mon Oct 7 14:09:02 2019 +0200 Use toggle instead of classic checkbox --- .../src/main/web/tag/poll/Description.tag.html | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html index ebdc283b..a65414d8 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Description.tag.html @@ -89,15 +89,12 @@ <option each={emailAddress in session.getUser().emailAddresses} value={emailAddress.emailAddress}> </datalist> </div> + <div class="o-form-element"> - <input type="checkbox" - ref="multi" - id="multi" - tabindex="1" - name="multi" - checked="{form.multi}" - disabled={opts.form.model.closed}/> - <label class="c-label" for="multi">{_t.multiQuestion}</label> + <Checkbox label="{_t.multiQuestion}" + disabled={form.model.closed} + checkboxchecked={form.multi} + ontogglecheckbox={toggleMulti}/> </div> </div> @@ -107,12 +104,19 @@ this.session = session; this.installBundle(this.session, "poll_description", this.opts.emitter); this.form = this.opts.form; + + this.multi = this.form.multi; + + this.toggleMulti = () => { + this.multi = this.form.multi = !this.multi; + this.update(); + }; + this.submit = () => { this.form.model.title = this.refs.title.value; this.form.model.description = this.refs.description.value; this.form.model.creatorName = this.refs.name.value; this.form.model.creatorEmail = this.refs.email.value; - this.form.multi = this.refs.multi.checked; }; </script> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm