From a76248251ab66e5280a91de29bab89d593da8abc Mon Sep 17 00:00:00 2001 From: ichuang Date: Thu, 17 May 2012 22:48:39 -0400 Subject: [PATCH] fix quickedit (request.user_is_staff is not a function); small edit to problem.html to show quickedit when settings.QUICKEDIT is True. add mathjax_include.html because that is needed by quickedit.html --- djangoapps/courseware/views.py | 2 +- templates/mathjax_include.html | 98 ++++++++++++++++++++++++++++++++++ templates/problem.html | 9 ++++ 3 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 templates/mathjax_include.html diff --git a/djangoapps/courseware/views.py b/djangoapps/courseware/views.py index 17b6471222..857bdd2e03 100644 --- a/djangoapps/courseware/views.py +++ b/djangoapps/courseware/views.py @@ -305,7 +305,7 @@ def quickedit(request, id=None): print "In deployed use, this will only edit on one server" print "We need a setting to disable for production where there is" print "a load balanacer" - if not request.user.is_staff(): + if not request.user.is_staff: return redirect('/') # get coursename if stored diff --git a/templates/mathjax_include.html b/templates/mathjax_include.html new file mode 100644 index 0000000000..b072ec854d --- /dev/null +++ b/templates/mathjax_include.html @@ -0,0 +1,98 @@ + + <%block name="headextra"/> + + + + + diff --git a/templates/problem.html b/templates/problem.html index cd332f1b74..4c8c0f41f6 100644 --- a/templates/problem.html +++ b/templates/problem.html @@ -2,6 +2,15 @@ % if problem['weight']: : ${ problem['weight'] } points % endif +% if settings.QUICKEDIT: + +
+
+
+
+Quick +Edit Problem
+% endif