kadenios/elections/templates/elections/election_list.html

69 lines
1.9 KiB
HTML

{% extends "base.html" %}
{% load i18n %}
{% block content %}
<div class="level">
<div class="level-left">
<div class="level-item">
<h1 class="title">{% trans "Liste des élections" %}</h1>
</div>
</div>
{% if perms.elections.is_admin %}
<div class="level-right">
<div class="level-item">
<a class="button is-light is-outlined is-primary" href={% url 'election.create' %}>
<span class="icon">
<i class="fas fa-plus"></i>
</span>
<span>{% trans "Créer une élection" %}</span>
</a>
</div>
</div>
{% endif %}
</div>
<hr>
{% for e in election_list %}
<div class="message is-primary">
<div class="message-header is-size-6 is-radiusless">
<div>
<a href="{% url 'election.view' e.pk %}">{{ e.name }}</a>
<span class="tag is-primary is-light ml-3">{{ e.start_date|date:"d/m/Y H:i" }}</span>
<span class="icon has-text-primary-light">
<i class="fas fa-long-arrow-alt-right"></i>
</span>
<span class="tag is-primary is-light">{{ e.end_date|date:"d/m/Y H:i" }}</span>
</div>
<div>
{% if e.tallied %}
<span class="tag is-success is-light ml-3">{% trans "Élection dépouillée" %}</span>
{% endif %}
{% if e.results_public %}
<span class="tag is-info is-light ml-3">{% trans "Élection publiée" %}</span>
{% endif %}
{% if e.archived %}
<span class="tag is-danger is-light ml-3">{% trans "Élection archivée" %}</span>
{% endif %}
{% if e.created_by == user %}
<a class="has-text-primary-light ml-3 has-tooltip-light" href="{% url 'election.admin' e.pk %}" data-tooltip="{% trans "Administrer" %}">
<span class="icon">
<i class="fas fa-cog"></i>
</span>
</a>
{% endif %}
</div>
</div>
<p class="message-body">
{{ e.description|linebreaksbr }}
</p>
</div>
{% endfor %}
{% endblock %}