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" id="q_{{ q.pk }}">
<div class="panel-heading is-size-6"> <div class="panel-heading is-size-6">
<div class="level"> <div class="level is-mobile">
<div class="level-left is-flex-shrink-1"> <div class="level-left is-flex-shrink-1 mr-2">
<div class="level-item is-flex-shrink-1"> <span class="mr-2">
<span class="icon-text"> <span class="icon">
<span class="icon"> <i class="fas fa-poll-h"></i>
<i class="fas fa-poll-h"></i>
</span>
<span>{{ q }}</span>
</span> </span>
</div> <span>{{ q }}</span>
</span>
{% if q.election.start_date > current_time %} {% 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 }}">
<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-text"> <span class="icon">
<span class="icon"> <i class="fas fa-times"></i>
<i class="fas fa-times"></i>
</span>
<span>{% trans "Supprimer" %}</span>
</span> </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 }}"> <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-text">
<span class="icon"> <span class="icon">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</span>
<span>{% trans "Modifier" %}</span>
</span> </span>
</a> <span>{% trans "Modifier" %}</span>
</div> </span>
</a>
{% endif %} {% endif %}
</div> </div>

View file

@ -201,9 +201,9 @@
{% for q in election.questions.all %} {% for q in election.questions.all %}
<div class="panel" id="q_{{ q.pk }}"> <div class="panel" id="q_{{ q.pk }}">
<div class="panel-heading is-size-6"> <div class="panel-heading is-size-6">
<div class="level"> <div class="level is-mobile">
<div class="level-left is-flex-shrink-1"> <div class="level-left is-flex-shrink-1">
<span class="icon-text"> <span class="mr-3">
<span class="icon"> <span class="icon">
<i class="fas fa-poll-h"></i> <i class="fas fa-poll-h"></i>
</span> </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 model = Election
form_class = UploadVotersForm form_class = UploadVotersForm
success_message = _("Liste de votant·e·s importée avec succès !") 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): def get_queryset(self):
# On ne peut ajouter une liste d'électeurs que sur une élection restreinte # On ne peut ajouter une liste d'électeurs que sur une élection restreinte
@ -158,7 +158,7 @@ class ElectionMailVotersView(CreatorOnlyEditMixin, SuccessMessageMixin, FormView
model = Election model = Election
form_class = VoterMailForm form_class = VoterMailForm
success_message = _("Mail d'annonce en cours d'envoi !") 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): def get_queryset(self):
# On ne peut envoyer un mail que sur une élection restreinte qui n'a pas # 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> <h1 class="title">{% trans "Gestion de Kadenios" %}</h1>
<hr> <hr>
<div class="tile is-ancestor"> <div class="tile is-ancestor">
<div class="tile is-parent"> <div class="tile is-parent">
<a class="tile is-child notification is-light" href="{% url 'auth.create-account' %}"> <a class="tile is-child notification is-light px-0" href="{% url 'auth.create-account' %}">
<div class="subtitle has-text-centered"> <div class="subtitle has-text-centered">
<span class="icon-text"> <span class="icon-text">
<span class="icon"> <span class="icon">
<i class="fas fa-user-plus"></i> <i class="fas fa-user-plus"></i>
</span> </span>
<span class="ml-3">{% trans "Créer un nouveau compte" %}</span> <span class="ml-3">{% trans "Créer un nouveau compte" %}</span>
</span> </span>
</div>
</a>
</div> </div>
</a>
</div>
<div class="tile is-parent"> <div class="tile is-parent">
<a class="tile is-child notification is-light" href="{% url 'auth.accounts' %}"> <a class="tile is-child notification is-light px-0" href="{% url 'auth.accounts' %}">
<div class="subtitle has-text-centered"> <div class="subtitle has-text-centered">
<span class="icon-text"> <span class="icon-text">
<span class="icon"> <span class="icon">
<i class="fas fa-stream"></i> <i class="fas fa-stream"></i>
</span> </span>
<span class="ml-3">{% trans "Liste des comptes" %}</span> <span class="ml-3">{% trans "Liste des comptes" %}</span>
</span> </span>
</div>
</a>
</div> </div>
</div> </a>
</div>
</div>
{% endblock %} {% endblock %}