diff --git a/backend/src/appenlight/lib/configurator.py b/backend/src/appenlight/lib/configurator.py
index a3ed92d..176eb84 100644
--- a/backend/src/appenlight/lib/configurator.py
+++ b/backend/src/appenlight/lib/configurator.py
@@ -76,6 +76,7 @@ def register_appenlight_plugin(config, plugin_name, plugin_config):
'fulltext_indexer': None,
'sqlalchemy_migrations': None,
'default_values_setter': None,
+ 'header_html': None,
'resource_types': [],
'url_gen': None
}
diff --git a/backend/src/appenlight/static/js/appenlight.js b/backend/src/appenlight/static/js/appenlight.js
index 65d6714..e5cceb6 100644
--- a/backend/src/appenlight/static/js/appenlight.js
+++ b/backend/src/appenlight/static/js/appenlight.js
@@ -2742,7 +2742,7 @@ angular.module('appenlight.services', [
var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
function(item){
- return item.config.angular_module
+ return item.config.javascript.angular_module
});
console.info(pluginsToLoad);
diff --git a/backend/src/appenlight/subscribers.py b/backend/src/appenlight/subscribers.py
index 1ec18d3..1b38314 100644
--- a/backend/src/appenlight/subscribers.py
+++ b/backend/src/appenlight/subscribers.py
@@ -110,7 +110,7 @@ def add_renderer_globals(event):
renderer_globals['_'] = _
renderer_globals['security'] = security
renderer_globals['flash_msgs'] = []
- renderer_globals['js_plugins'] = []
+ renderer_globals['appenlight_plugins'] = []
if 'jinja' in event['renderer_info'].type:
renderer_globals['url_list'] = gen_urls(request)
@@ -120,9 +120,12 @@ def add_renderer_globals(event):
urls = config['url_gen'](request)
renderer_globals['url_list']['plugins'][module] = urls
- if config['javascript']:
- renderer_globals['js_plugins'].append(
- ({'name': module, 'config': config['javascript']}))
+ renderer_globals['appenlight_plugins'].append(
+ {'name': module,
+ 'config': {
+ 'javascript':config['javascript'],
+ 'header_html':config['header_html']
+ }})
footer_config = ConfigService.by_key_and_section(
'template_footer_html', 'global', default_value='')
diff --git a/backend/src/appenlight/templates/layout_base.jinja2 b/backend/src/appenlight/templates/layout_base.jinja2
index ad87794..cf6fe43 100644
--- a/backend/src/appenlight/templates/layout_base.jinja2
+++ b/backend/src/appenlight/templates/layout_base.jinja2
@@ -26,7 +26,7 @@
AE.ws_url = '{{ request.registry.settings['cometd.ws_url'] }}';
AE.flash_messages = {{ flash_msgs|toJSONUnsafe }};
AE.timeOptions = {{ h.time_options|toJSONUnsafe }};
- AE.plugins = {{ js_plugins|toJSONUnsafe }};
+ AE.plugins = {{ appenlight_plugins|toJSONUnsafe }};
{% if request.registry.settings.get('appenlight.public_api_key') %}
{% endif %}
- {% for plugin in js_plugins %}
-
+ {% for plugin in appenlight_plugins %}
+
+ {% if plugin['config']['header_html'] %}
+ {{ plugin['config']['header_html']|safe }}
+ {% endif %}
{% endfor %}