aboutsummaryrefslogtreecommitdiffstats
path: root/templates/poll_vote_list.html.j2
blob: 9d3a15c7ad0ea7e941f809b16c61006f30c6d822 (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
<div class="vote-list">
  {% for choice in choices %}
  <div>
    <label for="choice_{{ choice.id }}">
      <input type="checkbox" name="choice_{{ choice.id }}" id="choice_{{ choice.id }}">
      <strong>
        {% include "poll_choice_datetime_range.html.j2" %}
      </strong>
      <span>
        <i>{{ choice.votes_with_value(1) | length }}&nbsp;votes</i>
      </span>
      <div>
        {% if choice.votes_with_value(1) | length != 0 %}
        Voted by: {% for vote in choice.votes_with_value(1) %}
        {{ vote.voter_name }}{% if not loop.last %}, {% endif %}
        {% endfor %}
        {% endif %}
      </div>
    </label>
  </div>
  <p></p>
  {% endfor %}
</div>

<div>
  <label for="voter_name" hidden>Your name</label>
  <input type="text" name="voter_name" placeholder="Your name" required>
  <input class="green" type="submit" value="Submit">
</div>