{% extends "core/base.jinja" %} {% block title %} {{ object.title }} {% endblock %} {% block additional_js %} {% endblock %} {% block additional_css %} {% endblock %} {% block content %}

{{ election.title }}

{% if not user.has_perm("core.view_user") %}
{% trans %}Candidate pictures won't display for privacy reasons.{% endtrans %}
{% endif %}

{{ 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.is_vote_finished and user.can_edit(election) %}
{% trans %}Apply election result{% endtrans %}
{% endif %} {%- if user_has_voted %}

{%- 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 %} {%- for election_list in election_lists %} {%- endfor %} {%- for role in election_roles %} {%- set role_data = election_form.data.getlist(role.title) if role.title in election_form.data else [] %} 1 -%} x-data x-limited-choices="{{ role.max_choice }}" {%- endif %} class="role {% if role.title in election_form.errors %}role_error{% endif %}" > {%- for election_list in election_lists %} {%- endfor %} {%- endfor %}
{% trans %}Blank vote{% endtrans %} {{ election_list.title }} {% if user.can_edit(election_list) and election.is_vote_editable -%} {% endif %}

{{ role.title }}

{{ role.description }}

{%- if role.max_choice > 1 and show_vote_buttons %} {% trans trimmed nb_choices=role.max_choice %} You may choose up to {{ nb_choices }} 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 user.can_edit(role) and election.is_vote_editable -%}
{%- if loop.last -%} {%- else -%} {%- endif -%} {%- if loop.first -%} {%- else -%} {%- endif -%}
{%- endif -%}
{%- if role.max_choice == 1 and show_vote_buttons %}
{% set input_id = "blank_vote_" + role.id|string %}
{%- endif %} {%- if election.is_vote_finished %} {%- set results = election_results[role.title]['blank vote'] %}
{{ results.vote }} {% trans %}votes{% endtrans %} ({{ "%.2f" % results.percent }} %)
{%- endif %}
    {%- for candidature in election_list.candidatures.select_related("user", "user__profile_pict").filter(role=role) %}
  • {%- if show_vote_buttons %} {% set input_id = "candidature_" + candidature.id|string %} {%- endif %} {%- if election.is_vote_finished %} {%- set results = election_results[role.title][candidature.user.username] %}
    {{ results.vote }} {% trans %}votes{% endtrans %} ({{ "%.2f" % results.percent }} %)
    {%- endif %}
  • {%- endfor %}
{% if not user.is_anonymous %}
{%- if (election.can_candidate(user) and election.is_candidature_active) or (user.can_edit(election) and election.is_vote_editable) %} {% trans %}Candidate{% endtrans %} {%- endif %} {%- if election.is_vote_editable %} {% trans %}Add a new list{% endtrans %} {%- endif %} {%- if user.can_edit(election) %} {% if election.is_vote_editable %} {% trans %}Add a new role{% endtrans %} {% endif %} {% trans %}Edit{% endtrans %} {%- endif %} {%- if user.is_root %} {% trans %}Delete{% endtrans %} {%- endif %}
{%- if show_vote_buttons %}
{%- endif %} {% endif %} {% endblock %}