diff --git a/README.md b/README.md index b074e4a..4788f8c 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,9 @@ That's all... ## Versions +### 2.0.1 +- Result page : display the exact percentage instead of 50% in the explanation sentence + ### 2.0.0 - Add Advanced option : Admin link, limit max users, send links by mail, Facebook sharing, asking name of users diff --git a/templates/vote/result.html.twig b/templates/vote/result.html.twig index 6d0cce5..154fccb 100644 --- a/templates/vote/result.html.twig +++ b/templates/vote/result.html.twig @@ -46,13 +46,19 @@ + {% set valueBetter=0 %} {% for choice in proposal.choices %} {% if choice.label==result[0].candidate.label %} {% for mention_value,mention_label in mentions %} {% set valueMention=meritProfiles[choice.id][mention_value] %} + {% if valueBetter<=50 %} + {% set valueBetter=valueBetter+valueMention %} + {% endif %} + {% if valueMention>1 %} {# {{ valueMention|round(2,'floor')|number_format(2, '.', ',') }}% #} {% endif %} @@ -66,7 +72,8 @@
+ 50% 100%
-

*50% des participants considèrent que ce candidat (ou cette proposition) est au moins "{{ winnerMention }}"

+ {#

*{{ valueBetter|round(2,'floor') }}% des participants considèrent que ce candidat (ou cette proposition) est au moins "{{ winnerMention }}"

#} +

* La majorité des participants considère que ce candidat/proposition est au moins "{{ winnerMention }}".