view sg101/templates/polls/poll_vote.html @ 1201:fe10aea76cbd tip

Add 2023 MP3 compilation links
author Brian Neal <bgneal@gmail.com>
date Sun, 24 Mar 2024 14:50:23 -0500
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 &quot;{{ user_choice.choice }}&quot;.
   </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 %}