From 9af57a1bab9979ed136e2ecb67f0ad11ddbfeeed Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 3 Jan 2019 17:30:02 +0100 Subject: Sheet find: simplify display --- .../templates/ishtar/sheet_find.html | 29 ++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'archaeological_finds/templates') diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 66fcca33e..ee0e67f2e 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -1,5 +1,5 @@ {% extends "ishtar/sheet.html" %} -{% load i18n window_field from_dict link_to_window window_tables window_header humanize %} +{% load i18n ishtar_helpers window_field from_dict link_to_window window_tables window_header humanize %} {% block head_title %}{% trans "Find" %}{% if item.denomination %} - {{item.denomination|default:""}}{% endif %} - {{item.label|default:""}}{% endblock %} @@ -15,6 +15,11 @@ {% endif %} +{% with display_identification=item.integrities.count|or_:item.remarkabilities.count|or_:item.conservatory_state|or_:item.conservatory_comment|or_:item.alterations.count|or_:item.alteration_causes.count|or_:item.preservation_to_considers.count|or_:item.appraisal_date|or_:item.treatment_emergency|or_:item.insurance_value|or_:item.estimated_value|or_:item.datings.count|or_:item.dating_comment %} +{% with display_warehouse_treatments=item.container|or_:item.container_ref|or_:item.upstream_treatment|or_:item.downstream_treatment|or_:item.treatments.count %} +{% with can_view_documents=permission_view_own_document|or_:permission_view_document %} +{% with display_documents=can_view_documents|and_:item.documents.count %} +
@@ -169,6 +176,7 @@ {% include "ishtar/blocks/sheet_creation_section.html" %}
+ {% if display_identification %}
{% if item.integrities.count or item.remarkabilities.count or item.conservatory_state or item.conservatory_comment or item.alterations.count or item.alteration_causes.count or item.preservation_to_considers.count or item.appraisal_date or item.treatment_emergency or item.insurance_value or item.estimated_value %} @@ -227,6 +235,8 @@ {% field_flex_full "Comment on dating" item.dating_comment "
" "
" %} {% endif %}
+ {% endif %} + {% if display_warehouse_treatments %}
{% if item.container_ref %} @@ -365,18 +375,23 @@ {% endif %} {% endif %}
- {% if permission_view_own_document or permission_view_document %}{% if item.documents.count %} + {% endif %} + {% if display_documents %}
{% trans "Associated documents" as finds_docs %} {% dynamic_table_document finds_docs 'documents' 'finds' item.pk '' output %}
- {% endif %}{% endif %} + {% endif %} + {% if item.data %}
{% include "ishtar/blocks/sheet_json.html" %}
+ {% endif %} +{% endwith %}{% endwith %}{% endwith %}{% endwith %} + {% endblock %} -- cgit v1.2.3