From efb623af0bcb47d510501c282e1326b11343a29c Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 22 Sep 2012 22:27:04 -0400 Subject: site reorg --- app/lib/grappelli/context_processors.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 app/lib/grappelli/context_processors.py (limited to 'app/lib/grappelli/context_processors.py') diff --git a/app/lib/grappelli/context_processors.py b/app/lib/grappelli/context_processors.py new file mode 100644 index 0000000..60a56bb --- /dev/null +++ b/app/lib/grappelli/context_processors.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +from django.conf import settings + +def admin_template_path(request): + + # default templates for "grappelli standalone" + template_path = "admin/_grappelli/" + + if getattr(settings, 'ADMIN_TOOLS_INDEX_DASHBOARD', False): + apps = getattr(settings, 'INSTALLED_APPS') + if apps.count("admin_tools.dashboard"): + # seems to be a grappelli+admin_tools setup + # so we use the other templates + template_path = "admin/_grappelli_admin_tools/" + + return { + "admin_template_index": "%sindex.html" % template_path, + "admin_template_app_index": "%sapp_index.html" % template_path, + "admin_template_base": "%sbase.html" % template_path, + "admin_template_base_site": "%sbase_site.html" % template_path, + } -- cgit v1.2.3-70-g09d2