This is an automated email from the git hooks/post-receive script. New commit to branch feature/bug-on-save in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 841067c6f6e0978312ee23b2edff6353448eac66 Author: dcosse <cosse@codelutin.com> Date: Tue Oct 8 15:07:20 2019 +0200 refs #248 correction sur passage des paramètres de configuration d'un vote --- .../src/main/web/tag/poll/Settings.tag.html | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html index 5591cd54..a4d992d1 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html @@ -131,7 +131,7 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; tabindex="1" name="voteCountingTypeRadios" ref="voteCountingType{type.id}" - checked="{type && type.id.toString() === form.model.voteCountingType}" + checked="{type && type.id.toString() === form.model.questions[0].voteCountingType}" onchange={voteCountingTypeChanged}/> <span>{type.name}</span> </label> @@ -140,7 +140,7 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; <select class="c-field choice-select" tabindex="1" ref="voteCountingType" - value={form.model.voteCountingType} + value={form.model.questions[0].voteCountingType} disabled={form.hasVotes || form.model.closed} onchange={voteCountingTypeChanged}> <option each={type in form.voteCountingTypes} @@ -164,10 +164,10 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; id="choiceAddAllowed" ref="addChoices" disabled={form.hasVotes || form.model.closed} - checkboxchecked={form.model.choiceAddAllowed} + checkboxchecked={form.model.questions[0].choiceAddAllowed} ontogglecheckbox={toggleChoiceAddAllowed}/> </div> - <div show="{form.model.choiceAddAllowed}" class="config-period"> + <div show="{form.model.questions[0].choiceAddAllowed}" class="config-period"> <div class="o-form-element"> <label class="c-label" for="beginChoiceDate"> {_t.beginChoiceDate} @@ -176,7 +176,7 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; tabindex="1" name="beginChoiceDate" id="beginChoiceDate" - datetime={form.model.beginChoiceDate} + datetime={form.model.questions[0].beginChoiceDate} disabled={form.hasVotes || form.model.closed}/> </div> <div class="o-form-element"> @@ -187,27 +187,27 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; tabindex="1" name="endChoiceDate" id="endChoiceDate" - datetime={form.model.endChoiceDate} + datetime={form.model.questions[0].endChoiceDate} disabled={form.hasVotes || form.model.closed}/> </div> </div> - <MaxChoicesNumberConfig if={form.model.voteCountingType == 1 || form.model.voteCountingType == 4} + <MaxChoicesNumberConfig if={form.model.questions[0].voteCountingType == 1 || form.model.questions[0].voteCountingType == 4} ref="config" - config={form.model.voteCountingConfig} - count-choices={form.questions[0].choices.length} + config={form.model.questions[0].voteCountingConfig} + count-choices={form.model.questions[0].choices.length} disabled={form.hasVotes || form.model.closed}/> - <BordaConfig if={form.model.voteCountingType == 5} + <BordaConfig if={form.model.questions[0].voteCountingType == 5} ref="config" - config={form.model.voteCountingConfig} - count-choices={form.questions[0].choices.length} + config={form.model.questions[0].voteCountingConfig} + count-choices={form.model.questions[0].choices.length} disabled={form.hasVotes || form.model.closed}/> - <CumulativeConfig if={form.model.voteCountingType == 2} + <CumulativeConfig if={form.model.questions[0].voteCountingType == 2} ref="config" - config={form.model.voteCountingConfig} + config={form.model.questions[0].voteCountingConfig} disabled={form.hasVotes || form.model.closed}/> - <MajorityJudgmentConfig if={form.model.voteCountingType == 8} + <MajorityJudgmentConfig if={form.model.questions[0].voteCountingType == 8} ref="config" - config={form.model.voteCountingConfig} + config={form.model.questions[0].voteCountingConfig} disabled={form.hasVotes || form.model.closed}/> </div> </div> @@ -381,8 +381,8 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; this.installBundle(this.session, this.i18nprefix); this.form = this.opts.form; - if (!this.form.model.voteCountingType) { - this.form.model.voteCountingType = "1"; + if (!this.form.model.questions[0].voteCountingType) { + this.form.model.questions[0].voteCountingType = "1"; } this.showOptions = this.form.showOptions; @@ -394,8 +394,8 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; this.limitEmail = this.form.model.emailAddressSuffixes && this.form.model.emailAddressSuffixes.length; this.on("mount", () => { - this.refs["voteCountingType" + this.form.model.voteCountingType].checked = true; - this.refs.voteCountingType.value = this.form.model.voteCountingType; + this.refs["voteCountingType" + this.form.model.questions[0].voteCountingType].checked = true; + this.refs.voteCountingType.value = this.form.model.questions[0].voteCountingType; this.updateVoteCountingTypeHelp(); this.refs["pollType_" + this.form.model.pollType].focus(); }); @@ -416,7 +416,7 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; }; this.updateVoteCountingTypeHelp = () => { - this.refs.voteCountingTypeHelper.innerHTML = this.voteCountingTypes.get(this.form.model.voteCountingType.toString()).helper; + this.refs.voteCountingTypeHelper.innerHTML = this.voteCountingTypes.get(this.form.model.questions[0].voteCountingType.toString()).helper; this.update(); }; @@ -470,9 +470,9 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; this.voteCountingTypeChanged = e => { if (e.item) { - this.form.model.voteCountingType = e.item.type.id.toString(); + this.form.model.questions[0].voteCountingType = e.item.type.id.toString(); } else { - this.form.model.voteCountingType = e.target.value; + this.form.model.questions[0].voteCountingType = e.target.value; } this.updateVoteCountingTypeHelp(); }; @@ -514,16 +514,16 @@ import "../voteCountingType/MajorityJudgmentConfig.tag.html"; this.form.setSettingsDefault(); } else { if (!this.form.hasVotes) { - this.form.model.addChoices = this.refs.addChoices.checked; - this.form.model.beginChoiceDate = this.refs.addChoices.checked ? this.refs.beginChoiceDate.getValue() : undefined; - this.form.model.endChoiceDate = this.refs.addChoices.checked ? this.refs.endChoiceDate.getValue() : undefined; + this.form.model.questions[0].addChoices = this.refs.addChoices.checked; + this.form.model.questions[0].beginChoiceDate = this.refs.addChoices.checked ? this.refs.beginChoiceDate.getValue() : undefined; + this.form.model.questions[0].endChoiceDate = this.refs.addChoices.checked ? this.refs.endChoiceDate.getValue() : undefined; this.form.model.beginDate = this.refs.votePeriod && this.refs.votePeriod.checked ? this.refs.beginDate.getValue() : undefined; this.form.model.voteVisibility = this.refs.voteVisibility ? this.refs.voteVisibility.value : 'EVERYBODY'; this.form.model.anonymousVoteAllowed = this.refs.anonymousVote ? this.refs.anonymousVote.checked : false; this.form.model.resultVisibility = this.refs.resultVisibility ? this.refs.resultVisibility.value : 'EVERYBODY'; this.form.model.commentVisibility = this.refs.commentVisibility ? this.refs.commentVisibility.value : 'EVERYBODY'; - this.form.model.voteCountingConfig = this.refs.config && typeof this.refs.config.getConfig === "function" ? this.refs.config.getConfig() : {}; + this.form.model.questions[0].voteCountingConfig = this.refs.config && typeof this.refs.config.getConfig === "function" ? this.refs.config.getConfig() : {}; } this.form.model.endDate = this.refs.votePeriod.checked ? this.refs.endDate.getValue() : undefined; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.