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