aboutsummaryrefslogtreecommitdiffstats
path: root/templates/poll.html.j2
blob: e0ede1f3260d0d0b25bc602abbe9343d8f16e34c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{% extends "base.html.j2" %}

{% block content %}

<h2><span class="contrast">{{ poll.title }}</span> by <i>{{ poll.author_name }}</i></h2>
{% if poll.description %}
  <p>{{ poll.description }}</p>
{% endif %}

{% if poll.choices | length  == 0 %}
<p>No options available.</p>
{% else %}

<div class="display-mode-section">
  <form action="/options/toggle_display_mode" method="post">
    <input type="hidden" name="poll_id" value="{{ poll.id }}">
    <label>
      Display mode: <strong>{{ display_mode }}</strong>
      <input type="submit" value="Toggle">
    </label>
  </form>
</div>

<form action="/poll/{{ poll.id }}/vote" method="post">
  {% if display_mode == "table" %}
  {% include "poll_vote_table.html.j2" %}
  {% else %}
  {% include "poll_vote_list.html.j2" %}
  {% endif %}
</form>
{% endif %}


{% endblock %}