From: Aleksander Łukasz Date: Tue, 12 Nov 2013 11:23:00 +0000 (+0100) Subject: Closed registration notice X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/0029595caa78abc831724d22b4c1b45b9867cec0?ds=sidebyside Closed registration notice --- 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 %}