From e3ce9c77d36db4510076b677ec7ce1e0021a51f8 Mon Sep 17 00:00:00 2001
From: Étienne Loks
Date: Mon, 15 Nov 2021 16:37:42 +0100
Subject: Syndication - serialization - display sheet operation
---
.../templates/ishtar/sheet_operation.html | 83 +++++++++++++++++++---
1 file changed, 73 insertions(+), 10 deletions(-)
(limited to 'archaeological_operations/templates')
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index babcc9ce0..811997515 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -21,9 +21,10 @@
{% with display_data=item.data %}
{% with display_relations=item|safe_or:"right_relations.count|left_relations.count" %}
-{% with display_sites=item|safe_or:"archaeological_sites.count|grouped_parcels|administrative_act.count" %}
+{% with display_sites=item|safe_or:"archaeological_sites.count|grouped_parcels|administrative_act.count|archaeological_sites_list" %}
{% with perm_documents=permission_view_own_document|or_:permission_view_document %}
-{% with display_documents=perm_documents|and_:item.documents.count %}
+{% with has_documents=item|safe_or:"documents.count|documents_list" %}
+{% with display_documents=perm_documents|and_:has_documents %}
{% with perm_context_records=permission_view_own_contextrecord|or_:permission_view_contextrecord %}
{% with has_context_records=item|safe_or:"context_record.count" %}
{% with display_context_records=perm_context_records|and_:has_context_records %}
@@ -31,7 +32,7 @@
{% with has_finds=item|safe_or:"has_finds" %}
{% with display_finds=perm_find|and_:has_finds %}
-{% if output != "ODT" and output != "PDF"%}
+{% if output != "ODT" and output != "PDF" %}
-
{% endif %}
+ {% if not is_external %}
-
+ {% endif %}
{% endif %}
@@ -131,7 +134,7 @@
{% if next %}
{{ item|m2m_listing:'towns'|join:" ; "|default:'' }}
{% else %}
- {{ item.towns_codes|join:" ; "|default:'' }}
+ {{ item.cached_towns_label }}
{% endif %}
{{item.common_name|default:''}}
@@ -141,13 +144,19 @@
{% trans "Excavation dates (start/end)" as date_label %}
+ {% if not is_external %}
{% with start_date=item.start_date|date:"DATE_FORMAT"|default:"-" %}
{% with end_date=item.excavation_end_date|date:"DATE_FORMAT"|default:"-" %}
{% with dates=start_date|add:" / "|add:end_date %}
{% field_flex_2 date_label dates %}
- {% endwith %}
- {% endwith %}
- {% endwith %}
+ {% endwith %}{% endwith %}{% endwith %}
+ {% else %}
+ {% with start_date=item.start_date|default:"-" %}
+ {% with end_date=item.excavation_end_date|default:"-" %}
+ {% with dates=start_date|add:" / "|add:end_date %}
+ {% field_flex_2 date_label dates %}
+ {% endwith %}{% endwith %}{% endwith %}
+ {% endif %}
-
{% trans "State" %}
@@ -243,10 +252,12 @@
{% field_flex_full "Comment about scientific documentation" item.scientific_documentation_comment "
" "
" %}
+ {% if not is_external %}
{% trans "Sheet"%}
{% include "ishtar/blocks/sheet_creation_section.html" %}
+ {% endif %}
{% if item.virtual_operation %}
@@ -282,7 +293,7 @@
{% if next %}
{% field_flex_full "Towns" item|m2m_listing:'towns'|join:" ; " %}
{% else %}
- {% field_flex_full "Towns" item.towns_codes|join:" ; " %}
+ {{ item.cached_towns_label }}
{% endif %}
{% field_flex "Address" item.address %}
{% if not item.address %}
@@ -301,9 +312,24 @@
{% if display_sites %}
- {% if item.archaeological_sites.count %}
{% trans "Archaeological sites" as archaeologicalsites_label %}
+ {% if item.archaeological_sites.count %}
{% dynamic_table_document archaeologicalsites_label 'sites' 'operations' item.pk '' output %}
+ {% elif item.archaeological_sites_list %}
+
{{archaeologicalsites_label}}
+
+ {% for values in item.archaeological_sites_list %}{% if not forloop.counter0 %}
+
+ {% for value in values %}{{value}} | {% endfor %}
+
+ {% else %}
+
+ {% for value in values %}{{value}} | {% endfor %}
+
+ {% endif %}
+ {% endfor %}
+
{% endif %}
{% if item.parcels.count %}
@@ -322,7 +348,24 @@
{% trans "Document from this operation" as operation_docs %}
+ {% if item.documents.count %}
{% dynamic_table_document operation_docs 'documents' 'operations' item.pk '' output %}
+ {% elif item.documents_list %}
+
{{operation_docs}}
+
+ {% for values in item.documents_list %}{% if not forloop.counter0 %}
+
+ {% for value in values %}{{value}} | {% endfor %}
+
+ {% else %}
+
+ {% for value in values %}{{value}} | {% endfor %}
+
+ {% endif %}
+ {% endfor %}
+
+ {% endif %}
{% endif %}
@@ -414,6 +457,7 @@
{% include "ishtar/blocks/sheet_json.html" %}
{% endif %}
+ {% if not is_external %}
{% trans "Statistics" %}
@@ -538,8 +582,27 @@
{% endif %}
+ {% endif %}
-{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %}
+
+
+
+{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %}
{% endblock %}
\ No newline at end of file
--
cgit v1.2.3