View un-voted-in polls; can't vote in them just yet.

This commit is contained in:
Jason McBrayer 2019-07-09 20:26:52 -04:00
parent 83f46babe5
commit a5a67ccb54
2 changed files with 24 additions and 0 deletions

View File

@ -59,6 +59,7 @@
{% include "polls/completed_partial.html" with toot=toot %}
{% else %}
<!-- Poll form -->
{% include "polls/new_partial.html" with toot=toot %}
{% endif %}
</div>
{% endif %}

View File

@ -0,0 +1,23 @@
{% load sanitizer %}
{% load taglinks %}
{% load static %}
<form method="POST" action="/vote/{{ toot.poll.id }}">
{% for option in toot.poll.options %}
<div class="field">
{% if toot.poll.multiple %}
<input type="checkbox" id="poll-{{ toot.poll.id }}-{{ forloop.counter0 }}"
class="checkbox" >
{% else %}
<input type="radio" id="poll-{{ toot.poll.id }}-{{ forloop.counter0 }}"
name="poll-{{ toot.poll.id }}">
{% endif %}
<label for="poll-{{ toot.poll.id }}-{{ forloop.counter0 }}">
{{ option.title }}
</label>
</div>
{% endfor %}
<input type="submit" class="button is-primary" name="Vote" value="Vote">
</form>