From 2a9e97465254d426d2e1ae3f1d295298312f772c Mon Sep 17 00:00:00 2001 From: Joaquim Nallar Date: Tue, 9 Jan 2024 16:21:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[Bug]=20fix:=20Display=20only=20?= =?UTF-8?q?related=20project=20Intervention=20on=20map=20#3878?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.rst | 2 +- .../maintenance/templates/maintenance/project_detail.html | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index ca56375ed1..0a59d55e6c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -32,7 +32,7 @@ CHANGELOG **Bug fixes** - Extract all geometry types in views `v_outdoor_sites` and `v_outdoor_courses` (#3603) - +- Display only related project Intervention on map (#3878) 2.101.4 (2023-11-15) ------------------------ diff --git a/geotrek/maintenance/templates/maintenance/project_detail.html b/geotrek/maintenance/templates/maintenance/project_detail.html index eb9a9f2016..9be09c10f0 100644 --- a/geotrek/maintenance/templates/maintenance/project_detail.html +++ b/geotrek/maintenance/templates/maintenance/project_detail.html @@ -102,14 +102,13 @@ // // Load intervention layer filtered on project - var layer_url = "{% url 'maintenance:intervention-drf-list' %}?project={{ object.pk}}"; + var layer_url = "{% url 'maintenance:intervention-drf-list' format='geojson' %}?project={{ object.pk}}"; var DETAIL_STYLE = L.Util.extend(window.SETTINGS.map.styles.detail, {clickable: true}); var layer = new L.ObjectsLayer(layer_url, { style: DETAIL_STYLE, objectUrl: interventionUrl, onEachFeature: showInterventionLabel, - modelname: 'intervention', }); layer.addTo(map); layer.on('data:load', function (e) { @@ -123,7 +122,7 @@ function interventionUrl(properties, layer) { return window.SETTINGS.urls.detail.replace(new RegExp('modelname', 'g'), 'intervention') - .replace('0', properties.pk); + .replace('0', properties.id); }; });