This is an automated email from the git hooks/post-receive script. New commit to branch feature/component_choice_editor in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 1bad9bfdea6777c68dae5d0cf49e3fee041aaadd Author: Kevin Morin <morin@codelutin.com> Date: Fri Mar 10 17:17:06 2017 +0100 gestion des images --- .../src/main/web/tag/poll/Votes.tag.html | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html index bdd817b..cdf5f56 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Votes.tag.html @@ -23,7 +23,7 @@ {error['voter.name']} </div> </div> - <div each={choice in poll.choices} class="choice"> + <div each={choice in poll.choices} class="choice {choice.choiceType === 'RESOURCE' ? 'choice-resource' : ''}"> <div id="{choice.id}" class="choice-value"> </div> <div class="current-choice"> @@ -134,8 +134,13 @@ let session = require("../../js/Session"); let Remarkable = require("remarkable"); this.md = new Remarkable(); + this.moment = require("moment"); + this.moment.locale(session.locale); - this.installBundle(session, "poll_votes"); + this.installBundle(session, "poll_votes", (locale) => { + this.moment.locale(locale); + this.updateChoices(); + }); session.getUser().then(user => { this.userName = user && user.name; }); @@ -151,11 +156,15 @@ }).then(() => { this.loaded = true; this.update(); - this.choices.forEach(c => { + this.updateChoices(); + }); + + this.updateChoices = () => { + this.poll.choices.forEach(c => { if (c.choiceType === "DATE") { - c.choiceValueStr = moment(parseInt(c.choiceValue, 10)).format("LL"); + c.choiceValueStr = this.moment(parseInt(c.choiceValue, 10)).format("LL"); } else if (c.choiceType === "DATETIME") { - c.choiceValueStr = moment(parseInt(c.choiceValue, 10)).format("LLL"); + c.choiceValueStr = this.moment(parseInt(c.choiceValue, 10)).format("LLL"); } else if (c.choiceType === "RESOURCE") { c.choiceValueStr = ""; } else { @@ -163,7 +172,7 @@ } document.getElementById(c.id).innerHTML = this.md.render(c.choiceValueStr); }); - }); + }; this.voteId = null; this.error = {}; @@ -335,6 +344,10 @@ justify-content: center; } + .voters .fix .choice.choice-resource { + height: 200px; + } + .check { width: 25px; height: 25px; -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.