summaryrefslogtreecommitdiff
path: root/archaeological_finds
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_finds
parenta2de2eb42009de3b8bf56f2af2a6071a4a98fd8f (diff)
downloadIshtar-f3764eea1ac4a6cdb12095322a00fd93d377c2c5.tar.bz2
Ishtar-f3764eea1ac4a6cdb12095322a00fd93d377c2c5.zip
✨ adapt sheet to manage sheet filters
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models_finds.py2
-rw-r--r--archaeological_finds/models_treatments.py1
-rw-r--r--archaeological_finds/templates/ishtar/sheet_basefind.html2
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html4
-rw-r--r--archaeological_finds/templates/ishtar/sheet_findbasket.html3
-rw-r--r--archaeological_finds/templates/ishtar/sheet_museum_find.html4
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatment.html4
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatmentfile.html2
8 files changed, 20 insertions, 2 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index fa3bdb677..93a3286bc 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -2016,6 +2016,8 @@ class Find(
(("archaeological_warehouse", "Warehouse"), "container_ref__responsibility_id"),
]
SHEET_ALTERNATIVES = [("museum", "museum_find")]
+ SHEET_EMPTY_KEYS = ["container_ref", "upstream_treatment", "downstream_treatment",
+ "documents_count", "m2m_listing"]
objects = UUIDModelManager()
# fields
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 3adb73624..935a14f2f 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -1206,6 +1206,7 @@ class TreatmentFile(
}
ALT_NAMES.update(BaseHistorizedItem.ALT_NAMES)
ALT_NAMES.update(DocumentItem.ALT_NAMES)
+ SHEET_EMPTY_KEYS = ["name"]
# fields
year = models.IntegerField(_("Year"), default=get_current_year)
diff --git a/archaeological_finds/templates/ishtar/sheet_basefind.html b/archaeological_finds/templates/ishtar/sheet_basefind.html
index 996e8a8a6..23cccfc9d 100644
--- a/archaeological_finds/templates/ishtar/sheet_basefind.html
+++ b/archaeological_finds/templates/ishtar/sheet_basefind.html
@@ -68,10 +68,12 @@
{% field_flex_full "Point of topographic reference" base_find.topographic_localisation %}
</div>
{% 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>
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index a3ecbdc67..787051efb 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -259,6 +259,8 @@
{% endif %}
{% endwith %}
+ {% if not is_external %}
+ {% if item.history_creator or item.last_edition_date or item.created %}
<h3>{% trans "Sheet" %}</h3>
<div class='row'>
{% trans "Checked" as checked_label %}
@@ -268,6 +270,8 @@
{% endwith %}
{% include "ishtar/blocks/sheet_creation_section.html" %}
</div>
+ {% endif %}
+ {% endif %}
</div>
<div class="tab-pane fade" id="{{window_id}}-warehouse"
role="tabpanel" aria-labelledby="{{window_id}}-warehouse-tab">
diff --git a/archaeological_finds/templates/ishtar/sheet_findbasket.html b/archaeological_finds/templates/ishtar/sheet_findbasket.html
index 4b3d9321e..c846c0494 100644
--- a/archaeological_finds/templates/ishtar/sheet_findbasket.html
+++ b/archaeological_finds/templates/ishtar/sheet_findbasket.html
@@ -21,9 +21,10 @@
{% field_flex_detail_multiple_full treatment_label item.treatment_files %}
</div>
+{% if item.items.exists %}
<h3>{% trans "Content" %}</h3>
{% dynamic_table_document finds 'finds' 'basket_id' item.pk 'TABLE_COLS' output %}
-
+{% endif %}
{% endblock %}
diff --git a/archaeological_finds/templates/ishtar/sheet_museum_find.html b/archaeological_finds/templates/ishtar/sheet_museum_find.html
index 73e76d8bd..3c00a5d38 100644
--- a/archaeological_finds/templates/ishtar/sheet_museum_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_museum_find.html
@@ -238,6 +238,8 @@
{% endif %}
{% endwith %}
+ {% if not is_external %}
+ {% if item.history_creator or item.last_edition_date or item.created %}
<h3>{% trans "Sheet" %}</h3>
<div class='row'>
{% trans "Checked" as checked_label %}
@@ -247,6 +249,8 @@
{% endwith %}
{% include "ishtar/blocks/sheet_creation_section.html" %}
</div>
+ {% endif %}
+ {% endif %}
{% if has_image %}
</div>
{% endif %}
diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html
index ea37897b6..0a23e551a 100644
--- a/archaeological_finds/templates/ishtar/sheet_treatment.html
+++ b/archaeological_finds/templates/ishtar/sheet_treatment.html
@@ -1,7 +1,7 @@
{% extends "ishtar/sheet.html" %}
{% load i18n l10n window_field from_dict link_to_window window_tables window_ope_tables window_header humanize %}
-{% block head_title %}<strong>{% trans "Treatment" %}</strong> - {{ item|default:"" }}{% endblock %}
+{% block head_title %}<strong>{% trans "Treatment" %}</strong> - {{ item.cached_label|default:"" }}{% endblock %}
{% block toolbar %}
{% window_nav item window_id 'show-treatment' 'treatment_modify' 'show-historized-treatment' 'revert-treatment' previous next 1 %}
@@ -99,11 +99,13 @@
</div>
{% 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 %}
{% if has_image %}</div>{% endif %}
</div>
diff --git a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html
index 952171aa1..6cca72570 100644
--- a/archaeological_finds/templates/ishtar/sheet_treatmentfile.html
+++ b/archaeological_finds/templates/ishtar/sheet_treatmentfile.html
@@ -89,11 +89,13 @@
{% 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 %}
{% endwith %}{% endwith %}{% endwith %}
{% endblock %}