this repo has no description

Change question detail screen to a form

+19 -6
+19 -6
polls/templates/polls/detail.html
··· 1 - <h1>{{ question.question_text }}</h1> 2 - <ul> 3 - {% for choice in question.choice_set.all %} 4 - <li>{{ choice.choice_text }}</li> 5 - {% endfor %} 6 - </ul> 1 + <form action="{% url 'polls:vote' question.id%}" method="post"> 2 + {% csrf_token%} 3 + <fieldset> 4 + <legend><h1>{{ question.question_text }}</h1></legend> 5 + {% if error_message%} 6 + <p><strong>{{ error_message }}</strong></p> 7 + {% endif%} {% for choice in question.choice_set.all %} 8 + <input 9 + type="radio" 10 + name="choice" 11 + id="choice{{ forloop.counter }}" 12 + value="{{ choice.id }}" 13 + /> 14 + <label for="choice{{ forloop.counter }}">{{choice.choice_text}}</label 15 + ><br /> 16 + {% endfor %} 17 + </fieldset> 18 + <input type="submit" value="Vote" /> 19 + </form>