End tuto03
This commit is contained in:
6
polls/templates/polls/detail.html
Normal file
6
polls/templates/polls/detail.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>{{ question.question_txt }}</h1>
|
||||
<ul>
|
||||
{% for choice in question.choice_set.all %}
|
||||
<li>{{ choice.choice_txt }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
10
polls/templates/polls/index.html
Normal file
10
polls/templates/polls/index.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% 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>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p>No polls are available.</p>
|
||||
{% endif %}
|
Reference in New Issue
Block a user