Mercurial > public > sg101
annotate gpp/templates/polls/poll.html @ 169:7071b196ddd5
Implement #54; add a forum query to display a user's posts.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 31 Jan 2010 04:52:08 +0000 |
parents | dbd703f7d63a |
children | daa2916f5b34 |
rev | line source |
---|---|
gremmie@1 | 1 {% extends 'base.html' %} |
gremmie@1 | 2 {% load comment_tags %} |
gremmie@1 | 3 {% block title %}Polls: {{ poll.question }}{% endblock %} |
gremmie@1 | 4 {% block content %} |
gremmie@1 | 5 <h2>Poll</h2> |
gremmie@1 | 6 <h3>{{ poll.question }}</h3> |
gremmie@1 | 7 <ul class="poll-detail"> |
gremmie@1 | 8 {% for choice in poll.choice_set.all %} |
gremmie@1 | 9 <li>{{ choice.choice }}</li> |
gremmie@1 | 10 {% endfor %} |
gremmie@1 | 11 </ul> |
gremmie@1 | 12 {% get_comment_count for poll as comment_count %} |
gremmie@1 | 13 <p> |
gremmie@1 | 14 This poll has <a href="{% url polls.views.poll_results poll.id %}">{{ comment_count }} comment{{ comment_count|pluralize }}</a>. |
gremmie@1 | 15 {% if poll.is_open %} |
gremmie@1 | 16 Voting for this poll started on {{ poll.start_date|date:"F d, Y" }}. |
gremmie@1 | 17 {% if poll.end_date %} |
gremmie@1 | 18 Voting will end on {{ poll.end_date|date:"F d, Y" }}. |
gremmie@1 | 19 {% endif %} |
gremmie@1 | 20 {% else %} |
gremmie@1 | 21 This poll ran from {{ poll.start_date|date:"F d, Y" }} to {{ poll.end_date|date:"F d, Y" }}. |
gremmie@1 | 22 {% endif %} |
gremmie@1 | 23 </p> |
gremmie@1 | 24 <p class="poll-nav"> |
gremmie@1 | 25 <a href="{% url polls.views.poll_results poll.id %}">View Results & Comments</a> |
gremmie@1 | 26 {% if poll.is_open and user.is_authenticated %} |
gremmie@1 | 27 | <a href="{% url polls.views.poll_vote poll_id=poll.id %}">Vote</a> |
gremmie@1 | 28 {% endif %} |
gremmie@1 | 29 | <a href="{% url polls.views.poll_index %}">Poll Index</a> |
gremmie@1 | 30 </p> |
gremmie@1 | 31 {% endblock %} |