aboutsummaryrefslogtreecommitdiffstats
path: root/templates/poll_vote_list.html.j2
blob: c18b3e021b6de8ef0896a1c34905223fd6a32d0f (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
35
36
37
38
39
40
41
42
43
44
45
46
47
<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>
        {{ choice.start_datetime.strftime("%a %d.%m") }}
        <span>
          {% if now.year != choice.start_datetime.year %}.{{choice.start_datetime.year}}{% endif %}
        </span>
        <span>
          {{ choice.start_datetime.strftime("%H:%M") }}
        </span>
        <span>&mdash;</span>
        {% if not choice.ends_on_same_day() %}
        <span>
          {{ choice.end_datetime.strftime("%a %d.%m") }}
        </span>
        <span>
          {% if now.year != choice.end_datetime.year %}.{{choice.end_datetime.year}}{% endif %}
        </span>
        {% endif %}
        <span>
        {{ choice.end_datetime.strftime("%H:%M") }}
        </span>
        </span>
      </strong>
      <span>
        <i>{{ choice.votes | length }} votes</i>
      </span>
      <div>
        {% if choice.votes | length != 0 %}
        Voted by: {% for vote in choice.votes %}{{ 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>