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_operations/models.py | 8 +++++--- archaeological_operations/templates/ishtar/sheet_operation.html | 7 +++---- archaeological_operations/templates/ishtar/sheet_site.html | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'archaeological_operations') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 204385c25..a7a9823b8 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -614,7 +614,8 @@ class ArchaeologicalSite( # url, base_text, icon, extra_text, extra css class, is a quick action actions = super(ArchaeologicalSite, self).get_extra_actions(request) # is_locked = 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: actions.append(self.get_add_geo_action()) @@ -1852,8 +1853,9 @@ class Operation( True, ), ] + actions - - 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: actions.append(self.get_add_geo_action()) can_add_cr = self.can_do(request, "add_contextrecord") diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 8d0b717a3..43148d7e4 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -35,7 +35,6 @@ {% with perm_find=permission_view_own_find|or_:permission_view_find %} {% with has_finds=item|safe_or:"has_finds" %} {% with display_finds=perm_find|and_:has_finds %} -{% with display_geo=item.geodata.count %} {% if output != "ODT" and output != "PDF" %}