From f4bbccb5214ff0dd2cbd7bc76973f64c06fc9509 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 8 Jun 2022 12:10:44 +0200 Subject: Geodata - geoforms: manage large number of related items - fix zoom - better + button --- ishtar_common/templates/gis/openlayers-osm.html | 2 ++ ishtar_common/templates/ishtar/blocks/sheet_geographic.html | 4 +++- ishtar_common/templates/ishtar/forms/geo_form.html | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ishtar_common/templates/ishtar/forms/geo_form.html (limited to 'ishtar_common/templates') diff --git a/ishtar_common/templates/gis/openlayers-osm.html b/ishtar_common/templates/gis/openlayers-osm.html index 404ab5708..a6797a580 100644 --- a/ishtar_common/templates/gis/openlayers-osm.html +++ b/ishtar_common/templates/gis/openlayers-osm.html @@ -19,5 +19,7 @@ $(document).ready(function() { let layer_extent = features[0].getGeometry().getExtent().slice(0); features.forEach(function(feature){ ol.extent.extend(layer_extent, feature.getGeometry().getExtent())}); {{ module }}.map.getView().fit(layer_extent, {{ module }}.map.getSize()); + let current_zoom = {{ module }}.map.getView().getZoom(); + if ({{ module }}.map.getView().getZoom() > 18) {{ module }}.map.getView().setZoom(18); }); {% endblock %} diff --git a/ishtar_common/templates/ishtar/blocks/sheet_geographic.html b/ishtar_common/templates/ishtar/blocks/sheet_geographic.html index 709186c1e..d1ac63815 100644 --- a/ishtar_common/templates/ishtar/blocks/sheet_geographic.html +++ b/ishtar_common/templates/ishtar/blocks/sheet_geographic.html @@ -28,5 +28,7 @@ {% endfor %} {% if permission_change_geo %} - +
+  {% trans "geo item" %} +
{% endif %} diff --git a/ishtar_common/templates/ishtar/forms/geo_form.html b/ishtar_common/templates/ishtar/forms/geo_form.html new file mode 100644 index 000000000..d09ae22d8 --- /dev/null +++ b/ishtar_common/templates/ishtar/forms/geo_form.html @@ -0,0 +1,10 @@ +{% extends "ishtar/forms/base_related_items.html" %} +{% load i18n %} +{% block form_head %} +{{ block.super }} +{% if form.too_many %} +
+ {% trans "Many items are attached to this geographic item. Only the ten first of each type are displayed in this form." %} +
+{% endif %} +{% endblock %} -- cgit v1.2.3