From 1f24b96e91d69ef4bc41e7d616669e0eb00a60d0 Mon Sep 17 00:00:00 2001 From: Boris De Vloed Date: Sun, 21 Jun 2026 21:34:38 +0200 Subject: [PATCH] source ref labels --- scripts/04_build_maps.py | 2 + scripts/_lib/assets/app.js | 161 ++++++++++++++++++++++++-- scripts/_lib/content_block.py | 210 +++++++++++++++++++++++++++++++++- scripts/_lib/map_template.py | 16 ++- tests/test_content_block.py | 87 ++++++++++++++ 5 files changed, 464 insertions(+), 12 deletions(-) diff --git a/scripts/04_build_maps.py b/scripts/04_build_maps.py index 022a5a6..38737ee 100644 --- a/scripts/04_build_maps.py +++ b/scripts/04_build_maps.py @@ -82,6 +82,7 @@ from _lib.bg.region import derive_region as derive_bg_region from _lib.ch.geometry import CHCommuneIndex, GESitgIndex from _lib.ch.geometry import resolve as ch_resolve_geometry +from _lib.ch.canton import canton_name as ch_canton_name from _lib.ch.region import derive_region as derive_ch_region from _lib.cy.geometry import CYPolygonIndex from _lib.cy.region import derive_region as derive_cy_region @@ -3074,6 +3075,7 @@ def _sources_for(record: dict) -> dict: return { "country": "ch", "canton": record.get("canton") or "", + "canton_name": ch_canton_name(record.get("canton") or "") if record.get("canton") else "", "source_lang": record.get("source_lang") or "", "ofag_repertoire_url": ofag.get("url", ""), "ofag_repertoire_label": ofag.get("label", ""), diff --git a/scripts/_lib/assets/app.js b/scripts/_lib/assets/app.js index 62ccb21..4f341b3 100644 --- a/scripts/_lib/assets/app.js +++ b/scripts/_lib/assets/app.js @@ -48,6 +48,18 @@ si: 'specifikacija proizvoda', hr: 'specifikacija proizvoda', ro: 'caiet de sarcini', + de: 'Produktspezifikation', + hu: 'termékleírás', + bg: 'продуктова спецификация', + gr: 'προδιαγραφή προϊόντος', + cy: 'τεχνικός φάκελος', + sk: 'špecifikácia výrobku', + cz: 'specifikace výrobku', + lu: 'cahier des charges', + be: 'enig document / document unique', + nl: 'enig document', + mt: 'single document', + ch: 'règlement cantonal', }; const GRAPES_INFO = (window.__OWM_DATA && window.__OWM_DATA.grapes_info) || {}; // Slug -> siblings sharing the same VIVC variety id. Used to make the @@ -913,18 +925,29 @@ applyFilter({ fit: true }); }); - // Keyboard/SR path to open an appellation's detail panel — the WebGL polygons - // aren't DOM-reachable, so the facet "open" button is the only non-mouse way - // in. preventDefault/stopPropagation stop the click from toggling the - // enclosing label's filter checkbox. + // Opening an appellation's detail panel from the filter tree, two ways: + // • the `→` open button — the keyboard/SR path (the WebGL polygons aren't + // DOM-reachable, so this is the only non-mouse way in), AND + // • clicking the appellation NAME — the expected "show me this one" gesture, + // matching a map click and the search dropdown. + // The leading checkbox stays a multi-select FILTER: a click landing on the + // input itself toggles it and is handled by the `change` listener, so we bail + // here. preventDefault stops the wrapping