Mercurial > public > sg101
annotate 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 |
rev | line source |
---|---|
gremmie@1 | 1 {% extends 'base.html' %} |
bgneal@310 | 2 {% load url from future %} |
gremmie@1 | 3 {% load comment_tags %} |
gremmie@1 | 4 {% block title %}Polls: {{ poll.question }}{% endblock %} |
gremmie@1 | 5 {% block content %} |
gremmie@1 | 6 <h2>Poll</h2> |
gremmie@1 | 7 <h3>{{ poll.question }}</h3> |
gremmie@1 | 8 <ul class="poll-detail"> |
gremmie@1 | 9 {% for choice in poll.choice_set.all %} |
gremmie@1 | 10 <li>{{ choice.choice }}</li> |
gremmie@1 | 11 {% endfor %} |
gremmie@1 | 12 </ul> |
bgneal@439 | 13 {% if user_choice %} |
bgneal@439 | 14 <p>You voted for "{{ user_choice.choice }}".</p> |
bgneal@439 | 15 {% endif %} |
gremmie@1 | 16 {% get_comment_count for poll as comment_count %} |
gremmie@1 | 17 <p> |
bgneal@310 | 18 This poll has <a href="{% url 'polls.views.poll_results' poll.id %}">{{ comment_count }} comment{{ comment_count|pluralize }}</a>. |
gremmie@1 | 19 {% if poll.is_open %} |
gremmie@1 | 20 Voting for this poll started on {{ poll.start_date|date:"F d, Y" }}. |
gremmie@1 | 21 {% if poll.end_date %} |
gremmie@1 | 22 Voting will end on {{ poll.end_date|date:"F d, Y" }}. |
gremmie@1 | 23 {% endif %} |
gremmie@1 | 24 {% else %} |
gremmie@1 | 25 This poll ran from {{ poll.start_date|date:"F d, Y" }} to {{ poll.end_date|date:"F d, Y" }}. |
gremmie@1 | 26 {% endif %} |
gremmie@1 | 27 </p> |
gremmie@1 | 28 <p class="poll-nav"> |
bgneal@439 | 29 <a href="{% url 'polls-results' poll.id %}">View Results & Comments</a> |
gremmie@1 | 30 {% if poll.is_open and user.is_authenticated %} |
bgneal@439 | 31 | <a href="{% url 'polls-vote' poll_id=poll.id %}">Vote</a> |
gremmie@1 | 32 {% endif %} |
bgneal@439 | 33 | <a href="{% url 'polls-main' %}">All Polls</a> |
gremmie@1 | 34 </p> |
gremmie@1 | 35 {% endblock %} |