This is an automated email from the git hooks/post-receive script. New commit to branch feature/58-limitation-des-votants in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 6b46dc9a47fc2d3b8fae81c94bf196b665962443 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed Sep 27 16:48:26 2017 +0200 indiquer la limite de votants pour un sondage (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 | 29 ++++++++++++++++------ 3 files changed, 26 insertions(+), 9 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 b96fc33b..31cd9921 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/en.json +++ b/pollen-ui-riot-js/src/main/web/i18n/en.json @@ -65,7 +65,8 @@ "poll_subscribers": "subscribers", "poll_participants": "participants", "poll_participation": "of participation", - "poll_maxVotersAlert": "<strong>Warnning</strong> : 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 resultles.", + "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 resultles.", "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", 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 d33dfa2f..e36851b0 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -65,7 +65,8 @@ "poll_subscribers": "invités", "poll_participants": "participants", "poll_participation": "de participation", - "poll_maxVotersAlert": "<strong>Attention</strong> : 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_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": "Cousulter <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", 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 ba136545..d36b97c5 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 @@ -8,12 +8,12 @@ it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. #L% @@ -113,11 +113,15 @@ require("./Report.tag.html"); <p>{__.createdBy} <span class="brand">{poll.creatorName}</span></p> </div> - <div class="left-icon"> + <div class="left-icon" onclick="{toggleMaxVoters}"> <i class="fa fa-envelope"></i> - <p if={poll.voteCount === 0}>{__.noVote}</p> - <p if={poll.voteCount === 1}><span class="brand">1</span> {__.vote}</p> - <p if={poll.voteCount > 1}><span class="brand">{poll.voteCount}</span> {__.votes}</p> + <p> + <span if={poll.voteCount > 0} class="brand">{poll.voteCount}</span> + {poll.voteCount === 0 ? __.noVote : (poll.voteCount === 1 ? __.vote : __.votes)} + <a if={poll.maxVoters > 0} class="info-label"> + <i class="fa fa-exclamation-circle" aria-hidden="true"></i> + </a> + </p> </div> <div class="left-icon" if="{poll.pollType === 'RESTRICTED'}"> @@ -134,7 +138,10 @@ require("./Report.tag.html"); <div if={poll.maxVoters > 0 && poll.voteCount > poll.maxVoters} class="c-alert c-alert--warning"> - <InnerHtml html={_l("maxVotersAlert", poll.maxVoters)}/> + <div> + <strong> {__.maxVotersAlert_title}</strong> + </div> + {_l("maxVotersAlert", poll.maxVoters)} <InnerHtml if={poll.permission} html={__.maxVotersAlert_offers} /> </div> @@ -204,6 +211,14 @@ 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); + if (this.poll.permission) { + message += " " + this.__.maxVotersAlert_offers; + } + this.info(this.__.maxVotersAlert_title, message, null, "warning"); + }; + </script> <style> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.