From b764e4136d39a041cd86094b34f462cfc128b0a6 Mon Sep 17 00:00:00 2001 From: "Sofian A. Thibaut" Date: Thu, 24 Oct 2024 09:52:06 +0200 Subject: [PATCH 1/4] Add missing htmx import --- assets/scripts/map_libre/events.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/scripts/map_libre/events.js b/assets/scripts/map_libre/events.js index 093842183..363850d79 100644 --- a/assets/scripts/map_libre/events.js +++ b/assets/scripts/map_libre/events.js @@ -1,3 +1,4 @@ +import htmx from 'htmx.org' import { formatData } from './utils.js' export default class Events From 6a61b37f2928a0c2911b6e36f265944d9c88b788 Mon Sep 17 00:00:00 2001 From: "Sofian A. Thibaut" Date: Thu, 24 Oct 2024 09:53:00 +0200 Subject: [PATCH 2/4] Fix htmx syntax error --- .../templates/project/components/charts/artif_zone_urba.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/templates/project/components/charts/artif_zone_urba.html b/project/templates/project/components/charts/artif_zone_urba.html index a8b1edfba..187f127b4 100644 --- a/project/templates/project/components/charts/artif_zone_urba.html +++ b/project/templates/project/components/charts/artif_zone_urba.html @@ -55,13 +55,13 @@

Détails de l'artificialisation entre {{ diagnostic.first_year_ocsge|stringf

Grandes familles de couverture des sols des surfaces artificialisées

-
+

Grandes familles d'usages du sol des surfaces artificialisées

-
+
From 3a0dea460e0c84ed34c5d123315e52554705fc46 Mon Sep 17 00:00:00 2001 From: "Sofian A. Thibaut" Date: Thu, 24 Oct 2024 09:53:16 +0200 Subject: [PATCH 3/4] Remove extra padding on maplibre template --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index cbe0070f1..89da83c2c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -41,7 +41,7 @@ {% include "header.html" %} -
+
{% if messages %}
From 27c6af7731ea4cc6c67b06443cd0b21dc7d68ab8 Mon Sep 17 00:00:00 2001 From: "Sofian A. Thibaut" Date: Thu, 24 Oct 2024 09:53:33 +0200 Subject: [PATCH 4/4] Remove unused files --- .../project/scripts/fr-callout-read-more.js | 18 ---------- .../scripts/highcharts-custom-buttons.js | 33 ------------------- 2 files changed, 51 deletions(-) delete mode 100644 project/static/project/scripts/fr-callout-read-more.js delete mode 100644 project/static/project/scripts/highcharts-custom-buttons.js diff --git a/project/static/project/scripts/fr-callout-read-more.js b/project/static/project/scripts/fr-callout-read-more.js deleted file mode 100644 index c6e3f5245..000000000 --- a/project/static/project/scripts/fr-callout-read-more.js +++ /dev/null @@ -1,18 +0,0 @@ -const buttons = document.querySelectorAll('.fr-callout-read-more__btn') - -buttons.forEach((button) => -{ - button.addEventListener('click', () => - { - const excerpt = button.parentNode.querySelector('.fr-callout-read-more__excerpt') - const text = button.parentNode.querySelector('.fr-callout-read-more__text') - - const expanded = button.getAttribute('aria-expanded') === 'true' - - button.parentNode.classList.toggle('fr-callout-read-more--expanded') - button.setAttribute('aria-expanded', !expanded) - excerpt.hidden = !expanded - text.hidden = expanded - button.firstChild.data = expanded ? 'Lire plus' : 'Lire moins' - }) -}) diff --git a/project/static/project/scripts/highcharts-custom-buttons.js b/project/static/project/scripts/highcharts-custom-buttons.js deleted file mode 100644 index 1ba8cb040..000000000 --- a/project/static/project/scripts/highcharts-custom-buttons.js +++ /dev/null @@ -1,33 +0,0 @@ -window.htmx.onLoad(() => -{ - // Trigger full screen chart - document.querySelectorAll('.fullscreen-chart').forEach((button) => - { - button.onclick = () => - { - const target = button.dataset.chartTarget - const chartDom = document.getElementById(target) - const chart = Highcharts.charts[Highcharts.attr(chartDom, 'data-highcharts-chart')] - - chart.fullscreen.toggle() - } - }) - - // Export chart - document.querySelectorAll('.export-chart').forEach((button) => - { - button.onclick = (e) => - { - const target = button.dataset.chartTarget - const chartDom = document.getElementById(target) - const chart = Highcharts.charts[Highcharts.attr(chartDom, 'data-highcharts-chart')] - - e.preventDefault() - - chart.exportChart({ - type: button.dataset.type, - scale: 3, - }) - } - }) -})