From b16a39fff95c60711b74ba33977de855d16a1204 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 6 Mar 2023 18:06:01 +0100 Subject: Profile: do not display geo item list when mapping is deactivated (refs #4467) --- archaeological_finds/models_finds.py | 3 ++- archaeological_finds/templates/ishtar/sheet_basefind.html | 2 ++ archaeological_finds/templates/ishtar/sheet_find.html | 7 +++---- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'archaeological_finds') diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 5a9f9e3ae..4b976a730 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -2349,7 +2349,8 @@ class Find( actions = super(Find, self).get_extra_actions(request) is_locked = hasattr(self, "is_locked") and self.is_locked(request.user) - can_add_geo = self.can_do(request, "add_geovectordata") + profile = get_current_profile() + can_add_geo = profile.mapping and self.can_do(request, "add_geovectordata") if can_add_geo: if self.base_finds.count() == 1: actions.append(self.base_finds.all()[0].get_add_geo_action()) diff --git a/archaeological_finds/templates/ishtar/sheet_basefind.html b/archaeological_finds/templates/ishtar/sheet_basefind.html index c3ab1c792..2de9f5afe 100644 --- a/archaeological_finds/templates/ishtar/sheet_basefind.html +++ b/archaeological_finds/templates/ishtar/sheet_basefind.html @@ -55,12 +55,14 @@
+ {% if not is_external and SHOW_GEO %}

{% trans "Geographic localisation" %}

{% with geo_item=base_find %} {% include "ishtar/blocks/sheet_map.html"%} {% endwith %}
+ {% endif %}
{% field_flex_full "Point of topographic reference" base_find.topographic_localisation %}
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 9cfcfe707..a628498e0 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -30,7 +30,6 @@ {% with display_warehouse_treatments=item.container|or_:item.container_ref|or_:item.upstream_treatment|or_:item.downstream_treatment|or_:non_modif_treatments_count|or_:associated_treatment_files_count %} {% with can_view_documents=permission_view_own_document|or_:permission_view_document %} {% with display_documents=can_view_documents|and_:item.documents_count %} -{% with display_geo=item.geodata.count %} {% with has_image=item.images_number %} {% if output != "ODT" and output != "PDF"%} @@ -67,7 +66,7 @@ {% endif %} - {% if not is_external and display_geo %} + {% if not is_external and SHOW_GEO %}