From 9bcea67b78a84603ab1afb1c89e991ac342a6aba Mon Sep 17 00:00:00 2001 From: Simon Hedberg Date: Mon, 10 Jan 2011 00:22:58 +0100 Subject: [PATCH] add moderator variable to toolbar context and make publish button hidden when moderator is False --- cms/middleware/toolbar.py | 1 + cms/templates/cms/toolbar/toolbar.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cms/middleware/toolbar.py b/cms/middleware/toolbar.py index 13c3e75178f..28ecedb7e2c 100755 --- a/cms/middleware/toolbar.py +++ b/cms/middleware/toolbar.py @@ -121,6 +121,7 @@ def render_toolbar(self, request): 'auth_error':not auth and 'cms_username' in request.POST, 'placeholder_data':data, 'edit':edit, + 'moderator': cms_settings.CMS_MODERATOR, 'CMS_MEDIA_URL': cms_settings.CMS_MEDIA_URL, }) #from django.core.context_processors import csrf diff --git a/cms/templates/cms/toolbar/toolbar.html b/cms/templates/cms/toolbar/toolbar.html index f0cf6767de6..e74f3856f61 100644 --- a/cms/templates/cms/toolbar/toolbar.html +++ b/cms/templates/cms/toolbar/toolbar.html @@ -157,7 +157,7 @@
{% if edit and page %} - {% if auth %} + {% if auth and moderator %} {% if moderator_should_approve and has_moderate_permission %} {{ page_moderator_state.label }}