admin: add possibility for a theme to provide a supplementary css (#2429)
This commit is contained in:
parent
56dfd14339
commit
56371c4ccb
|
@ -159,6 +159,9 @@ ADMIN_TEMPLATE_EZT = """<!DOCTYPE html>
|
|||
<head>
|
||||
<title>[page_title]</title>
|
||||
<link rel="stylesheet" type="text/css" href="[css]"/>
|
||||
[if-any extra_css]
|
||||
<link rel="stylesheet" type="text/css" href="[extra_css]"/>
|
||||
[end]
|
||||
[script]
|
||||
</head>
|
||||
<body>
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue