diff --git a/docs/changelog.rst b/docs/changelog.rst index ca0e4c1c0f..e52786aa23 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -33,10 +33,8 @@ 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) - Maintenance appears several times on some zoning filters (#3881) - -**Bug fixes** - - Fix sub-language usage (en-US, zh-hant, ...) (#3801) 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); }; });