From: Aleksander Łukasz Date: Tue, 5 Nov 2013 11:21:27 +0000 (+0100) Subject: Handle form page before/after contest X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/8414132bf4986426ceb86086719fcbc8b8eb55d5?ds=inline Handle form page before/after contest --- 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: