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 7de2afcc6903d62e973795b012c211b6742cbf49 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Mon May 22 16:45:35 2017 +0200 edition du sondage : ne pas modifier les champ pour un sondage clos et corriger le bouton précédent --- .../src/main/web/tag/poll/Choice.tag.html | 1 + .../src/main/web/tag/poll/Description.tag.html | 6 +++- .../src/main/web/tag/poll/EditPoll.tag.html | 5 ++-- .../src/main/web/tag/poll/Settings.tag.html | 35 ++++++++++++---------- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html index ceea93c..f3d4845 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Choice.tag.html @@ -96,6 +96,7 @@ require("../components/time-picker.tag.html"); <div show="{showDescription}"> <textarea ref="description" placeholder="{__.description_placeholder}" + disabled={opts.disabled} value="{opts.choice.description}"/> </div> 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 438aca2..470617b 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 @@ -24,8 +24,10 @@ <input ref="title" type="text" class="c-field" - required name="title" + required + name="title" value="{form.model.title}" + disabled={opts.form.model.isClosed} placeholder="{__.titlePlaceHolder}"> </div> <div class="o-form-element"> @@ -36,6 +38,7 @@ required name="name" value="{form.model.creatorName}" + disabled={opts.form.model.isClosed} placeholder="{__.namePlaceHolder}"> </div> <div class="o-form-element"> @@ -45,6 +48,7 @@ class="c-field" name="email" value="{form.model.creatorEmail}" + disabled={opts.form.model.isClosed} placeholder="{__.emailPlaceHolder}"> </div> 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 57e6cd5..43135ba 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 @@ -51,7 +51,7 @@ require("./Created.tag.html"); <i class="fa fa-undo" aria-hidden="true"></i> {__.cancel} </a> - <button type="button" if={form.step > 0} + <button type={form.creation || form.model.isClosed ? "button" : "submit"} if={form.step > 0} class="c-button c-button--ghost-info" onclick={previousStep}> <i class="fa fa-chevron-left" aria-hidden="true"></i> @@ -70,6 +70,7 @@ require("./Created.tag.html"); <button type="submit" if={!form.creation || form.step === form.steps.length - 1} class="c-button c-button--info" + show={!form.model.isClosed} onclick={savePoll}> <i class="fa fa-{form.creation ? 'plus' : 'check'}" aria-hidden="true"></i> {__.save} @@ -140,7 +141,7 @@ require("./Created.tag.html"); }; this.previousStep = () => { - if (this.form.creation) { + if (this.form.creation || this.form.model.isClosed) { this.form.previousStep(); } else { this.callAfterSubmit = () => this.form.previousStep(); 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 8995c17..4714775 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 @@ -30,7 +30,8 @@ {__.use_basic_usage} <input type="checkbox" checked={!showOptions} - onclick={toggleShowOptions}> + onclick={toggleShowOptions} + disabled={opts.form.model.isClosed}> <div class="c-toggle__track"> <div class="c-toggle__handle"></div> </div> @@ -64,7 +65,7 @@ <select class="c-field" ref="voteCountingType" value={form.model.voteCountingType} - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} onchange={voteCountingTypeChanged}> <option each={type in form.voteCountingTypes} value={type.id}> @@ -92,7 +93,7 @@ id="choiceAddAllowed" ref="addChoices" checked={form.model.choiceAddAllowed} - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} onclick="{toggleChoiceAddAllowed}"> <div class="c-toggle__track"> <div class="c-toggle__handle"></div> @@ -108,7 +109,7 @@ name="beginChoiceDate" id="beginChoiceDate" class="c-field" - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} value={form.model.beginChoiceDate} type="datetime-local" pattern={DATETIME_INPUT_PATTERN}> @@ -121,7 +122,7 @@ name="endChoiceDate" id="endChoiceDate" class="c-field" - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} value={form.model.endChoiceDate} type="datetime-local" pattern={DATETIME_INPUT_PATTERN}> @@ -134,7 +135,7 @@ name="limitChoices" id="limitChoices" ref="limitChoices" - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} checked={form.model.limitChoices} onclick="{toggleLimitChoices}"> <div class="c-toggle__track"> @@ -150,7 +151,7 @@ id="maxChoiceNumber" ref="maxChoiceNumber" class="c-field" - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} value={form.model.maxChoiceNumber} min="{form.model.limitChoices ? 1 : 0}" max="{form.choices.length}" type="number"> @@ -171,6 +172,7 @@ id="votePeriod" ref="votePeriod" checked={form.model.beginDate || form.model.endDate} + disabled={opts.form.model.isClosed} onclick="{toggleVotePeriod}"> <div class="c-toggle__track"> <div class="c-toggle__handle"></div> @@ -185,7 +187,7 @@ <input ref="beginDate" name="beginDate" id="beginDate" - disabled={!form.hasVotes} + disabled={!form.hasVotes || opts.form.model.isClosed} value={formatDateForInput(form.model.beginDate)} class="c-field" type="datetime-local" @@ -199,6 +201,7 @@ name="endDate" id="endDate" value={formatDateForInput(form.model.endDate)} + disabled={opts.form.model.isClosed} class="c-field" type="datetime-local" pattern={DATETIME_INPUT_PATTERN} @@ -211,7 +214,7 @@ </label> <select class="c-field" ref="voteVisibility" - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} value={form.model.voteVisibility}> <option value="ANONYMOUS">{__.voteVisibility_anonymous}</option> <option value="CREATOR">{__.voteVisibility_creator}</option> @@ -226,7 +229,7 @@ name="anonymousVote" id="anonymousVote" ref="anonymousVote" - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} checked={form.model.anonymousVoteAllowed} onclick="{toggleAnonymousVote}"> <div class="c-toggle__track"> @@ -248,7 +251,7 @@ </label> <select class="c-field" ref="resultVisibility" - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} value={form.model.resultVisibility}> <option value="CREATOR">{__.resultVisibility_creator}</option> <option value="VOTER">{__.resultVisibility_voter}</option> @@ -263,6 +266,7 @@ id="continuousResults" ref="continuousResults" checked={form.model.continuousResults} + disabled={opts.form.model.isClosed} onclick="{toggleContinuousResults}"> <div class="c-toggle__track"> <div class="c-toggle__handle"></div> @@ -283,7 +287,7 @@ </label> <select class="c-field" ref="commentVisibility" - disabled={form.hasVotes} + disabled={form.hasVotes || opts.form.model.isClosed} value={form.model.commentVisibility}> <option value="NOBODY">{__.commentVisibility_nobody}</option> <option value="VOTER">{__.commentVisibility_voter}</option> @@ -305,7 +309,7 @@ <select class="c-field" ref="voteNotification" value={form.model.voteNotification} - disabled={!form.model.creatorEmail}> + disabled={!form.model.creatorEmail || opts.form.model.isClosed}> <option value="NEVER">{__.voteNotification_never}</option> <option value="EVERY_VOTE">{__.voteNotification_everyVote}</option> </select> @@ -316,7 +320,7 @@ <input type="checkbox" checked={notifyMeBeforePollEnds} onclick={toggleNotifyMeBeforePollEnds} - disabled={disableNotifyMeBeforePollEnds}> + disabled={disableNotifyMeBeforePollEnds || opts.form.model.isClosed}> <div class="c-toggle__track"> <div class="c-toggle__handle"></div> </div> @@ -329,7 +333,8 @@ class="c-field" ref="notifyMeHoursBeforePollEnds" value={form.model.notifyMeHoursBeforePollEnds} - min="{notifyMeBeforePollEnds ? 1 : 0}"> + min="{notifyMeBeforePollEnds ? 1 : 0}" + disabled={opts.form.model.isClosed}> </div> </div> </div> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.