04/06: Dans les listes des sondages : voir les sondage hors limites du nombre de votants (ref #58)
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 9ba5ccb24f25c7bde8bb87b75be72958c97c033f Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Thu Sep 28 09:14:46 2017 +0200 Dans les listes des sondages : voir les sondage hors limites du nombre de votants (ref #58) --- pollen-ui-riot-js/src/main/web/i18n/en.json | 1 + pollen-ui-riot-js/src/main/web/i18n/fr.json | 1 + .../src/main/web/tag/poll/PollCard.tag.html | 26 +++++++++++++++++----- 3 files changed, 22 insertions(+), 6 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 fbcc6012..86a57fb5 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/en.json +++ b/pollen-ui-riot-js/src/main/web/i18n/en.json @@ -65,6 +65,7 @@ "poll_subscribers": "subscribers", "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 resultles.", "poll_maxVotersAlert_offers": "Read <a href=\"#home\">the offers page</a> to unlock this limit.", 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 d3b0585a..edeb87ac 100644 --- a/pollen-ui-riot-js/src/main/web/i18n/fr.json +++ b/pollen-ui-riot-js/src/main/web/i18n/fr.json @@ -65,6 +65,7 @@ "poll_subscribers": "invités", "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": "Cousulter <a href=\"#home\">la page des nos offres</a> pour déverrouiller cette limite.", diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/PollCard.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/PollCard.tag.html index b70f2bca..a2347c15 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/PollCard.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/PollCard.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% @@ -57,10 +57,16 @@ </div> </div> - <a class="poll-votes" - href="#poll/{opts.poll.id}/vote/{opts.poll.permission}"> - {opts.poll.voteCount === 0 ? __.noVote : (opts.poll.voteCount + " " + (count === 1 ? __.vote : __.votes))} - </a> + <span class="poll-votes"> + <a href="#poll/{opts.poll.id}/vote/{opts.poll.permission}"> + {opts.poll.voteCount === 0 ? __.noVote : (opts.poll.voteCount + " " + (count === 1 ? __.vote : __.votes))} + </a> + <a if={opts.poll.maxVoters > 0 &&opts.poll.voteCount > opts.poll.maxVoters} + class="c-badge c-badge--rounded c-badge--warning" + onclick={toggleMaxVoters}>{_l("maxVoters", opts.poll.maxVoters)} + </a> + </span> + </div> <script type="es6"> @@ -80,6 +86,14 @@ }); }; + this.toggleMaxVoters = () => { + let message = this._l("maxVotersAlert", this.opts.poll.maxVoters); + if (this.opts.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>.
participants (1)
-
chorem.org scm