From 0029595caa78abc831724d22b4c1b45b9867cec0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 12 Nov 2013 12:23:00 +0100 Subject: [PATCH] Closed registration notice --- contact/views.py | 3 +++ edumed/contact_forms.py | 1 + wtem/templates/wtem/disabled_contact_form.html | 13 +++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 wtem/templates/wtem/disabled_contact_form.html diff --git a/contact/views.py b/contact/views.py index 9fc9637..6ec18e5 100644 --- a/contact/views.py +++ b/contact/views.py @@ -13,6 +13,9 @@ def form(request, form_tag): except KeyError: raise Http404 if getattr(form_class, 'disabled', False): + template = getattr(form_class, 'disabled_template', None) + if template: + return render(request, template) raise Http404 if request.method == 'POST': form = form_class(request.POST, request.FILES) diff --git a/edumed/contact_forms.py b/edumed/contact_forms.py index ad19702..9c74cbd 100644 --- a/edumed/contact_forms.py +++ b/edumed/contact_forms.py @@ -102,6 +102,7 @@ class NoEmptyFormsAllowedBaseFormSet(forms.formsets.BaseFormSet): class WTEMForm(ContactForm): disabled = True + disabled_template = 'wtem/disabled_contact_form.html' form_tag = "wtem" form_title = u"WTEM - rejestracja uczestników" submit_label = u"Wyślij zgłoszenie" diff --git a/wtem/templates/wtem/disabled_contact_form.html b/wtem/templates/wtem/disabled_contact_form.html new file mode 100644 index 0000000..4d5ab23 --- /dev/null +++ b/wtem/templates/wtem/disabled_contact_form.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} + +{% block title %}Wielki Turniej Edukacji Medialnej{% endblock %} + +{% block body %} + +

Wielki Turniej Edukacji Medialnej

+ + {% block contact_form_description %} +

Rejestracja uczestników została zamknięta.

+ {% endblock %} + +{% endblock %} -- 2.20.1