{% extends "base.html" %} {% load i18n %} {% block content %}
{# Titre de l'élection #}

{{ election.name }}

{# Dates d'ouverture de l'élection #}
{{ election.start_date|date:"d/m/Y H:i" }} {{ election.end_date|date:"d/m/Y H:i" }}
{% if election.start_date > current_time or election.end_date < current_time %}
{% endif %}

{# Description de l'élection #}
{{ election.description|linebreaksbr }}
{# Liste des questions #} {% for q in election.questions.all %}
{{ q.text }} {% if election.start_date > current_time %} {% trans "Supprimer" %} {% trans "Modifier" %} {% endif %} {{ q.get_type_display }}
{# Liste des options possibles #} {% for o in q.options.all %}
{% if election.tallied %} {% if q.vote_type == "select" %} {{ o.nb_votes }} {% elif q.vote_type == "rank" %} {{ forloop.counter }} {% endif %} {% endif %} {{ o.text }}
{% endfor %} {# Affiche plus d'informations sur le résultat #} {% if election.tallied %} {{ q.get_results_data }} {% endif %} {# Rajout d'une option #} {% if election.start_date > current_time %}
{% csrf_token %}
{% endif %}
{% endfor %} {# Rajout d'une question #} {% if election.start_date > current_time %}
{% csrf_token %}
{% endif %} {% endblock %}