Mercurial > public > sg101
view sg101/templates/polls/poll_vote.html @ 1209:d8bb9c36aae1 modernize tip
Add unit test for accounts task.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 30 Jan 2025 18:46:03 -0600 |
parents | f7554fb88727 |
children |
line wrap: on
line source
{% extends 'v3/base.html' %} {% load static from staticfiles %} {% block title %}Polls: {{ poll.question }}{% endblock %} {% block content %} <nav aria-label="You are here:" role="navigation"> <ul class="breadcrumbs"> <li><a href="{% url 'polls-main' %}">Polls</a></li> <li><a href="{{ poll.get_absolute_url }}">{{ poll.question }}</a></li> <li>Vote</li> </ul> </nav> <h2>{{ poll.question }}</h2> {% if user_choice %} <div class="warning callout"> You previously voted for "{{ user_choice.choice }}". </div> <form action="{% url 'polls-delete_vote' %}" method="post">{% csrf_token %} <input type="hidden" name="poll_id" value="{{ poll.id }}" /> <input type="submit" value="Delete My Vote!" class="alert button" /> </form> {% else %} <form action="." method="post">{% csrf_token %} {% if vote_form.non_field_errors %} {{ form.non_field_errors }} {% endif %} {% if vote_form.choices.errors %} {{ vote_form.choices.errors }} {% endif %} <ul class="no-bullet"> {% for field in vote_form.choices %} <li>{{ field }}</li> {% endfor %} </ul> <input type="submit" value="Cast My Vote!" class="primary button" /> </form> {% endif %} {% endblock %}