comparison gpp/templates/polls/poll.html @ 440:ac9217eef610

Added total vote information to the poll templates. Cache the total votes in the model instance.
author Brian Neal <bgneal@gmail.com>
date Sat, 21 May 2011 20:35:02 +0000
parents 1f139de929c4
children
comparison
equal deleted inserted replaced
439:1f139de929c4 440:ac9217eef610
13 {% if user_choice %} 13 {% if user_choice %}
14 <p>You voted for &quot;{{ user_choice.choice }}&quot;.</p> 14 <p>You voted for &quot;{{ user_choice.choice }}&quot;.</p>
15 {% endif %} 15 {% endif %}
16 {% get_comment_count for poll as comment_count %} 16 {% get_comment_count for poll as comment_count %}
17 <p> 17 <p>
18 This poll has <a href="{% url 'polls.views.poll_results' poll.id %}">{{ comment_count }} comment{{ comment_count|pluralize }}</a>. 18 This poll has {{ poll.total_votes }} vote{{ poll.total_votes|pluralize }} and
19 <a href="{% url 'polls.views.poll_results' poll.id %}">{{ comment_count }} comment{{ comment_count|pluralize }}</a>.
19 {% if poll.is_open %} 20 {% if poll.is_open %}
20 Voting for this poll started on {{ poll.start_date|date:"F d, Y" }}. 21 Voting for this poll started on {{ poll.start_date|date:"F d, Y" }}.
21 {% if poll.end_date %} 22 {% if poll.end_date %}
22 Voting will end on {{ poll.end_date|date:"F d, Y" }}. 23 Voting will end on {{ poll.end_date|date:"F d, Y" }}.
23 {% endif %} 24 {% endif %}