From edd1bad62b445b0cae291f0406e7d0ca1eabf5ae Mon Sep 17 00:00:00 2001 From: etienne Date: Sun, 24 Aug 2008 22:18:42 +0000 Subject: Update of the model. Sort vote by creation date (#15). Update of poll information (#13). New poll types (#2, #5) --- templates/createOrEdit.html | 57 ++++++++++++++++++++++++++++----------------- templates/vote.html | 34 +++++++++++++++++++-------- 2 files changed, 60 insertions(+), 31 deletions(-) (limited to 'templates') diff --git a/templates/createOrEdit.html b/templates/createOrEdit.html index 4eecaa2..0c223ff 100644 --- a/templates/createOrEdit.html +++ b/templates/createOrEdit.html @@ -7,58 +7,73 @@ {% endif %}

{% if new %}{% trans "New poll" %}{% else %}{% trans "Edit poll" %}{% endif %}

{% if error %}

{{ error }}

{% endif %} -
- +
+ {% if not new %} - + - + {% endif %} - + - + - + - - {% if not new %}{% if choices %} - + {% if choices %} + {% for choice in choices %} - + + + {% endfor %}{% endif %} + + + - {% endfor %}{% endif %} - {% endif %}
http://{{full_base_url}}http://{{full_base_url}} {% trans "Copy this address and send it to voters who want to participate to this poll" %}
http://{{full_admin_url}}http://{{full_admin_url}} {% trans "Address to modify the current poll" %}
{% if new %}{% else %}{{author_name}}{% endif %}{% if new %}{% else %}{{author_name}}{% endif %} {% trans "Name, firstname or nickname of the author" %}
{% if new %}{% else %}{{poll_name}}{% endif %}{% if new %}{% else %}{% endif %} {% trans "Global name to present the poll" %}
{% if new %}{% else %}{{poll_desc}}{% endif %}{% if new %}{% else %}{% endif %} {% trans "Precise description of the poll" %}
{% if new %}{% if new %}{% else %}{{type_name}}{% endif %} {% trans "Type of the poll:" %}
    -
  • {% trans "Poll is the appropriate type for a simple multi-choice poll" %}
  • -
  • {% trans "Balanced poll lets voters setting negative vote for some choices" %}
  • - +
  • {% trans '"Poll" is the appropriate type for a simple multi-choice poll' %}
  • +
  • {% trans '"Balanced poll" lets voters setting negative vote for some choices' %}
  • +
  • {% trans '"One choice poll"' %}
{% trans "Choices" %} {% trans "Delete?"%}
{% trans "Choices" %}{% trans "Label" %}{% trans "Limit" %}{% trans "Delete?"%}
 {{choice.name}} {{choice.name}}{%if choice.limit%}{% blocktrans with choice.limit as choice_limit%}Limited to {{choice_limit}} vote(s){% endblocktrans %}{%endif%}
{% if new %} + + {% else %} + + {% endif %}
- {% if new %} - - {% else %} - - {% endif %}
+ +{% if new %} + +{% else %} +
+ {%trans "Limited to"%} {%trans "vote(s)"%}{% trans "Setting a new choice. Optionally you can set a limit of vote for this choice. This limit is usefull for limited resources allocation." %} + + + + +
+ + {% endif %} {% endblock %} diff --git a/templates/vote.html b/templates/vote.html index 27e54a3..566bb8e 100644 --- a/templates/vote.html +++ b/templates/vote.html @@ -11,32 +11,40 @@ - {% for choice in choices %}{{choice.name}} + {% for choice in choices %}{{choice.name}}{% if choice.limit %} ({% trans "max" %} {{choice.limit}}){%endif%} {% endfor %} {% for voter in voters %}{% ifequal current_voter_id voter.id %} - + {% for vote in voter.votes %} + {% if vote.choice.available or vote.value %} {% ifequal poll_type 'P' %} - + + {% endifequal %} + {% ifequal poll_type 'O' %} + {% endifequal %} {% ifequal poll_type 'B' %} - {% for vote_choice in VOTE %} {% endfor %} {% endifequal %} + {% else %} + {% trans "Limit reached" %} + {% endif %} {%endfor%} {%else%}{% trans "Edit" %} - {{voter.name}} + {{voter.user.name}} {% for vote in voter.votes %} - {%ifequal poll_type 'P'%} - {%ifequal vote.value 0%}{% trans "No" %}{%else%}{% trans "Yes" %}{%endifequal%} + {%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}}{%endifequal%}{%endfor%} + {%ifequal VOT.0 vote.value%}{{VOT.1.0}}{%endifequal%}{%endfor%} {%endifequal%} {%endfor%} @@ -47,19 +55,25 @@ {%for choice in choices%} + {% if choice.available %} {% ifequal poll_type 'P' %} {% endifequal %} + {% ifequal poll_type 'O' %} + {% endifequal %} {% ifequal poll_type 'B' %} {% endifequal %} + {% else %} + {% trans "Limit reached" %} + {% endif %} {%endfor%} {%endif%} {% trans "Sum" %} - {% for sum in choices_sum %}{{sum}} + {% for choice in choices %}{{choice.sum}} {% endfor %} -- cgit v1.2.3