{% extends "core/base.jinja" %} {% block title %} {{ object.title }} {% endblock %} {% block head %} {{ super() -}} {%- endblock %} {% block content %}

{{ election.title }}

{{ election.description }}


{%- if election.is_vote_active %} {% trans %}Polls close {% endtrans %} {%- elif election.is_vote_finished %} {% trans %}Polls closed {% endtrans %} {%- else %} {% trans %}Polls will open {% endtrans %} {% trans %} at {% endtrans %} {% trans %}and will close {% endtrans %} {%- endif %} {% trans %} at {% endtrans %}

{%- if election.has_voted(user) %}

{%- if election.is_vote_active %} {% trans %}You already have submitted your vote.{% endtrans %} {%- else %} {% trans %}You have voted in this election.{% endtrans %} {%- endif %}

{%- endif %}
{% csrf_token %} {%- set election_lists = election.election_lists.all() -%} {%- for election_list in election_lists %} {%- endfor %} {%- for role in election.roles.all() %} {%- set count = [0] %} {%- set role_data = election_form.data.getlist(role.title) if role.title in election_form.data else [] %} {%- for election_list in election_lists %} {%- endfor %} {%- endfor %}
{% trans %}Blank vote{% endtrans %}{{ election_list.title }}
{{ role.title }} {% if user.can_edit(role) and election.is_vote_editable -%} {% trans %}Edit{% endtrans %} {% trans %}Delete{% endtrans %} {%- endif -%} {%- if role.max_choice > 1 and not election.has_voted(user) and election.can_vote(user) %} {% trans %}You may choose up to{% endtrans %} {{ role.max_choice }} {% trans %}people.{% endtrans %} {%- endif %} {%- if election_form.errors[role.title] is defined %} {%- for error in election_form.errors.as_data()[role.title] %} {{ error.message }} {%- endfor %} {%- endif %}
{%- if role.max_choice == 1 and election.can_vote(user) %} {%- set _ = count.append(count.pop() + 1) %} {%- endif %} {%- if election.is_vote_finished %} {%- set results = election_results[role.title]['blank vote'] %}
{{ results.vote }} {% trans %}votes{% endtrans %} ({{ results.percent }} %)
{%- endif %}
    {%- for candidature in election_list.candidatures.filter(role=role) %}
  • {%- if candidature.user.profile_pict and user.is_subscriber_viewable %} {% trans %}Profile{% endtrans %} {%- endif %}
    {{ candidature.user.first_name }} {{candidature.user.nick_name or ''}} {{ candidature.user.last_name }} {{ candidature.program or '' }} {%- if user.can_edit(candidature) -%} {% if election.is_vote_editable %} {% trans %}Edit{% endtrans %} {% endif %} {% if election.can_candidate -%} {% trans %}Delete{% endtrans %} {%- endif -%} {%- endif -%}
    {%- if election.can_vote(user) %} {%- set _ = count.append(count.pop() + 1) %} {%- endif %} {%- if election.is_vote_finished %} {%- set results = election_results[role.title][candidature.user.username] %}
    {{ results.vote }} {% trans %}votes{% endtrans %} ({{ results.percent }} %)
    {%- endif %}
  • {%- endfor %}
{%- if not election.has_voted(user) and election.can_vote(user) %}
{%- endif %}
{%- if (election.can_candidate(user) and election.is_candidature_active) or (user.can_edit(election) and election.is_vote_editable) %} {% trans %}Candidate{% endtrans %} {%- endif %} {% trans %}Add a new list{% endtrans %} {%- if user.can_edit(election) %} {% if election.is_vote_editable %} {% trans %}Add a new role{% endtrans %} {% endif %} {% trans %}Edit{% endtrans %} {%- endif %}
{% endblock %} {% block script %} {{ super() }} {% endblock %}