summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-11-15 11:51:49 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-02-19 14:45:55 +0100
commitf3764eea1ac4a6cdb12095322a00fd93d377c2c5 (patch)
tree878cc3ba5ce98d1d7ed28e264d54f4ca4efbdf0d /archaeological_context_records
parenta2de2eb42009de3b8bf56f2af2a6071a4a98fd8f (diff)
downloadIshtar-f3764eea1ac4a6cdb12095322a00fd93d377c2c5.tar.bz2
Ishtar-f3764eea1ac4a6cdb12095322a00fd93d377c2c5.zip
✨ adapt sheet to manage sheet filters
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/models.py4
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecord.html10
2 files changed, 13 insertions, 1 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py
index dbd7bc463..8046cef7e 100644
--- a/archaeological_context_records/models.py
+++ b/archaeological_context_records/models.py
@@ -836,6 +836,10 @@ class ContextRecord(
]
UPPER_GEO = ["operation", "archaeological_site"]
UPPER_PERMISSIONS = [(Operation, "operation_id")]
+ SHEET_EMPTY_KEYS = [
+ "m2m_listing", "interpretation", "activity", "taq", "taq_estimated", "tpq",
+ "tpq_estimated"
+ ]
history = HistoricalRecords(bases=[HistoryModel])
objects = UUIDModelManager()
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
index ff2877176..5c2f46664 100644
--- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
@@ -139,9 +139,10 @@
</div>
</div>
<hr class="clearfix">
+ {% if item.excavation_technics or item.documentations or item.opening_date or item.closing_date or item.structures or item.textures or item.inclusions or item.colors or item.details_on_color or item.filling or item.description %}
<h3>{% trans "Description" %}</h3>
<div class="row">
- {% field_flex_multiple_obj "Excavation techniques" item 'excavation_technics' %}
+ {% field_flex_multiple_obj _("Excavation technics") item 'excavation_technics' %}
{% field_flex_multiple_obj "Documentation" item 'documentations' %}
{% field_flex "Opening date" item.opening_date|date:"DATE_FORMAT" %}
{% field_flex "Closing date" item.closing_date|date:"DATE_FORMAT" %}
@@ -153,6 +154,8 @@
{% field_flex_full "Filling" item.filling "<pre>" "</pre>" %}
{% field_flex_full "Description" item.description "<pre>" "</pre>" %}
</div>
+ {% endif %}
+ {% if item.surface or item.length or item.excavated_length or item.width or item.excavated_width or item.diameter or item.depth or item.thickness or item.depth_of_appearance %}
<h3>{% trans "Dimensions" %}</h3>
<div class="row">
{% if item.surface %}
@@ -172,6 +175,7 @@
{% field_flex "Thickness (m)" item.thickness %}
{% field_flex "Depth of appearance (m)" item.depth_of_appearance %}
</div>
+ {% endif %}
{% if item.main_geodata or item.town or item.location %}
<h3>{% trans "Geographic localisation" %}</h3>
@@ -186,10 +190,14 @@
</div>
{% endif %}
+ {% if not is_external %}
+ {% if item.history_creator or item.last_edition_date or item.created %}
<h3>{% trans "Sheet" %}</h3>
<div class="row">
{% include "ishtar/blocks/sheet_creation_section.html" %}
</div>
+ {% endif %}
+ {% endif %}
</div>
{% if display_interpretation %}
<div class="tab-pane fade" id="{{window_id}}-interpretation"