90 lines
2.7 KiB
HTML
90 lines
2.7 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n %}
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="level">
|
|
<div class="level-left">
|
|
{# Titre de l'élection #}
|
|
<div class="level-item">
|
|
<h1 class="title">{{ election.name }}</h1>
|
|
</div>
|
|
|
|
{# Dates d'ouverture de l'élection #}
|
|
<div class="level-item">
|
|
<span class="tag is-medium is-primary">{{ election.start_date|date:"d/m/Y H:i" }}</span>
|
|
<span class="icon">
|
|
<i class="fas fa-long-arrow-alt-right"></i>
|
|
</span>
|
|
<span class="tag is-medium is-primary">{{ election.end_date|date:"d/m/Y H:i" }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
{% if election.start_date < current_time %}
|
|
<div class="level-right">
|
|
<div class="level-item">
|
|
<span class="tag is-medium is-outlined is-light is-primary">
|
|
{% if election.end_date < current_time %}
|
|
{% trans "Élection terminée" %}
|
|
{% else %}
|
|
{% trans "Élection en cours" %}
|
|
{% endif %}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<hr>
|
|
|
|
{# Indications de connexion #}
|
|
{% if election.start_date < current_time and election.end_date > current_time %}
|
|
<div class="message is-warning">
|
|
<div class="message-body">
|
|
{% if election.restricted %}
|
|
{% trans "Pour voter lors de cette élection, vous devez vous connecter à l'aide des identifiants reçus par mail." %}
|
|
{% else %}
|
|
{% trans "Pour voter lors de cette élection, vous devez vous connecter à l'aide du CAS élève, d'autres restrictions peuvent s'appliquer et votre vote pourra être supprimé si vous n'avez pas le droit de vote." %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{# Description de l'élection #}
|
|
<div class="message is-primary">
|
|
<div class="message-body">{{ election.description|linebreaksbr }}</div>
|
|
</div>
|
|
|
|
{# Liste des questions #}
|
|
{% for q in election.questions.all %}
|
|
<div class="panel" id="q_{{ q.pk }}">
|
|
<div class="panel-heading is-size-6">
|
|
{% if can_vote and election.start_date < current_time and election.end_date > current_time %}
|
|
<a class="tag is-small is-outlined is-light is-danger" href="{% url 'election.vote' q.pk %}">
|
|
<span class="icon">
|
|
<i class="fas fa-vote-yea"></i>
|
|
</span>
|
|
<span>{% trans "Voter" %}</span>
|
|
</a>
|
|
{% endif %}
|
|
<span class="ml-2">{{ q.text }}</span>
|
|
</div>
|
|
|
|
{# Liste des options possibles #}
|
|
{% for o in q.options.all %}
|
|
<div class="panel-block">
|
|
{% if election.tallied and election.results_public %}
|
|
<span class="tag {% if o.nb_votes == q.max_votes %}is-success{% else %}is-primary{% endif %}">
|
|
<span class="icon">
|
|
<i class="fas fa-vote-yea"></i>
|
|
</span>
|
|
<span>{{ o.nb_votes }}</span>
|
|
</span>
|
|
{% endif %}
|
|
<span class="ml-2">{{ o.text }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
|
|
{% endblock %}
|