diff --git a/create_themes_json.py b/create_themes_json.py index a6d569ec..17dc3b38 100644 --- a/create_themes_json.py +++ b/create_themes_json.py @@ -28,6 +28,11 @@ for dirname in sorted(os.listdir('static')): theme['variables']['no_extra_js'] = False else: 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']: theme['variables']['included_js_libraries'] = ['jquery.js'] if args.overlay: diff --git a/get_themes.py b/get_themes.py index c99ea79e..3f233968 100644 --- a/get_themes.py +++ b/get_themes.py @@ -7,3 +7,5 @@ for dirname in sorted(os.listdir('static')): if not os.path.exists(config): continue print('static/%s/style.css' % dirname) + if os.path.exists(os.path.join('static', dirname, 'backoffice.scss')): + print('static/%s/backoffice.css' % dirname) diff --git a/static/portal-agent/js/publik.js b/static/portal-agent/js/publik.js index ac2405cc..943af64d 100644 --- a/static/portal-agent/js/publik.js +++ b/static/portal-agent/js/publik.js @@ -7,11 +7,6 @@ $(function() { $('body').attr('data-environment-label', PUBLIK_ENVIRONMENT_LABEL); } - if (PUBLIK_PORTAL_AGENT_EXTRA_CSS) { - $('').appendTo('head'); - } - function update_publik_menu() { window.sessionStorage.hobo_environment = JSON.stringify(COMBO_KNOWN_SERVICES); window.sessionStorage.hobo_environment_timestamp = Date.now(); diff --git a/templates/gadjo/base.html b/templates/gadjo/base.html index d0b2a066..7dfa71ae 100644 --- a/templates/gadjo/base.html +++ b/templates/gadjo/base.html @@ -12,6 +12,11 @@ {% block extrascripts %} +{% if portal_agent_extra_css|first == '/' %} + +{% elif portal_agent_extra_css %} + +{% endif %} {% if manager_homepage_url %}