diff --git a/ckanext/crc1153/plugins/crc_profile.py b/ckanext/crc1153/plugins/crc_profile.py index 133bf33..c23be2f 100644 --- a/ckanext/crc1153/plugins/crc_profile.py +++ b/ckanext/crc1153/plugins/crc_profile.py @@ -14,7 +14,9 @@ class Dcatapcrc1153Plugin(plugins.SingletonPlugin): # IConfigurer def update_config(self, config_): - toolkit.add_template_directory(config_, '../templates') + toolkit.add_template_directory(config_, '../templates') + toolkit.add_public_directory(config_, '../public') + toolkit.add_resource('../public/crc_profile', 'ckanext-crc1153-profile') def get_blueprint(self): diff --git a/ckanext/crc1153/public/crc_profile/profile.js b/ckanext/crc1153/public/crc_profile/profile.js new file mode 100644 index 0000000..e69de29 diff --git a/ckanext/crc1153/public/crc_profile/webassets.yml b/ckanext/crc1153/public/crc_profile/webassets.yml new file mode 100644 index 0000000..bc53237 --- /dev/null +++ b/ckanext/crc1153/public/crc_profile/webassets.yml @@ -0,0 +1,16 @@ +# add-css: +# output: ckanext-crc1153-specific-metadata/%(version)s_my.css +# contents: +# - index.css + +profile-js: + output: ckanext-crc1153-specific-metadata/%(version)s_my.js + extra: + preload: + - base/main + - vendor/vendor + - vendor/bootstrap + - vendor/jquery + - vendor/jquery.ui.core + contents: + - profile.js diff --git a/ckanext/crc1153/templates/crc_profile/admin_panel.html b/ckanext/crc1153/templates/crc_profile/admin_panel.html index c0f0cc0..c558186 100644 --- a/ckanext/crc1153/templates/crc_profile/admin_panel.html +++ b/ckanext/crc1153/templates/crc_profile/admin_panel.html @@ -3,6 +3,7 @@ {% block primary_content_inner %} {% if h.is_plugin_enabled('crc1153_dcat_profile') %} + {% asset 'ckanext-crc1153-profile/profile-js' %} {% set export_action = h.url_for('crc1153_dcat_profile.export_catalog', _external=True) %} {% set push_sparql_action = h.url_for('crc1153_dcat_profile.push_to_sparql', _external=True) %} {% set delete_sparql_action = h.url_for('crc1153_dcat_profile.delete_from_sparql', _external=True) %}