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 219dfb99c86cf562ee8765907e80f68fbc14ab98 Author: jcouteau <couteau@codelutin.com> Date: Tue Oct 29 13:59:29 2019 +0100 GTU validation and name keeping in multi poll --- pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html | 11 +++++++++-- .../src/main/web/tag/poll/EditVoteOrder.tag.html | 9 +++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html index 1eaf428e..ca4f8d67 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVote.tag.html @@ -345,6 +345,11 @@ this.resetVoteForm = () => { this.voteInEdition = null; + + if (this.poll.voterName) { + this.refs.voterName.value = this.poll.voterName; + } + if (this.question.canVote) { if (!this.multi) { this.refs.voterName.value = null; @@ -369,7 +374,7 @@ this.mustValidateGtuToVote = () => { let anonymousAlreadyVoted = this.voteInEdition; let voterIsRegistered = this.session.isConnected(); - let gtuValidatedInPoll = this.poll.gtuValidated; + let gtuValidatedInPoll = this.poll.voterValidatedGtu; let gtuAlreadyValidated = anonymousAlreadyVoted || voterIsRegistered || gtuValidatedInPoll; let mustValidateGtuToVote = !gtuAlreadyValidated; return mustValidateGtuToVote; @@ -425,10 +430,12 @@ this.opts.onSaveVote(vote).then(() => { this.voting = false; this.voteInEdition = null; - this.resetVoteForm(); if (this.multi) { + this.poll.voterValidatedGtu = true; + this.poll.voterName = this.refs.voterName.value; this.parent.parent.nextQuestion(); } else { + this.resetVoteForm(); this.update(); } }, diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html index 81ccc462..d0d478d3 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/EditVoteOrder.tag.html @@ -350,6 +350,9 @@ }; this.resetVoteForm = () => { + if (this.poll.voterName) { + this.refs.voterName.value = this.poll.voterName; + } if (this.poll.canVote) { if (!this.multi) { this.refs.voterName.value = null; @@ -390,7 +393,7 @@ this.mustValidateGtuToVote = () => { let anonymousAlreadyVoted = this.voteInEdition; let voterIsRegistered = this.session.isConnected(); - let gtuValidatedInPoll = this.poll.gtuValidated; + let gtuValidatedInPoll = this.poll.voterValidatedGtu; let gtuAlreadyValidated = anonymousAlreadyVoted || voterIsRegistered || gtuValidatedInPoll; let mustValidateGtuToVote = !gtuAlreadyValidated; return mustValidateGtuToVote; @@ -445,10 +448,12 @@ this.opts.onSaveVote(vote).then(() => { this.voting = false; this.voteInEdition = null; - this.resetVoteForm(); if (this.multi) { + this.poll.voterValidatedGtu = true; + this.poll.voterName = this.refs.voterName.value; this.parent.parent.nextQuestion(); } else { + this.resetVoteForm(); this.update(); } }, -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.