avancé de dev
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
<h1>{{ question.question_txt }}</h1>
|
||||
<ul>
|
||||
{% for choice in question.choice_set.all %}
|
||||
<li>{{ choice.choice_txt }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<form action="{% url 'polls:vote' question.id %}" method="post">
|
||||
{%csrf_token%}
|
||||
<fieldset>
|
||||
<legend><h1>{{question.question_txt}}</h1></legend>
|
||||
{%if error_message%}<p><strong>{{error_message}}</strong></p>{%endif%}
|
||||
{%for choice in question.choice_set.all%}
|
||||
<input type="radio" name="choice" id="choice{{forloop.counter}}" value="{{choice.id}}" />
|
||||
<label for="choice{{forlopp.counter}}">{{choice.choice_txt}}</label><br>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
<input type="submit" value="Vote">
|
||||
</form>
|
@@ -1,8 +1,11 @@
|
||||
{% load static %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}">
|
||||
|
||||
{% if latest_question_list %}
|
||||
<h1>Liste des questions:</h1>
|
||||
<ul>
|
||||
{% for question in latest_question_list %}
|
||||
<li><a href="{% url 'polls:detail' question.id %}/">{{ question.question_txt }}</a></li>
|
||||
<li><a href="{% url 'polls:detail' question.id %}">{{ question.question_txt }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
|
Reference in New Issue
Block a user