From a30955fb7530abd38fb03911b48413e5c14f9b3e Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Mon, 7 Jan 2019 14:43:32 +0100 Subject: [PATCH] HTML corrections ; stupidtable injection --- bda/templates/bda/revente/manage.html | 17 +++++++++++------ bda/templates/bda/revente/tirages.html | 14 +++++++++++--- bda/views.py | 7 +++++++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/bda/templates/bda/revente/manage.html b/bda/templates/bda/revente/manage.html index 5147ff16..4f1d014e 100644 --- a/bda/templates/bda/revente/manage.html +++ b/bda/templates/bda/revente/manage.html @@ -4,9 +4,8 @@ {% block realcontent %}

Gestion des places que je revends

-{% with resell_attributions=resellform.attributions annul_reventes=annulform.reventes sold_reventes=soldform.reventes %} -{% if resell_attributions %} +{% if resell_exists %}

Places non revendues

@@ -29,7 +28,7 @@
{% endif %} -{% if annul_reventes %} +{% if annul_exists %}

Places en cours de revente

@@ -52,7 +51,7 @@
{% endif %} -{% if sold_reventes %} +{% if sold_exists %}

Places revendues

@@ -72,9 +71,15 @@ {% endif %} -{% if not resell_attributions and not annul_reventes and not sold_reventes %} +{% if not resell_exists and not annul_exists and not sold_exists %}

Plus de reventes possibles !

{% endif %} -{% endwith %} + + + {% endblock %} diff --git a/bda/templates/bda/revente/tirages.html b/bda/templates/bda/revente/tirages.html index 881e1e0a..c14093be 100644 --- a/bda/templates/bda/revente/tirages.html +++ b/bda/templates/bda/revente/tirages.html @@ -8,9 +8,10 @@ {% if annul_exists %}

Les reventes auxquelles vous êtes inscrit·e

-

- Voici la liste des reventes auxquelles vous êtes inscrit·e ; si vous ne souhaitez plus participer au tirage au sort vous pouvez vous en désister. -

+
+ + Voici la liste des reventes auxquelles vous êtes inscrit·e ; si vous ne souhaitez plus participer au tirage au sort vous pouvez vous en désister. +
{% csrf_token %} @@ -80,5 +81,12 @@ {% endif %} + + + {% endblock %} diff --git a/bda/views.py b/bda/views.py index f5be2e74..7a1774b3 100644 --- a/bda/views.py +++ b/bda/views.py @@ -450,6 +450,10 @@ def revente_manage(request, tirage_id): new_date = timezone.now() - SpectacleRevente.remorse_time revente.reset(new_date=new_date) + sold_exists = soldform.fields["reventes"].queryset.exists() + annul_exists = annulform.fields["reventes"].queryset.exists() + resell_exists = resellform.fields["attributions"].queryset.exists() + return render( request, "bda/revente/manage.html", @@ -458,6 +462,9 @@ def revente_manage(request, tirage_id): "soldform": soldform, "annulform": annulform, "resellform": resellform, + "sold_exists": sold_exists, + "annul_exists": annul_exists, + "resell_exists": resell_exists, }, )