From 56371c4ccb3731053412ac833de63516fe8525d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 5 Feb 2013 14:29:49 +0100 Subject: [PATCH] admin: add possibility for a theme to provide a supplementary css (#2429) --- wcs/qommon/template.ptl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wcs/qommon/template.ptl b/wcs/qommon/template.ptl index 8d4fe464e..960036f2f 100644 --- a/wcs/qommon/template.ptl +++ b/wcs/qommon/template.ptl @@ -159,6 +159,9 @@ ADMIN_TEMPLATE_EZT = """ [page_title] + [if-any extra_css] + + [end] [script] @@ -339,6 +342,15 @@ def decorate(body, response): css = root_url + get_publisher().qommon_static_dir + get_publisher().qommon_admin_css generate_breadcrumb = True template = admin_template + + app_dir_filename = os.path.join(get_publisher().app_dir, 'themes', + current_theme, 'admin.css') + data_dir_filename = os.path.join(get_publisher().data_dir, 'themes', + current_theme, 'admin.css') + for filename in (app_dir_filename, data_dir_filename): + if os.path.exists(filename): + extra_css = root_url + 'themes/%s/admin.css' % current_theme + break else: if current_theme == 'default': css = root_url + 'css/%s.css' % get_publisher().APP_NAME