comparison gpp/templates/polls/poll.html @ 439:1f139de929c4

Fixing #216; added anti-ballot stuffing feature to the polls application.
author Brian Neal <bgneal@gmail.com>
date Sat, 21 May 2011 19:55:48 +0000
parents daa2916f5b34
children ac9217eef610
comparison
equal deleted inserted replaced
438:524fd1b3919a 439:1f139de929c4
8 <ul class="poll-detail"> 8 <ul class="poll-detail">
9 {% for choice in poll.choice_set.all %} 9 {% for choice in poll.choice_set.all %}
10 <li>{{ choice.choice }}</li> 10 <li>{{ choice.choice }}</li>
11 {% endfor %} 11 {% endfor %}
12 </ul> 12 </ul>
13 {% if user_choice %}
14 <p>You voted for &quot;{{ user_choice.choice }}&quot;.</p>
15 {% endif %}
13 {% get_comment_count for poll as comment_count %} 16 {% get_comment_count for poll as comment_count %}
14 <p> 17 <p>
15 This poll has <a href="{% url 'polls.views.poll_results' poll.id %}">{{ comment_count }} comment{{ comment_count|pluralize }}</a>. 18 This poll has <a href="{% url 'polls.views.poll_results' poll.id %}">{{ comment_count }} comment{{ comment_count|pluralize }}</a>.
16 {% if poll.is_open %} 19 {% if poll.is_open %}
17 Voting for this poll started on {{ poll.start_date|date:"F d, Y" }}. 20 Voting for this poll started on {{ poll.start_date|date:"F d, Y" }}.
21 {% else %} 24 {% else %}
22 This poll ran from {{ poll.start_date|date:"F d, Y" }} to {{ poll.end_date|date:"F d, Y" }}. 25 This poll ran from {{ poll.start_date|date:"F d, Y" }} to {{ poll.end_date|date:"F d, Y" }}.
23 {% endif %} 26 {% endif %}
24 </p> 27 </p>
25 <p class="poll-nav"> 28 <p class="poll-nav">
26 <a href="{% url 'polls.views.poll_results' poll.id %}">View Results &amp; Comments</a> 29 <a href="{% url 'polls-results' poll.id %}">View Results &amp; Comments</a>
27 {% if poll.is_open and user.is_authenticated %} 30 {% if poll.is_open and user.is_authenticated %}
28 | <a href="{% url 'polls.views.poll_vote' poll_id=poll.id %}">Vote</a> 31 | <a href="{% url 'polls-vote' poll_id=poll.id %}">Vote</a>
29 {% endif %} 32 {% endif %}
30 | <a href="{% url 'polls.views.poll_index' %}">Poll Index</a> 33 | <a href="{% url 'polls-main' %}">All Polls</a>
31 </p> 34 </p>
32 {% endblock %} 35 {% endblock %}