From 5db7eef1d78e2d6d0e2f03837720b3d8e5b94187 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Wed, 18 Sep 2019 19:36:02 +0200 Subject: [PATCH] Add charte popup and functionality --- bda/templates/bda/inscription-tirage.html | 38 ++++++++++++++++++++++- bda/views.py | 3 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/bda/templates/bda/inscription-tirage.html b/bda/templates/bda/inscription-tirage.html index 9a39df6f..6c86e356 100644 --- a/bda/templates/bda/inscription-tirage.html +++ b/bda/templates/bda/inscription-tirage.html @@ -4,6 +4,8 @@ {% block extra_head %} + + {% endblock %} @@ -118,11 +120,45 @@ var django = { }); - +

1: cette liste de vœux est ordonnée (du plus important au moins important), pour ajuster la priorité vous pouvez déplacer chaque vœu.

+ +{% if not charte %} + +{% endif %} {% endblock %} diff --git a/bda/views.py b/bda/views.py index 6a0e7ec7..0c4d7665 100644 --- a/bda/views.py +++ b/bda/views.py @@ -211,6 +211,8 @@ def inscription(request, tirage_id): if formset.is_valid(): formset.save() formset = BdaFormSet(instance=participant) + participant.accepte_charte = True + participant.save() messages.success( request, "Votre inscription a été mise à jour avec succès !" ) @@ -238,6 +240,7 @@ def inscription(request, tirage_id): "total_price": total_price, "dbstate": dbstate, "tirage": tirage, + "charte": participant.accepte_charte, }, )