summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2026-02-20 13:47:02 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2026-02-23 11:26:43 +0100
commit7b139ec52e8107d00a164941fa8cc13cfedd5d2d (patch)
tree91e2039884dd9990cc62b57c89db6087212c9144 /archaeological_operations
parent3a51b7b0d31b99061541ac71ea7da48735ba8a32 (diff)
downloadIshtar-7b139ec52e8107d00a164941fa8cc13cfedd5d2d.tar.bz2
Ishtar-7b139ec52e8107d00a164941fa8cc13cfedd5d2d.zip
✨ sheet archaeological site - tables for context record from operation or directly link (refs #6623)
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/models.py6
-rw-r--r--archaeological_operations/templates/ishtar/sheet_site.html7
2 files changed, 12 insertions, 1 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index f0fa9c325..8401501b3 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -795,6 +795,12 @@ class ArchaeologicalSite(
base_finds__context_record__archaeological_site__pk=self.pk
)
+ @property
+ def operations_has_cr(self):
+ q = Operation.objects.filter(
+ archaeological_sites__id=self.pk, context_record__isnull=False)
+ return q.exists()
+
def get_extra_actions(self, request, window_id=None):
"""
For sheet template
diff --git a/archaeological_operations/templates/ishtar/sheet_site.html b/archaeological_operations/templates/ishtar/sheet_site.html
index 8b7a0f152..0956478b4 100644
--- a/archaeological_operations/templates/ishtar/sheet_site.html
+++ b/archaeological_operations/templates/ishtar/sheet_site.html
@@ -101,10 +101,15 @@
{% endif %}
{% trans "Context records" as cr_label %}
-{% if item.context_records.count %}
+{% if item.context_records.count and not item.context_record_not_available %}
{% dynamic_table_document cr_label 'context_records' 'archaeological_sites' item.pk '' output %}
{% endif %}
+{% trans "Context records from operations" as cr_label %}
+{% if item.operations_has_cr and not item.context_record_not_available %}
+{% dynamic_table_document cr_label 'context_records' 'archaeological_sites_operations' item.pk '' output %}
+{% endif %}
+
{% if item.finds.count and not item.finds_not_available %}
{% trans "Finds" as finds %}
{% dynamic_table_document finds 'finds' 'base_finds__context_record__archaeological_site' item.pk '' output %}