From 8414132bf4986426ceb86086719fcbc8b8eb55d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 5 Nov 2013 12:21:27 +0100 Subject: [PATCH 1/1] Handle form page before/after contest --- wtem/templates/wtem/main_after.html | 9 +++++++++ wtem/templates/wtem/main_before.html | 9 +++++++++ wtem/views.py | 11 +++++++++++ 3 files changed, 29 insertions(+) create mode 100644 wtem/templates/wtem/main_after.html create mode 100644 wtem/templates/wtem/main_before.html diff --git a/wtem/templates/wtem/main_after.html b/wtem/templates/wtem/main_after.html new file mode 100644 index 0000000..dbb7ad8 --- /dev/null +++ b/wtem/templates/wtem/main_after.html @@ -0,0 +1,9 @@ +{% extends 'base_super.html' %} + +{% block body %} + +

Wielki Turniej Edukacji Medialnej

+ +

Pierszy etap Turnieju został zakończony.

+ +{% endblock %} \ No newline at end of file diff --git a/wtem/templates/wtem/main_before.html b/wtem/templates/wtem/main_before.html new file mode 100644 index 0000000..4dd535b --- /dev/null +++ b/wtem/templates/wtem/main_before.html @@ -0,0 +1,9 @@ +{% extends 'base_super.html' %} + +{% block body %} + +

Wielki Turniej Edukacji Medialnej

+ +

Pierwszy etap: 21 listopada, 15:30 - 17:30.

+ +{% endblock %} \ No newline at end of file diff --git a/wtem/views.py b/wtem/views.py index d329f12..1647f09 100644 --- a/wtem/views.py +++ b/wtem/views.py @@ -8,11 +8,22 @@ from django.http import Http404 from .models import Submission from .forms import WTEMForm +WTEM_CONTEST_STAGE = getattr(settings, 'WTEM_CONTEST_STAGE', 'before') + def main(request): pass def form(request, key): + return globals()['form_' + WTEM_CONTEST_STAGE](request, key) + +def form_before(request, key): + return render(request, 'wtem/main_before.html') + +def form_after(request, key): + return render(request, 'wtem/main_after.html') + +def form_during(request, key): try: submission = Submission.objects.get(key = key) except Submission.DoesNotExist: -- 2.20.1