summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2026-04-06 21:36:19 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2026-04-07 19:25:04 +0200
commit053ac5865c80c8857dc887d707fc6a7d83272730 (patch)
tree856d1667eadf0fc8c19743a0b44051dc21c0b0b2 /archaeological_finds
parent6575fb494d82727e0d34287d5d2fb579fb7acd64 (diff)
downloadIshtar-053ac5865c80c8857dc887d707fc6a7d83272730.tar.bz2
Ishtar-053ac5865c80c8857dc887d707fc6a7d83272730.zip
✨ finds - relations between finds: sheet - sheet relations refactorings
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html21
-rw-r--r--archaeological_finds/templates/ishtar/sheet_museum_find.html21
2 files changed, 40 insertions, 2 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index 0ae238d66..ac1ae4f05 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -26,6 +26,7 @@
{% with non_modif_treatments_count=item.non_modif_treatments_count %}
{% with associated_treatment_files_count=item.associated_treatment_files_count %}
+{% with display_relations=item|safe_or:"right_relations.count|left_relations.count"|safe_and_not:"right_relations_not_available"|safe_and_not:"left_relations_not_available" %}
{% with can_view_container=permission_view_own_container|or_:permission_view_container %}
{% 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 dating_list=item|m2m_listing:"datings" %}
@@ -51,6 +52,15 @@
{% trans "Archaeological context" %}
</a>
</li>
+ {% if display_relations %}
+ <li class="nav-item">
+ <a class="nav-link" id="{{window_id}}-relations-tab"
+ data-toggle="tab" href="#{{window_id}}-relations" role="tab"
+ aria-controls="{{window_id}}-relations" aria-selected="false">
+ {% trans "Relations" %}
+ </a>
+ </li>
+ {% endif %}
<li class="nav-item">
<a class="nav-link" id="{{window_id}}-datations-tab"
data-toggle="tab" href="#{{window_id}}-datations" role="tab"
@@ -270,6 +280,15 @@
</div>
</div>
+ {% if display_relations %}
+ <div class="tab-pane fade" id="{{window_id}}-relations"
+ role="tabpanel" aria-labelledby="{{window_id}}-relations-tab">
+ {% with relation_url="/show-find/" %}
+ {% include "ishtar/blocks/sheet_relations.html" %}
+ {% endwith %}
+ </div>
+ {% endif %}
+
<div class="tab-pane fade" id="{{window_id}}-datations"
role="tabpanel" aria-labelledby="{{window_id}}-datations-tab">
<h3>{% trans "Periods / Datings" %}</h3>
@@ -326,7 +345,7 @@
{% endif %}
</div>
-{% 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 %}
<script type='text/javascript'>
$( "#{{window_id}}-tabs" ).on( "tabsactivate", function( event, ui ) {
diff --git a/archaeological_finds/templates/ishtar/sheet_museum_find.html b/archaeological_finds/templates/ishtar/sheet_museum_find.html
index 3acec990e..add8ce512 100644
--- a/archaeological_finds/templates/ishtar/sheet_museum_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_museum_find.html
@@ -26,6 +26,7 @@
{% with non_modif_treatments_count=item.non_modif_treatments_count %}
{% with associated_treatment_files_count=item.associated_treatment_files_count %}
+{% with display_relations=item|safe_or:"right_relations.count|left_relations.count"|safe_and_not:"right_relations_not_available"|safe_and_not:"left_relations_not_available" %}
{% with can_view_container=permission_view_own_container|or_:permission_view_container %}
{% 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 dating_list=item|m2m_listing:"datings" %}
@@ -51,6 +52,15 @@
{% trans "Archaeological context" %}
</a>
</li>
+ {% if display_relations %}
+ <li class="nav-item">
+ <a class="nav-link" id="{{window_id}}-relations-tab"
+ data-toggle="tab" href="#{{window_id}}-relations" role="tab"
+ aria-controls="{{window_id}}-relations" aria-selected="false">
+ {% trans "Relations" %}
+ </a>
+ </li>
+ {% endif %}
<li class="nav-item">
<a class="nav-link" id="{{window_id}}-datations-tab"
data-toggle="tab" href="#{{window_id}}-datations" role="tab"
@@ -270,6 +280,15 @@
</div>
</div>
+ {% if display_relations %}
+ <div class="tab-pane fade" id="{{window_id}}-relations"
+ role="tabpanel" aria-labelledby="{{window_id}}-relations-tab">
+ {% with relation_url="/show-find/" %}
+ {% include "ishtar/blocks/sheet_relations.html" %}
+ {% endwith %}
+ </div>
+ {% endif %}
+
<div class="tab-pane fade" id="{{window_id}}-datations"
role="tabpanel" aria-labelledby="{{window_id}}-datations-tab">
<h3>{% trans "Periods / Datings" %}</h3>
@@ -326,7 +345,7 @@
{% endif %}
</div>
-{% 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 %}
<script type='text/javascript'>
$( "#{{window_id}}-tabs" ).on( "tabsactivate", function( event, ui ) {