From 030ab12b940e926acbb835cf7706204f81cbe4f3 Mon Sep 17 00:00:00 2001 From: Adrien Dorsaz Date: Fri, 9 Aug 2013 01:38:28 +0200 Subject: Indent and update design for vote --- papillon/templates/vote.html | 337 ++++++++++++++++++++++++++----------------- 1 file changed, 201 insertions(+), 136 deletions(-) diff --git a/papillon/templates/vote.html b/papillon/templates/vote.html index 8861e6c..4ab70fe 100644 --- a/papillon/templates/vote.html +++ b/papillon/templates/vote.html @@ -10,140 +10,205 @@ {% endblock %} {% block content %} -

{%if poll.category %}{{poll.category.name}} - {%endif%}{{poll.name}}

-{% if error %}

{{ error }}

{% endif %} -{% if not poll.open %}

{% trans "The current poll is closed."%}

{% endif %} -

{{ poll.description|safe }}

-
- {% csrf_token %} -
- - - - - {% for choice in choices %} - {% endfor %} - {% if not hide_vote %} - {% for voter in voters %} -{% ifequal current_voter_id voter.id %} - - - - {% for vote in voter.votes %} - {%endfor%} -{%else%} - - - {% for vote in voter.votes %} - {% ifequal poll.type 'V' %} - - {% else %} - - {% endifequal %} - {%endfor%} - {%endifequal%} - {%endfor%} - {%endif%} - {%if not current_voter_id%}{% if poll.open %} - - - - {%for choice in choices%}{%endfor%} - - {%endif%}{%endif%} - {% if not hide_vote %} - - {% for choice in choices %}{{choice.getSum}} - {% endfor %} - {%endif%} - {% if poll.open %} - - - {% endif %} -
{%if poll.dated_choices%}{{choice.date|date:"D d M Y H:i"}}{%else%}{{choice.name}}{%endif%}{% if choice.limit %} ({% trans "max" %} {{choice.limit}}){%endif%}
- {% if vote.choice.available or vote.value %} - {% ifequal poll.type 'P' %} - - {% endifequal %} - {% ifequal poll.type 'O' %} - - {% endifequal %} - {% ifequal poll.type 'B' %} - - {% endifequal %} - {% ifequal poll.type 'V' %} - - {% endifequal %} - {% else %} - {% trans "Limit reached" %} - {% endif %} - {% if poll.open %}{% trans "Edit" %}{%else%} {%endif%}{{voter.user.name}} - {%if vote.value%}{{vote.value}}{%else%}0{%endif%} - {%ifequal poll.type 'B'%} - {%for VOT in VOTE%} - {%ifequal VOT.0 vote.value%}{{VOT.1.1}}{%endifequal%}{%endfor%} - {%else%} - {%for VOT in VOTE%} - {%ifequal VOT.0 vote.value%}{{VOT.1.0}}{%endifequal%}{%endfor%} - {%endifequal%} -
- {% if choice.available %} - {% ifequal poll.type 'P' %} - {% endifequal %} - {% ifequal poll.type 'O' %} - {% endifequal %} - {% ifequal poll.type 'B' %} - - {% endifequal %} - {% ifequal poll.type 'V' %} - - {% endifequal %} - {% else %} - {% trans "Limit reached" %} - {% endif %} -
{% trans "Sum" %}
-
-
-
- {%if poll.opened_admin%} -

{%trans "Add a new choice to this poll?"%}

{%endif%} -
- {%if hide_vote%}

{% trans "You have already vote? You are enough wise not to be influenced by other votes? You can display result by clicking" %} {% trans "here" %}.

{%else%} -

{% trans "Remain informed of poll evolution:" %} {%trans "syndication"%}

{%endif%} -
-{%if not hide_vote and max_comment_nb %} -

{%trans "Comments"%} ({% blocktrans %}{{max_comment_nb}} max{% endblocktrans %})

