From 32b4271ea9e7540a7613429563fffde20e57690d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 6 Feb 2025 15:24:37 +0100 Subject: 🐛 more robust filters for sheets (refs #6109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/ishtar/sheet_container.html | 12 ++++++------ .../templates/ishtar/sheet_warehouse.html | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'archaeological_warehouse') diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index c34e5de7c..a3acd20e7 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -10,9 +10,9 @@ {% endblock %} {% block content %} -{% with has_image=item.images.count %} +{% with has_image=item|safe_or:"images.count"|safe_and_not:"images_not_available" %} {% with can_view_documents=permission_view_own_document|or_:permission_view_document %} -{% with has_documents=item.documents.count %} +{% with has_documents=item|safe_or:"documents.count|documents_list"|safe_and_not:"documents_not_available" %} {% with display_documents=can_view_documents|and_:has_documents %} {% with permission_change_own_geovectordata=permission_change_own_geovectordata %} @@ -69,7 +69,7 @@ role="tabpanel" aria-labelledby="{{window_id}}-general-tab">
- {% if has_image %} + {% if has_image and item.images.count %}
{% include "ishtar/blocks/window_image.html" %}
@@ -186,19 +186,19 @@ role="tabpanel" aria-labelledby="{{window_id}}-content-tab"> {% if item.container_content.count or item.children.count or item.contained_documents.count %} - {% if item.children.count %} + {% if item.children.count and not item.children_not_available %}

{% trans "Divisions" %}

{% dynamic_table_document '' 'divisions' 'container_tree_child__container_parent__id' item.pk 'TABLE_COLS' output %}

{% trans "Containers" %}

{% dynamic_table_document '' 'non-divisions' 'container_tree_child__container_parent__id' item.pk 'TABLE_COLS' output %} {% endif %} - {% if item.container_content.count %} + {% if item.container_content.count and not item.container_content_not_available %}

{% trans "Finds" %}

{% dynamic_table_document '' 'finds_inside_container' 'container' item.pk 'TABLE_COLS' output 'large' %} {% endif %} - {% if item.contained_documents.count %} + {% if item.contained_documents.count and not item.contained_documents_not_available %} {% trans "Documents" as document_lbl %} {% dynamic_table_document document_lbl 'documents' 'container_id' item.pk 'TABLE_COLS' output 'large' %} {% endif %} diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html index 377f3a5d3..68e0c0174 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -8,7 +8,7 @@ {% block content %} {% with can_view_documents=permission_view_own_document|or_:permission_view_document %} -{% with has_documents=item.documents.count %} +{% with has_documents=item|safe_or:"documents.count|documents_list"|safe_and_not:"documents_not_available" %} {% with display_documents=can_view_documents|and_:has_documents %} {% with permission_change_own_geovectordata=permission_change_own_geovectordata %} @@ -138,7 +138,7 @@
- {% if item.containers.count %} + {% if item.containers.count and not item.containers_not_available %}

{% trans "Divisions" %}

{% dynamic_table_document '' 'divisions' 'location_id' item.pk 'TABLE_COLS' output %}

{% trans "Containers" %}

-- cgit v1.2.3