general: add support for theme specific backoffice extra css (#49139)
This commit is contained in:
parent
af82f1474a
commit
4073f27d14
|
@ -28,6 +28,11 @@ for dirname in sorted(os.listdir('static')):
|
||||||
theme['variables']['no_extra_js'] = False
|
theme['variables']['no_extra_js'] = False
|
||||||
else:
|
else:
|
||||||
theme['variables']['no_extra_js'] = True
|
theme['variables']['no_extra_js'] = True
|
||||||
|
if (os.path.exists(os.path.join('static', dirname, 'backoffice.scss')) or
|
||||||
|
os.path.exists(os.path.join('static', dirname, 'backoffice.css'))):
|
||||||
|
theme['variables']['portal_agent_extra_css'] = '/static/%s/backoffice.css' % dirname
|
||||||
|
else:
|
||||||
|
theme['variables']['portal_agent_extra_css'] = None
|
||||||
if 'included_js_libraries' not in theme['variables']:
|
if 'included_js_libraries' not in theme['variables']:
|
||||||
theme['variables']['included_js_libraries'] = ['jquery.js']
|
theme['variables']['included_js_libraries'] = ['jquery.js']
|
||||||
if args.overlay:
|
if args.overlay:
|
||||||
|
|
|
@ -7,3 +7,5 @@ for dirname in sorted(os.listdir('static')):
|
||||||
if not os.path.exists(config):
|
if not os.path.exists(config):
|
||||||
continue
|
continue
|
||||||
print('static/%s/style.css' % dirname)
|
print('static/%s/style.css' % dirname)
|
||||||
|
if os.path.exists(os.path.join('static', dirname, 'backoffice.scss')):
|
||||||
|
print('static/%s/backoffice.css' % dirname)
|
||||||
|
|
|
@ -7,11 +7,6 @@ $(function() {
|
||||||
$('body').attr('data-environment-label', PUBLIK_ENVIRONMENT_LABEL);
|
$('body').attr('data-environment-label', PUBLIK_ENVIRONMENT_LABEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PUBLIK_PORTAL_AGENT_EXTRA_CSS) {
|
|
||||||
$('<link rel="stylesheet" type="text/css" media="all" href="' +
|
|
||||||
PUBLIK_PORTAL_AGENT_EXTRA_CSS + '"/>').appendTo('head');
|
|
||||||
}
|
|
||||||
|
|
||||||
function update_publik_menu() {
|
function update_publik_menu() {
|
||||||
window.sessionStorage.hobo_environment = JSON.stringify(COMBO_KNOWN_SERVICES);
|
window.sessionStorage.hobo_environment = JSON.stringify(COMBO_KNOWN_SERVICES);
|
||||||
window.sessionStorage.hobo_environment_timestamp = Date.now();
|
window.sessionStorage.hobo_environment_timestamp = Date.now();
|
||||||
|
|
|
@ -12,6 +12,11 @@
|
||||||
|
|
||||||
{% block extrascripts %}
|
{% block extrascripts %}
|
||||||
<link rel="stylesheet" type="text/css" href="{{site_base}}{% static "" %}includes/gadjo-extra.css">
|
<link rel="stylesheet" type="text/css" href="{{site_base}}{% static "" %}includes/gadjo-extra.css">
|
||||||
|
{% if portal_agent_extra_css|first == '/' %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{{ portal_url }}{{ portal_agent_extra_css }}">
|
||||||
|
{% elif portal_agent_extra_css %}
|
||||||
|
<link rel="stylesheet" type="text/css" href="{{ portal_agent_extra_css }}">
|
||||||
|
{% endif %}
|
||||||
{% if manager_homepage_url %}
|
{% if manager_homepage_url %}
|
||||||
<script src="{{manager_homepage_url}}__services.js"></script>
|
<script src="{{manager_homepage_url}}__services.js"></script>
|
||||||
<script src="{{manager_homepage_url}}static/portal-agent/js/publik.js?{% start_timestamp %}"></script>
|
<script src="{{manager_homepage_url}}static/portal-agent/js/publik.js?{% start_timestamp %}"></script>
|
||||||
|
|
Loading…
Reference in New Issue