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) --- CHANGES.md | 1 + archaeological_context_records/models.py | 3 ++- .../templates/ishtar/sheet_contextrecord.html | 7 +++---- archaeological_finds/models_finds.py | 3 ++- archaeological_finds/templates/ishtar/sheet_basefind.html | 2 ++ archaeological_finds/templates/ishtar/sheet_find.html | 7 +++---- archaeological_operations/models.py | 8 +++++--- archaeological_operations/templates/ishtar/sheet_operation.html | 7 +++---- archaeological_operations/templates/ishtar/sheet_site.html | 6 +++--- archaeological_warehouse/templates/ishtar/sheet_container.html | 5 ++--- archaeological_warehouse/templates/ishtar/sheet_warehouse.html | 7 +++---- ishtar_common/views_item.py | 2 ++ 12 files changed, 31 insertions(+), 27 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 18d0937cb..59afd4e59 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -39,6 +39,7 @@ Ishtar changelog - Document - source type is now a hierarchic search - Find form: remove TAQ/TPQ check - File: filter plan action when preventive_operator is activated in profile +- Profile: do not display geo item list when mapping is deactivated - Sheet: - fix treatment and file treatment sheet display (bad QR code link) - Operation - statistics number of parcels fix diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index bfdda4bfe..3ff8f9d3f 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -1114,7 +1114,8 @@ class ContextRecord( actions = super(ContextRecord, 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: actions.append(self.get_add_geo_action()) can_create_find = self.can_do(request, "add_find") diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index d82766305..79f58b94d 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -30,7 +30,6 @@ {% with has_finds=item|safe_or:"base_finds.count" %} {% with display_finds=has_finds|and_:can_view_finds %} {% with display_data=item.data %} -{% with display_geo=item.geodata.count %} {% if output != "ODT" and output != "PDF"%}