From: Scott Baker Date: Mon, 9 Jun 2014 18:55:26 +0000 (-0700) Subject: add ability to disabled minidashboard X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a226eb4399829560fb2be51310e9d975ab20183c;p=plstackapi.git add ability to disabled minidashboard --- diff --git a/planetstack/core/context_processors.py b/planetstack/core/context_processors.py new file mode 100644 index 0000000..839316f --- /dev/null +++ b/planetstack/core/context_processors.py @@ -0,0 +1,6 @@ +from django.conf import settings + +print dir(settings) + +def planetstack(request): + return {"DISABLE_MINIDASHBOARD": settings.DISABLE_MINIDASHBOARD} diff --git a/planetstack/planetstack/settings.py b/planetstack/planetstack/settings.py index 63af805..1f01e96 100644 --- a/planetstack/planetstack/settings.py +++ b/planetstack/planetstack/settings.py @@ -154,6 +154,7 @@ INSTALLED_APPS = ( # Added for django-suit form TEMPLATE_CONTEXT_PROCESSORS = TCP + ( 'django.core.context_processors.request', + 'core.context_processors.planetstack', ) # Django Suit configuration example @@ -249,3 +250,5 @@ LOGGING = { } BIGQUERY_TABLE = getattr(config, "bigquery_table", "demoevents") + +DISABLE_MINIDASHBOARD = getattr(config, "gui_disable_minidashboard", False) diff --git a/planetstack/templates/admin/newminidashboard.html b/planetstack/templates/admin/newminidashboard.html index 5baa126..de70feb 100644 --- a/planetstack/templates/admin/newminidashboard.html +++ b/planetstack/templates/admin/newminidashboard.html @@ -1,3 +1,5 @@ +{% if not DISABLE_MINIDASHBOARD %} +
{{ opts.verbose_name_plural|capfirst }}
{{ original|truncatewords:"18" }}
@@ -66,3 +68,4 @@ $( "#miniDashAvgLoad" ).click(function() { +{% endif %}