comparison gpp/templates/polls/poll_vote.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 88b2b9cb8c1f
children 8f46ba2f1b81
comparison
equal deleted inserted replaced
438:524fd1b3919a 439:1f139de929c4
4 {% block custom_css %} 4 {% block custom_css %}
5 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/polls.css" /> 5 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/polls.css" />
6 {% endblock %} 6 {% endblock %}
7 {% block content %} 7 {% block content %}
8 <h2>Poll</h2> 8 <h2>Poll</h2>
9 <h3>{{ poll.question }}</h3> 9 <h3>Voting Booth: {{ poll.question }}</h3>
10 <form action="." method="post">{% csrf_token %} 10 {% if user_choice %}
11 <p>You voted for &quot;{{ user_choice.choice }}&quot;.</p>
12 <form action="{% url 'polls-delete_vote' %}" method="post">{% csrf_token %}
11 <div class="poll-form"> 13 <div class="poll-form">
12 {{ vote_form.as_p }} 14 <input type="hidden" name="poll_id" value="{{ poll.id }}" />
13 <input type="submit" value="Vote" /> 15 <input type="submit" value="Delete My Vote!" />
14 </div> 16 </div>
15 </form> 17 </form>
18 {% else %}
19 <form action="." method="post">{% csrf_token %}
20 <div class="poll-form">
21 {{ vote_form.as_p }}
22 <input type="submit" value="Vote" />
23 </div>
24 </form>
25 {% endif %}
16 <p class="poll-nav"> 26 <p class="poll-nav">
17 <a href="{{ poll.get_absolute_url }}">Poll Details</a> 27 <a href="{{ poll.get_absolute_url }}">Poll Details</a>
18 | <a href="{% url 'polls.views.poll_results' poll.id %}">View Results</a> 28 | <a href="{% url 'polls-results' poll.id %}">View Results</a>
19 | <a href="{% url 'polls.views.poll_index' %}">Poll Index</a> 29 | <a href="{% url 'polls-main' %}">All Polls</a>
20 </p> 30 </p>
21 <p>This poll was published on {{ poll.start_date|date:"F d, Y" }}.</p> 31 <p>This poll was published on {{ poll.start_date|date:"F d, Y" }}.</p>
22 {% endblock %} 32 {% endblock %}