election_detail.jinja 1.58 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>
14
	{% if object.election_list.exists() %}
Sli's avatar
Sli committed
15
16
	<table>
		<tr>
Sli's avatar
Sli committed
17
18
		{% set nb_list = object.election_list.all().count() + 1 -%}
		{% for liste in object.election_list.all() %}
Sli's avatar
Sli committed
19
			<td>{{liste.title}}</td>
20
21
22
			{% if object.is_candidature_active -%}
			{% set nb_list = nb_list -%}
			{% else -%}
Sli's avatar
Sli committed
23
			{% set nb_list = nb_list + 1 -%}
24
			{% endif -%}
Sli's avatar
Sli committed
25
		{% endfor %}
26
		{% if not object.is_candidature_active -%}
Sli's avatar
Sli committed
27
		<td>{% trans %}Blank vote{% endtrans %}</td>
28
		{% endif %}
Sli's avatar
Sli committed
29
30
31
32
		</tr>
	{% for role in object.role.all() %}
		<tr><td colspan={{nb_list}}>{{role.title}}</td></tr>
		<tr>
Sli's avatar
Sli committed
33
			{% for liste in object.election_list.all() %}
Sli's avatar
Sli committed
34
35
			<td>
				<ul>
Sli's avatar
Sli committed
36
				{% for candidature in role.candidature.filter(election_list=liste) %}
Sli's avatar
Sli committed
37
38
39
				<li>
					{{candidature.user.first_name}} {{candidature.user.last_name}} {{candidature.user.nick_name or ''}}
					{% if candidature.user.profile_pict %}
Sli's avatar
Sli committed
40
					<br>
Sli's avatar
Sli committed
41
42
						<img src="{{candidature.user.profile_pict.get_download_url()}}" alt="{% trans %}Profile{% endtrans %}">
					{% endif %}
Sli's avatar
Sli committed
43
44
					<br>
					{{candidature.program or ''}}
Sli's avatar
Sli committed
45
46
47
48
49
				</li>
				{% endfor %}
				</ul>
			</td>
			{% endfor %}
50
			{% if not object.is_candidature_active -%}
Sli's avatar
Sli committed
51
			<td></td>
52
			{% endif %}
Sli's avatar
Sli committed
53
		</tr>
Sli's avatar
Sli committed
54
	{% endfor %}
Sli's avatar
Sli committed
55
	</table>
56
57
58
59
	{% endif %}
	{% if object.is_candidature_active -%}
		candidature
	{% endif -%}
Sli's avatar
Sli committed
60
{% endblock %}