From 47d5c9a97011e1620579dbb6d8a08780a22206ac Mon Sep 17 00:00:00 2001
From: Thorge Petersen <petersen@rz.uni-kiel.de>
Date: Thu, 6 Oct 2022 15:42:55 +0200
Subject: [PATCH] Readded super and worked on webasset preloads

---
 ckanext/odsh/fanstatic/{webassets.yaml => webassets.yml} | 7 +++++++
 ckanext/odsh/plugin.py                                   | 2 +-
 ckanext/odsh/templates/base.html                         | 1 +
 ckanext/odsh/templates/package/search.html               | 1 +
 4 files changed, 10 insertions(+), 1 deletion(-)
 rename ckanext/odsh/fanstatic/{webassets.yaml => webassets.yml} (95%)

diff --git a/ckanext/odsh/fanstatic/webassets.yaml b/ckanext/odsh/fanstatic/webassets.yml
similarity index 95%
rename from ckanext/odsh/fanstatic/webassets.yaml
rename to ckanext/odsh/fanstatic/webassets.yml
index ade8f201..25d367dd 100644
--- a/ckanext/odsh/fanstatic/webassets.yaml
+++ b/ckanext/odsh/fanstatic/webassets.yml
@@ -2,6 +2,7 @@ odsh_base_script:
   filters: rjsmin # preprocessor
   output: ckanext-odsh/odsh_base.js
   contents:
+    - vendor/jquery-ui-autocomplete/jquery-ui.js
     - autocomplete.js
     - odsh.js
 
@@ -15,6 +16,9 @@ odsh_base_style:
 odsh_datepicker_script:
   filters: rjsmin # preprocessor
   output: ckanext-odsh/odsh_datepicker.js
+  extra:
+          preload:
+                  - vendor/jquery
   contents:
     - moment.js
     - bootstrap-datepicker.js
@@ -50,6 +54,9 @@ odsh_popover_script:
 tpsh_toggle_menu:
   filters: rjsmin # preprocessor
   output: ckanext-odsh/tpsh_toggle_menu.js
+  extra:
+          preload:
+                  - base/main
   contents:
     - tpsh_toggle_menu.js
 
diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py
index 7ec598bb..8802e6e3 100644
--- a/ckanext/odsh/plugin.py
+++ b/ckanext/odsh/plugin.py
@@ -59,7 +59,7 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
     def update_config(self, config_):
         toolkit.add_template_directory(config_, 'templates')
         toolkit.add_public_directory(config_, 'public')
-        toolkit.add_resource('fanstatic', 'odsh')
+        toolkit.add_resource('fanstatic', 'ckanext-odsh')
 
 
     # IDatasetForm
diff --git a/ckanext/odsh/templates/base.html b/ckanext/odsh/templates/base.html
index 610e39a2..fc19aedb 100644
--- a/ckanext/odsh/templates/base.html
+++ b/ckanext/odsh/templates/base.html
@@ -4,6 +4,7 @@
   {% asset 'ckanext-odsh/odsh_base_script' %}
 {% endblock scripts %}
 {% block styles %}
+  {{ super() }}
   {% asset 'ckanext-odsh/odsh_base_style' %}
 {% endblock styles %}
 
diff --git a/ckanext/odsh/templates/package/search.html b/ckanext/odsh/templates/package/search.html
index 899ff427..714f9ea5 100644
--- a/ckanext/odsh/templates/package/search.html
+++ b/ckanext/odsh/templates/package/search.html
@@ -1,6 +1,7 @@
 {% ckan_extends %}
 
 {% block styles %}
+  {{ super() }}
   {% asset 'ckanext-odsh/odsh_datepicker_style' %}
 {% endblock styles %}
 
-- 
GitLab