new templates
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
<h1>{{ question.question_text }}</h1>
|
<form action="{% url 'polls:vote' question.id %}" method="post">
|
||||||
<ul>
|
{% csrf_token %}
|
||||||
{% for choice in question.choice_set.all %}
|
<fieldset>
|
||||||
<li>{{ choice.choice_text }}</li>
|
<legend><h1>{{ question.question_text }}</h1></legend>
|
||||||
{% endfor %}
|
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
|
||||||
</ul>
|
{% for choice in question.choice_set.all %}
|
||||||
|
<input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
|
||||||
|
<label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br>
|
||||||
|
{% endfor %}
|
||||||
|
</fieldset>
|
||||||
|
<input type="submit" value="Vote">
|
||||||
|
</form>
|
||||||
|
|||||||
9
polls/templates/polls/results.html
Normal file
9
polls/templates/polls/results.html
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<h1>{{ question.question_text }}</h1>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
{% for choice in question.choice_set.all %}
|
||||||
|
<li>{{ choice.choice_text }} -- {{ choice.votes }} vote{{ choice.votes|pluralize }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<a href="{% url 'polls:detail' question.id %}">Vote again?</a>
|
||||||
Reference in New Issue
Block a user