# HG changeset patch # User nishanth # Date 1271858598 -19800 # Node ID 8d0d82c981b33e418741500b4a2d7cdaa51fb1b4 # Parent d28d0957a5abdf07c4c26841346d7e6c728297a5 added "return to admin page" link in open_quiz page diff -r d28d0957a5ab -r 8d0d82c981b3 event/views.py --- a/event/views.py Wed Apr 21 19:17:47 2010 +0530 +++ b/event/views.py Wed Apr 21 19:33:18 2010 +0530 @@ -5,6 +5,11 @@ from offline.event.forms import EventCreateForm from offline.settings import ADMIN_KEY +num2name = {"11" : "Day 1 Quiz 1", + "12" : "Day 1 Quiz 2", + "21" : "Day 2 Quiz 1", + } + def event_home(request): """ The page for people to view. """ @@ -82,7 +87,7 @@ quiz_num = request.POST['quiz_num'] event.quiz_status = quiz_num event.save() - return render_to_response("open_quiz.html",{'success':True}) + return render_to_response("open_quiz.html",{"admin_key":ADMIN_KEY, "quiz_name":num2name[quiz_num], 'success':True}) except MultiValueDictKeyError: raise Http404 else: diff -r d28d0957a5ab -r 8d0d82c981b3 templates/open_quiz.html --- a/templates/open_quiz.html Wed Apr 21 19:17:47 2010 +0530 +++ b/templates/open_quiz.html Wed Apr 21 19:33:18 2010 +0530 @@ -1,7 +1,8 @@ {% extends 'base.html' %} {% block content %} {% if success %} - The quiz has been successfully opened. + The quiz {{quiz_name}} has been successfully opened.
+ Return to admin page {% else %} Select the quiz to open.