Template updates

This commit is contained in:
Tom Hubrecht 2021-08-23 10:52:17 +02:00
parent 7bb98f9cd8
commit 9474fcd1d7
8 changed files with 49 additions and 91 deletions

View file

@ -2,37 +2,33 @@
<div class="panel" id="q_{{ q.pk }}">
<div class="panel-heading is-size-6">
<div class="level">
<div class="level-left is-flex-shrink-1">
<div class="level-item is-flex-shrink-1">
<span class="icon-text">
<span class="icon">
<i class="fas fa-poll-h"></i>
</span>
<span>{{ q }}</span>
<div class="level is-mobile">
<div class="level-left is-flex-shrink-1 mr-2">
<span class="mr-2">
<span class="icon">
<i class="fas fa-poll-h"></i>
</span>
</div>
<span>{{ q }}</span>
</span>
{% if q.election.start_date > current_time %}
<div class="level-item">
<a class="tag is-outlined is-light is-danger del" data-url="{% url 'election.del-question' q.pk %}" data-target="q_{{ q.pk }}">
<span class="icon-text">
<span class="icon">
<i class="fas fa-times"></i>
</span>
<span>{% trans "Supprimer" %}</span>
<a class="tag is-outlined is-light is-danger del" data-url="{% url 'election.del-question' q.pk %}" data-target="q_{{ q.pk }}">
<span class="icon-text">
<span class="icon">
<i class="fas fa-times"></i>
</span>
</a>
<span>{% trans "Supprimer" %}</span>
</span>
</a>
<a class="tag is-outlined is-light is-info ml-1 modal-button" data-post_url="{% url 'election.mod-question' q.pk %}" data-target="modal-question" data-q_type="{{ q.type }}" data-q_en="{{ q.text_en }}" data-q_fr="{{ q.text_fr }}" data-title="{% trans "Modifier la question" %}" data-type="question" data-parent="q_{{ q.pk }}">
<span class="icon-text">
<span class="icon">
<i class="fas fa-edit"></i>
</span>
<span>{% trans "Modifier" %}</span>
<a class="tag is-outlined is-light is-info ml-1 modal-button" data-post_url="{% url 'election.mod-question' q.pk %}" data-target="modal-question" data-q_type="{{ q.type }}" data-q_en="{{ q.text_en }}" data-q_fr="{{ q.text_fr }}" data-title="{% trans "Modifier la question" %}" data-type="question" data-parent="q_{{ q.pk }}">
<span class="icon-text">
<span class="icon">
<i class="fas fa-edit"></i>
</span>
</a>
</div>
<span>{% trans "Modifier" %}</span>
</span>
</a>
{% endif %}
</div>

View file

@ -201,9 +201,9 @@
{% for q in election.questions.all %}
<div class="panel" id="q_{{ q.pk }}">
<div class="panel-heading is-size-6">
<div class="level">
<div class="level is-mobile">
<div class="level-left is-flex-shrink-1">
<span class="icon-text">
<span class="mr-3">
<span class="icon">
<i class="fas fa-poll-h"></i>
</span>

View file

@ -1,19 +0,0 @@
{% extends "base.html" %}
{% load i18n static string %}
{% block content %}
{% for error in form.non_field_errors %}
<div class="notification is-danger">
{{ error }}
</div>
{% endfor %}
<h1 class="title">{% trans "Modification d'une option" %}</h1>
<hr>
{% url 'election.admin' option.question.election.pk as r_url %}
{% include "forms/common-form.html" with anchor=o_|concatenate:option.pk %}
{% endblock %}

View file

@ -1,19 +0,0 @@
{% extends "base.html" %}
{% load i18n static string %}
{% block content %}
{% for error in form.non_field_errors %}
<div class="notification is-danger">
{{ error }}
</div>
{% endfor %}
<h1 class="title">{% trans "Modification d'une question" %}</h1>
<hr>
{% url 'election.admin' question.election.pk as r_url %}
{% include "forms/common-form.html" with errors=False r_anchor="q_"|concatenate:question.pk %}
{% endblock %}

View file

@ -124,7 +124,7 @@ class ElectionUploadVotersView(CreatorOnlyEditMixin, SuccessMessageMixin, FormVi
model = Election
form_class = UploadVotersForm
success_message = _("Liste de votant·e·s importée avec succès !")
template_name = "elections/upload_voters.html"
template_name = "elections/election_upload_voters.html"
def get_queryset(self):
# On ne peut ajouter une liste d'électeurs que sur une élection restreinte
@ -158,7 +158,7 @@ class ElectionMailVotersView(CreatorOnlyEditMixin, SuccessMessageMixin, FormView
model = Election
form_class = VoterMailForm
success_message = _("Mail d'annonce en cours d'envoi !")
template_name = "elections/mail_voters.html"
template_name = "elections/election_mail_voters.html"
def get_queryset(self):
# On ne peut envoyer un mail que sur une élection restreinte qui n'a pas

View file

@ -7,32 +7,32 @@
<h1 class="title">{% trans "Gestion de Kadenios" %}</h1>
<hr>
<div class="tile is-ancestor">
<div class="tile is-parent">
<a class="tile is-child notification is-light" href="{% url 'auth.create-account' %}">
<div class="subtitle has-text-centered">
<span class="icon-text">
<span class="icon">
<i class="fas fa-user-plus"></i>
</span>
<span class="ml-3">{% trans "Créer un nouveau compte" %}</span>
</span>
</div>
</a>
<div class="tile is-ancestor">
<div class="tile is-parent">
<a class="tile is-child notification is-light px-0" href="{% url 'auth.create-account' %}">
<div class="subtitle has-text-centered">
<span class="icon-text">
<span class="icon">
<i class="fas fa-user-plus"></i>
</span>
<span class="ml-3">{% trans "Créer un nouveau compte" %}</span>
</span>
</div>
</a>
</div>
<div class="tile is-parent">
<a class="tile is-child notification is-light" href="{% url 'auth.accounts' %}">
<div class="subtitle has-text-centered">
<span class="icon-text">
<span class="icon">
<i class="fas fa-stream"></i>
</span>
<span class="ml-3">{% trans "Liste des comptes" %}</span>
</span>
</div>
</a>
<div class="tile is-parent">
<a class="tile is-child notification is-light px-0" href="{% url 'auth.accounts' %}">
<div class="subtitle has-text-centered">
<span class="icon-text">
<span class="icon">
<i class="fas fa-stream"></i>
</span>
<span class="ml-3">{% trans "Liste des comptes" %}</span>
</span>
</div>
</div>
</a>
</div>
</div>
{% endblock %}