diff --git a/docs/changelog.rst b/docs/changelog.rst index ca56375ed1..73cd1dad58 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 interventions on project detail 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); }; });