election_detail.jinja 1.24 KB
Newer Older
Sli's avatar
Sli committed
1
2
3
4
5
6
7
8
9
10
11
12
13
{% extends "core/base.jinja" %}

{% block title %}
{% trans %}Election list{% endtrans %}
{% endblock %}

{% block content %}
	{% if object.has_voted(request.user) %}
		A voté
	{% endif %}
	<h1>{{object.title}}</h1>
	<p>{{object.description}}</p>
	<p>{% trans %}End :{% endtrans %} {{object.end_date}}</p>
Sli's avatar
Sli committed
14
15
	<table>
		<tr>
Sli's avatar
Sli committed
16
17
		{% set nb_list = object.election_list.all().count() + 1 -%}
		{% for liste in object.election_list.all() %}
Sli's avatar
Sli committed
18
19
			<td>{{liste.title}}</td>
			{% set nb_list = nb_list + 1 -%}
Sli's avatar
Sli committed
20
		{% endfor %}
Sli's avatar
Sli committed
21
22
23
24
25
		<td>{% trans %}Blank vote{% endtrans %}</td>
		</tr>
	{% for role in object.role.all() %}
		<tr><td colspan={{nb_list}}>{{role.title}}</td></tr>
		<tr>
Sli's avatar
Sli committed
26
			{% for liste in object.election_list.all() %}
Sli's avatar
Sli committed
27
28
			<td>
				<ul>
Sli's avatar
Sli committed
29
				{% for candidature in role.candidature.filter(election_list=liste) %}
Sli's avatar
Sli committed
30
31
32
				<li>
					{{candidature.user.first_name}} {{candidature.user.last_name}} {{candidature.user.nick_name or ''}}
					{% if candidature.user.profile_pict %}
Sli's avatar
Sli committed
33
					<br>
Sli's avatar
Sli committed
34
35
						<img src="{{candidature.user.profile_pict.get_download_url()}}" alt="{% trans %}Profile{% endtrans %}">
					{% endif %}
Sli's avatar
Sli committed
36
37
					<br>
					{{candidature.program or ''}}
Sli's avatar
Sli committed
38
39
40
41
42
43
44
				</li>
				{% endfor %}
				</ul>
			</td>
			{% endfor %}
			<td></td>
		</tr>
Sli's avatar
Sli committed
45
	{% endfor %}
Sli's avatar
Sli committed
46
	</table>
Sli's avatar
Sli committed
47
{% endblock %}