140 lines
4.4 KiB
HTML
140 lines
4.4 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 %}
|
|
{% if can_vote %}
|
|
<div class="columns is-centered tile is-ancestor">
|
|
<div class="column is-one-third tile is-parent">
|
|
<a class="tile is-child notification is-primary" href="{% url 'election.vote' election.questions.first.pk %}">
|
|
<div class="subtitle has-text-centered">
|
|
<span class="icon has-text-white">
|
|
<i class="fas fa-vote-yea"></i>
|
|
</span>
|
|
<span class="ml-3">{% trans "Voter" %}</span>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
|
|
<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>
|
|
|
|
<div class="columns is-centered">
|
|
<div class="column is-half">
|
|
<div class="tile is-ancestor">
|
|
<div class="tile is-parent">
|
|
{% if election.restricted %}
|
|
<a class="tile is-child notification is-primary" href="{% url 'auth.election' election.pk %}?next={% url 'election.view' election.pk %}">
|
|
<div class="subtitle has-text-centered mb-2">
|
|
<span class="icon has-text-white">
|
|
<i class="fas fa-unlock"></i>
|
|
</span>
|
|
<span class="ml-3">{% trans "Connexion par identifiants" %}</span>
|
|
</div>
|
|
</a>
|
|
{% else %}
|
|
<a class="tile is-child notification is-primary" href="{% url 'authens:login.cas' %}">
|
|
<div class="subtitle has-text-centered mb-2">
|
|
<span class="icon has-text-white">
|
|
<i class="fas fa-school"></i>
|
|
</span>
|
|
<span class="ml-3">{% trans "Connexion via CAS" %}</span>
|
|
</div>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% 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">
|
|
{% comment %}
|
|
{% if can_vote and election.start_date < current_time and election.end_date > current_time %}
|
|
<a class="tag 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 %}
|
|
{% endcomment %}
|
|
<span class="ml-2">{{ q.text }}</span>
|
|
|
|
{% if q in cast_questions %}
|
|
<span class="tag is-outlined is-light is-success is-pulled-right">{% trans "A voté" %}</span>
|
|
{% endif %}
|
|
</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 %}
|