From c641fca2bc2bd5c6892b4105325dee99e9da35d6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 18 May 2022 16:24:26 +0200 Subject: Syndication - serialization - display sheet find - 2 --- .../templates/ishtar/sheet_basefind.html | 6 ++- .../templates/ishtar/sheet_find.html | 47 +++++++++++++++++----- 2 files changed, 41 insertions(+), 12 deletions(-) (limited to 'archaeological_finds/templates') diff --git a/archaeological_finds/templates/ishtar/sheet_basefind.html b/archaeological_finds/templates/ishtar/sheet_basefind.html index c57e0d681..0b56727ca 100644 --- a/archaeological_finds/templates/ishtar/sheet_basefind.html +++ b/archaeological_finds/templates/ishtar/sheet_basefind.html @@ -16,8 +16,8 @@
{% field_flex_detail "Operation" base_find.context_record.operation first %} {% field_flex_detail "Archaeological site" base_find.context_record.archaeological_site first %} - {% field_flex_detail "Context record" base_find.context_record first %} - {% field_flex "Town" base_find.context_record.town.label_with_areas '' '' first %} + {% field_flex_detail "Context record" base_find.context_record.short_label first %} + {% field_flex "Town" base_find.context_record.town_label_with_areas '' '' first %} {% field_flex "Parcel" base_find.context_record.parcel '' '' first %} {# START discovery dates #} @@ -48,6 +48,7 @@ {% with item=base_find %} {% include "ishtar/blocks/sheet_json.html" %} {% endwith %} + {% if not is_external %}

{% trans "Sheet"%}

{% with item.history_creation_date|date:"SHORT_DATETIME_FORMAT" as creation_date %} @@ -62,6 +63,7 @@ {% endwith %}{% endwith %} {% endif %}
+ {% endif %} {% if base_find.point_2d or base_find.x or base_find.y or base_find.topographic_localisation %} {% if base_find.point_2d %} diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index dd9c2e059..5b6c38112 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -11,7 +11,7 @@ {% if item.downstream_treatment %} {% endif %} @@ -19,14 +19,13 @@ {% with permission_view_document=permission_view_document %} {% with permission_view_own_document=permission_view_own_document %} -{% with m2m_listing_datings=item|m2m_listing:'datings' %} {% with non_modif_treatments_count=item.non_modif_treatments_count %} {% with associated_treatment_files_count=item.associated_treatment_files_count %} -{% with display_datings=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_:m2m_listing_datings|or_:item.dating_comment|or_:item.cultural_attributions.count %} +{% with display_datings=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.m2m_listing_datings|or_:item.dating_comment|or_:item.cultural_attributions.count %} {% 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_documents=can_view_documents|and_:item.documents_count %} {% if output != "ODT" and output != "PDF"%}
+ {% if is_external %} + {% for base_find in item.base_finds_list %} + {% with first=forloop.first|add:has_image %} + {% include "ishtar/sheet_basefind.html" %} + {% endwith %} + {% endfor %} + {% else %} {% for base_find in item.base_finds.all %} {% with first=forloop.first|add:has_image %} {% include "ishtar/sheet_basefind.html" %} {% endwith %} {% endfor %} + {% endif %}
{% if has_image %}
@@ -206,7 +213,7 @@ {% if display_datings %}
- {% 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 %} + {% 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 %}

{% trans "Preservation" %}

{% field_flex_multiple_obj "Integrity / interest" item 'integrities' %} @@ -223,9 +230,9 @@
{% endif %} - {% if m2m_listing_datings or item.dating_comment or item.cultural_attributions.count %} + {% if item.m2m_listing_datings or item.dating_comment or item.cultural_attributions_count %}

{% trans "Dating" %}

- {% if item.cultural_attributions.count %} + {% if item.cultural_attributions_count %}
{% field_flex_multiple_obj "Cultural attributions" item 'cultural_attributions' %}
@@ -239,7 +246,7 @@ {% trans "Quality" %} {% trans "Precise dating" %} - {% for dating in m2m_listing_datings %} + {% for dating in item.m2m_listing_datings %} {{dating.period}} @@ -285,6 +292,7 @@
@@ -309,6 +320,7 @@
@@ -490,7 +512,12 @@
{% trans "Associated documents" as finds_docs %} + {% if item.documents.count %} {% dynamic_table_document finds_docs 'documents' 'finds' item.pk '' output %} + {% elif item.documents_list %} +

{{finds_docs}}

+ {% include "ishtar/blocks/api_document_list.html" %} + {% endif %}
{% endif %} {% if item.data and item.data|length > 0 %} @@ -501,7 +528,7 @@ {% endif %}
-{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %} +{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %}{% endwith %} {% endblock %} -- cgit v1.2.3