From 31c034a96ae2cf4072d6607df45038ce98657d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 2 Jun 2017 18:01:27 +0100 Subject: [PATCH] send_rappel: use django messages + css tweaks --- bda/templates/bda/mails-rappel.html | 47 +++++++++++++---------------- bda/views.py | 8 +++++ gestioncof/static/css/cof.css | 7 +++-- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/bda/templates/bda/mails-rappel.html b/bda/templates/bda/mails-rappel.html index 73625d1c..21fcc407 100644 --- a/bda/templates/bda/mails-rappel.html +++ b/bda/templates/bda/mails-rappel.html @@ -3,41 +3,36 @@ {% block realcontent %}

Mails de rappels

{% if sent %} -

Les mails de rappel pour le spectacle {{ show.title }} ont bien été envoyés aux personnes suivantes

- +

Les mails de rappel pour le spectacle {{ show.title }} ont bien été envoyés aux personnes suivantes

+ {% else %} -

Voulez vous envoyer les mails de rappel pour le spectacle - {{ show.title }} ?

- {% if show.rappel_sent %} -

Attention, les mails ont déjà été envoyés le - {{ show.rappel_sent }}

- {% endif %} +

Voulez vous envoyer les mails de rappel pour le spectacle {{ show.title }} ?

{% endif %} - {% if not sent %} -
- {% csrf_token %} -
- -
-
- {% endif %} +
+ {% if not sent %} +
+ {% csrf_token %} +
+ +
+
+ {% endif %} +
-
-

Forme des mails

Une seule place

- {% for part in exemple_mail_1place %} -
{{ part }}
- {% endfor %} + {% for part in exemple_mail_1place %} +
{{ part }}
+ {% endfor %}

Deux places

{% for part in exemple_mail_2places %} -
{{ part }}
+
{{ part }}
{% endfor %} {% endblock %} diff --git a/bda/views.py b/bda/views.py index 406ca81c..602e5025 100644 --- a/bda/views.py +++ b/bda/views.py @@ -673,6 +673,14 @@ def send_rappel(request, spectacle_id): # Demande de confirmation else: ctxt['sent'] = False + if show.rappel_sent: + messages.warning( + request, + "Attention, un mail de rappel pour ce spectale a déjà été " + "envoyé le {}".format(formats.localize( + timezone.template_localtime(show.rappel_sent) + )) + ) return render(request, "bda/mails-rappel.html", ctxt) diff --git a/gestioncof/static/css/cof.css b/gestioncof/static/css/cof.css index e1cdd763..91cf726a 100644 --- a/gestioncof/static/css/cof.css +++ b/gestioncof/static/css/cof.css @@ -40,8 +40,9 @@ a { background: transparent; } - - +div.empty-form { + padding-bottom: 2em; +} a:hover { color: #444; @@ -341,10 +342,12 @@ fieldset legend { font-weight: 700; font-size: large; color:#DE826B; + padding-bottom: .5em; } #main-content h4 { color:#DE826B; + padding-bottom: .5em; } #main-content h2,