From 76213d9849e9a7f5e20acc3489cbf37851266826 Mon Sep 17 00:00:00 2001 From: alexandru-m-g Date: Fri, 12 Jul 2024 19:08:46 +0300 Subject: [PATCH 1/2] Make sure hdx-util-lib.js doesn't load twice --- ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml index e0c944560b..74ac875f2c 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml @@ -534,7 +534,6 @@ onboarding-select-org-scripts: - hdx_theme/ckan - hdx_theme/onboarding-select-org-styles contents: - - base/hdx-util-lib.js - widget/onboarding/select-organisation.js onboarding-select-org-styles: From e4a05f34e797652750d992d1179790455cff13d2 Mon Sep 17 00:00:00 2001 From: alexandru-m-g Date: Sat, 13 Jul 2024 01:12:24 +0300 Subject: [PATCH 2/2] HDX-9962 do not load old select2 version on all light pages - some light pages (new onboarding) use a newer select2 v4. Both old and new select2 should NOT be loaded at the same time on a page (causes problems) - on the FAQ page, the select2.css needs to be loaded before other css --- ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml | 4 ++-- .../ckanext/hdx_theme/templates/faq_others/faq/main.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml index 74ac875f2c..e3c5e7bbc3 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml +++ b/ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/webassets.yml @@ -128,7 +128,7 @@ page-light-scripts: preload: - hdx_theme/ckan contents: - - select2/select2.js +# - select2/select2.js - base/header-init.js - widget/contribute/contribute.js - hdx-show-more @@ -137,7 +137,7 @@ page-light-styles: output: ckanext-hdx_theme/%(version)s_page-light-styles.css <<: *common-css contents: - - select2/select2.css +# - select2/select2.css - page-common-styles - light/page-light.css - search-styles diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/faq_others/faq/main.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/faq_others/faq/main.html index 1c8b1b3cd4..e77434cfd6 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/faq_others/faq/main.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/faq_others/faq/main.html @@ -1,6 +1,7 @@ {% extends "page_light.html" %} {%- block styles %} + {% asset 'vendor/select2-css' %} {{ super() }} {% asset 'hdx_theme/faq-styles' %} {% endblock %}