+ # Show the navigation only to moderators and super users
+ if not context.has_key("hide_navigation"):
+ context['hide_navigation'] = not request.user.is_superuser
+
+ unsaved = request.session.get('previewing_settings', {})
+ context['unsaved'] = set([getattr(settings, s).set.name for s in unsaved.keys() if hasattr(settings, s)])
+
+ return render_to_response(template, context, context_instance=RequestContext(request))
+
+def admin_page(fn):
+ @super_user_required
+ def wrapper(request, *args, **kwargs):
+ return admin_page_wrapper(fn, request, *args, **kwargs)
+
+ return wrapper
+
+def moderation_page(fn):
+ @staff_user_required
+ def wrapper(request, *args, **kwargs):
+ return admin_page_wrapper(fn, request, *args, **kwargs)