blob: cfa336ae7b9e6d5686fcb51e347ddc4c8bbc6427 (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
<table class="vote-table">
<tr>
<th></th>
{% for choice in choices %}
<th>
{{ 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>—</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>
<i>{{ choice.votes | length }} votes</i>
</span>
</th>
{% endfor %}
</tr>
{% for voter_name in voter_names %}
<tr>
<td>{{ voter_name }}</td>
{% for choice in choices %}
{% if selections[(voter_name, choice.id)] == 1 %}
<td>
<input type="checkbox" checked disabled>
</td>
{% elif selections[(voter_name, choice.id)] == 0 %}
<td>
<input type="checkbox" disabled>
</td>
{% else %}
<td>
??
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
<!-- Add a row for the current user -->
<tr>
<td>
<label for="voter_name" hidden>Your name</label>
<input type="text" name="voter_name" placeholder="Your name" required>
</td>
{% for choice in choices %}
<td>
<input type="checkbox" name="choice_{{ choice.id }}">
</td>
{% endfor %}
</tr>
<!-- End of the row for the current user -->
</table>
<input class="green" type="submit" value="Submit">
|