Skip to content

Commit

Permalink
added webasset for crc profile plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya-Oladazimi committed Nov 2, 2023
1 parent 386dbf0 commit 6a53866
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckanext/crc1153/plugins/crc_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Empty file.
16 changes: 16 additions & 0 deletions ckanext/crc1153/public/crc_profile/webassets.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ckanext/crc1153/templates/crc_profile/admin_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) %}
Expand Down

0 comments on commit 6a53866

Please sign in to comment.