-
- {%if poll.open and max_comment_nb > poll.comments.count %}
- - - - - - - - - - -
-
{%endif%} - -
{%endif%} +

{%if poll.category %}{{poll.category.name}} - {%endif%}{{poll.name}}

+ {% if error %}

{{ error }}

{% endif %} + {% if not poll.open %}

{% trans "The current poll is closed."%}

{% endif %} + +

{% trans "Description" %}

+

{{ poll.description|safe }}

+ +

{% trans "Participation" %}

+
+ {% csrf_token %} +
+ + + + + {% for choice in choices %} + + {% endfor %} + + + {% if not hide_vote %} + {% for voter in voters %} + + {% ifequal current_voter_id voter.id %} + + + + {% for vote in voter.votes %} + + {%endfor%} + {%else%} + + + {% for vote in voter.votes %} + {% ifequal poll.type 'V' %} + + {% else %} + + {% endifequal %} + {%endfor%} + {%endifequal%} + + {%endfor%} + {%endif%} + + + {%if not current_voter_id%} + {% if poll.open %} + + + + {%for choice in choices%} + + {%endfor%} + + {%endif%} + {%endif%} + + + {% if not hide_vote %} + + + + {% for choice in choices %} + {{choice.getSum}} + {% endfor %} + + {%endif%} + + + {% if poll.open %} + + + + + {% endif %} +
+ {%if poll.dated_choices%} + {{choice.date|date:"D d M Y H:i"}} + {%else%} + {{choice.name}} + {%endif%} + {% if choice.limit %} + ({% trans "max" %} {{choice.limit}}) + {%endif%} +
+ {% if vote.choice.available or vote.value %} + {% ifequal poll.type 'P' %} + + {% endifequal %} + {% ifequal poll.type 'O' %} + + {% endifequal %} + {% ifequal poll.type 'B' %} + + {% endifequal %} + {% ifequal poll.type 'V' %} + + {% endifequal %} + {% else %} + {% trans "Limit reached" %} + {% endif %} + {% if poll.open %}{% trans "Edit" %}{%else%} {%endif%}{{voter.user.name}} + {%if vote.value%}{{vote.value}}{%else%}0{%endif%} + + {%ifequal poll.type 'B'%} + {%for VOT in VOTE%} + {%ifequal VOT.0 vote.value%} + {{VOT.1.1}} + {%endifequal%} + {%endfor%} + {%else%} + {%for VOT in VOTE%} + {%ifequal VOT.0 vote.value%} + {{VOT.1.0}} + {%endifequal%} + {%endfor%} + {%endifequal%} +
+ {% if choice.available %} + {% ifequal poll.type 'P' %} + + {% endifequal %} + {% ifequal poll.type 'O' %} + + {% endifequal %} + {% ifequal poll.type 'B' %} + + {% endifequal %} + {% ifequal poll.type 'V' %} + + {% endifequal %} + {% else %} + {% trans "Limit reached" %} + {% endif %} +
{% trans "Sum" %}
+ +
+
+
+
+ + {%if poll.opened_admin%} +

{%trans "Add a new choice to this poll?"%}

+ {%endif%} + +
+ {%if hide_vote%} +

+ {% trans "You have already vote? You are enough wise not to be influenced by other votes? You can display result by clicking" %} + {% trans "here" %}. +

+ {%else%} +

+ {% trans "Remain informed of poll evolution:" %} + {%trans "RSS syndication"%} +

+ {%endif%} +
+ + {%if not hide_vote and max_comment_nb %} +

{%trans "Comments"%} ({% blocktrans %}{{max_comment_nb}} max{% endblocktrans %})

+ + {%if poll.open and max_comment_nb > poll.comments.count %} +
+
{% trans "Add a comment"%}
+
+ +
+ +
+ +
+ + +
+ {%endif%} + {%endif%} {% endblock %} -- cgit v1.2.3