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 1647d6ee9d43d6598c1924738b1fa5d7dd2fde48 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Tue Oct 24 09:56:56 2017 +0200 personnalisation des messages d'avertissement de la limitation du nombre de votant (ref #58) --- pollen-ui-riot-js/src/main/web/i18n/en.json | 3 --- pollen-ui-riot-js/src/main/web/i18n/fr.json | 3 --- .../src/main/web/tag/poll/Poll.tag.html | 28 +++++++++++++--------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pollen-ui-riot-js/src/main/web/i18n/en.json b/pollen-ui-riot-js/src/main/web/i18n/en.json index aab9f664..26fe15a4 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/en.json +++ b/pollen-ui-riot-js/src/main/web/i18n/en.json @@ -66,9 +66,6 @@ "poll_participants": "participants", "poll_participation": "of participation", "poll_maxVoters": "Limited to {0}", - "poll_maxVotersAlert_title": "Number of voters limitation", - "poll_maxVotersAlert": "Strandard offers has limited to {0} voters. Users can continue to vote but only the first {0} votes are taken into account in the calculation of the result.", - "poll_maxVotersAlert_offers": "Read <a href=\"#home\">the offers page</a> to unlock this limit.", "poll_closedFrom": "Closing from", "poll_urlForAdmin" : "Administrate poll with this address", "poll_urlForVote" : "Invited new participants with this address", diff --git a/pollen-ui-riot-js/src/main/web/i18n/fr.json b/pollen-ui-riot-js/src/main/web/i18n/fr.json index a1b3abaa..5699f9d6 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -66,9 +66,6 @@ "poll_participants": "participants", "poll_participation": "de participation", "poll_maxVoters": "Limité à {0}", - "poll_maxVotersAlert_title": "Limitation du Nombre de votants", - "poll_maxVotersAlert": "L'offre standard est limitée à {0} votants. Les utilisateurs peuvent continuer à voter mais seul les {0} premiers votes sont pris en compte dans le calcul du résultat.", - "poll_maxVotersAlert_offers": "Consulter <a href=\"#home\">la page des nos offres</a> pour déverrouiller cette limite.", "poll_closedFrom": "Fermé depuis le", "poll_urlForAdmin" : "Administrer ce sondage avec cette adresse", "poll_urlForVote" : "Inviter de nouveaux participants en leur envoyant cette adresse", diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html index a1b7d006..f98cf18d 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html @@ -136,13 +136,9 @@ require("./Report.tag.html"); <p><MultiLineLabel label="{poll.description}"></MultiLineLabel></p> </div> - <div if={poll.maxVoters > 0 && poll.voteCount > poll.maxVoters} - class="c-alert c-alert--warning"> - <div> - <strong> {__.maxVotersAlert_title}</strong> - </div> - {_l("maxVotersAlert", poll.maxVoters)} - <InnerHtml if={poll.permission} html={__.maxVotersAlert_offers} /> + <div class="c-alert c-alert--warning" + if={poll.maxVoters > 0 && poll.voteCount > poll.maxVoters}> + <ContentLoader path={maxVotersAlertPage}/> </div> <Votes if={selectedTab === "votes"}/> @@ -211,12 +207,22 @@ require("./Report.tag.html"); this.info(this.poll.voteCountingTypeValue.name, this.poll.voteCountingTypeValue.helper, null, "info"); }; - this.toggleMaxVoters = () => { - let message = this._l("maxVotersAlert", this.poll.maxVoters); + this.maxVotersAlertPage = locale => { + let page = "/customData/maxVotersAlert-"; if (this.poll.permission) { - message += " " + this.__.maxVotersAlert_offers; + page += "creator-"; } - this.info(this.__.maxVotersAlert_title, message, null, "warning"); + page += locale + ".html"; + return page; + }; + + this.toggleMaxVoters = () => { + let path = this.maxVotersAlertPage(this.session.locale); + fetch(path).then(response => { + return response.text(); + }).then(message => { + this.info("", message, null, "warning"); + }); }; </script> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.