From 9dbff0cd5028e474e55803908a6ac7a287e58dbb Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lenglet Date: Thu, 22 Dec 2016 00:16:48 +0100 Subject: [PATCH] Finished election details. --- .../templates/election/election_detail.jinja | 252 ++++++++++++------ 1 file changed, 176 insertions(+), 76 deletions(-) diff --git a/election/templates/election/election_detail.jinja b/election/templates/election/election_detail.jinja index 6379072d..53cca0d4 100644 --- a/election/templates/election/election_detail.jinja +++ b/election/templates/election/election_detail.jinja @@ -8,46 +8,172 @@ {{ super() -}} {%- endblock %} {% block content %} -

{{ object.title }}

+

{{ object.title }}

+

{{ object.description }}


-

- {% trans %}Polls close {% endtrans %} - at -

+

+ {% trans %}Polls close {% endtrans %} + at +

+ {%- if object.has_voted(request.user) %} +

+ {% trans %}You already have submitted your vote.{% endtrans %} +

+ {%- endif %}
@@ -57,89 +183,63 @@ th { {%- for election_list in election_lists %} {%- endfor %} + {%- for role in object.role.all() %} - - + + + + {%- for election_list in election_lists %} {%- endfor %} + {%- endfor %}
{{election_list.title}}{% trans %}Blank vote{% endtrans %}
{{role.title}}
+ {{role.title}} + {%- if role.max_choice > 1 %} + {% trans %}You may choose up to{% endtrans %} {{ role.max_choice }} {% trans %}people.{% endtrans %} + {%- endif %} +
    {%- for candidature in election_list.candidature.filter(role=role) %} -
  • +
  • - {%- if candidature.user.profile_pict %} - {% trans %}Profile{% endtrans %} - {%- endif %} -
    - {{ candidature.user.first_name }} {{candidature.user.nick_name or ''}} {{ candidature.user.last_name }} - {{ candidature.program or '' }} +
    + {%- if candidature.user.profile_pict %} + {% trans %}Profile{% endtrans %} + {%- endif %} +
    +
    + {{ candidature.user.first_name }} {{candidature.user.nick_name or ''}} {{ candidature.user.last_name }} + {{ candidature.program or '' }}
    + {%- if object.is_active %} + + + {% endif %}
  • {%- endfor %}
+ {%- if object.is_active %} + + + {% endif %} +
- - {% if object.has_voted(request.user) %} - A voté - {% endif %} -

{{object.title}}

-

{{object.description}}

-

{% trans %}End :{% endtrans %} {{object.end_date}}

- {% if object.election_list.exists() %} - - - {% set nb_list = object.election_list.all().count() + 1 -%} - {% for liste in object.election_list.all() %} - - {% if object.is_candidature_active -%} - {% set nb_list = nb_list -%} - {% else -%} - {% set nb_list = nb_list + 1 -%} - {% endif -%} - {% endfor %} - {% if not object.is_candidature_active -%} - - {% endif %} - - {% for role in object.role.all() %} - - - {% for liste in object.election_list.all() %} - - {% endfor %} - {% if not object.is_candidature_active -%} - - {% endif %} - - {% endfor %} -
{{liste.title}}{% trans %}Blank vote{% endtrans %}
{{role.title}}
-
    - {% for candidature in role.candidature.filter(election_list=liste) %} -
  • - {{candidature.user.first_name}} {{candidature.user.last_name}} {{candidature.user.nick_name or ''}} - {% if candidature.user.profile_pict %} -
    - {% trans %}Profile{% endtrans %} - {% endif %} -
    - {{candidature.program or ''}} -
  • - {% endfor %} -
-
- {% endif %} +
+ +
{{candidate_form}} {% csrf_token %}
- {% if object.is_candidature_active -%} - candidature - {% endif -%} {% endblock %} \ No newline at end of file