From cf7d596270e296de6fb3112ddc8a4ac44307e0bc Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 26 Apr 2023 12:25:40 +0200 Subject: [PATCH] Adjust 'event_before' page depending on 'enable_registration' --- shiftregister/app/decorators.py | 10 +++++++++- shiftregister/app/templates/event_before.html | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/shiftregister/app/decorators.py b/shiftregister/app/decorators.py index 71b34de..6713892 100644 --- a/shiftregister/app/decorators.py +++ b/shiftregister/app/decorators.py @@ -10,7 +10,15 @@ def event_state(view): if state == "RUNNING": return view(request, *args, **kwargs) if state == "BEFORE": - return render(request, "event_before.html", {}) + return render( + request, + "event_before.html", + { + "enable_registration": global_preferences[ + "helper__enable_registration" + ] + }, + ) return render(request, "event_after.html", {}) return wrapped diff --git a/shiftregister/app/templates/event_before.html b/shiftregister/app/templates/event_before.html index c3a11a5..ab9bc9d 100644 --- a/shiftregister/app/templates/event_before.html +++ b/shiftregister/app/templates/event_before.html @@ -6,8 +6,14 @@

Bald geht's los!

{% if not helper %} +{% if enable_registration %} Du kannst dich gerne bereits anmelden. +{% else %} + Aktuell ist es leider nicht möglich, sich für die Helfer*innen zu registrieren. Bitte komm später wieder. {% endif %} +{% endif %} +{% if helper or enable_registration %} Wir schicken dir dann eine SMS, sobald wir freie Schichten haben. +{% endif %}

{% endblock %}