From f3764eea1ac4a6cdb12095322a00fd93d377c2c5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 15 Nov 2024 11:51:49 +0100 Subject: ✨ adapt sheet to manage sheet filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_operations/models.py | 2 ++ .../templates/ishtar/sheet_administrativeact.html | 2 ++ .../templates/ishtar/sheet_operation.html | 16 +++++++++++----- .../templates/ishtar/sheet_site.html | 2 ++ 4 files changed, 17 insertions(+), 5 deletions(-) (limited to 'archaeological_operations') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 9d0f8142b..84bd8ab2e 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -1555,6 +1555,7 @@ class Operation( "archaeological_sites", ] SERIALIZE_STRING = ["scientist", "in_charge", "cira_rapporteur"] + SHEET_EMPTY_KEYS = ["code_patriarche", "common_name", "short_label"] # fields definition uuid = models.UUIDField(default=uuid.uuid4) @@ -3085,6 +3086,7 @@ class AdministrativeAct(DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter, (("archaeological_finds", "treatment"), "treatment_id"), ] + SHEET_EMPTY_KEYS = ["act_type", "full_ref"] # fields act_type = models.ForeignKey( diff --git a/archaeological_operations/templates/ishtar/sheet_administrativeact.html b/archaeological_operations/templates/ishtar/sheet_administrativeact.html index 1044a3dad..f344a1fb6 100644 --- a/archaeological_operations/templates/ishtar/sheet_administrativeact.html +++ b/archaeological_operations/templates/ishtar/sheet_administrativeact.html @@ -85,10 +85,12 @@ {% endif %} {% if not is_external %} +{% if item.history_creator or item.last_edition_date or item.created %}

{% trans "Sheet"%}

{% include "ishtar/blocks/sheet_creation_section.html" %}
{% endif %} +{% endif %} {% endblock %} diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index be490ba28..8613d2da6 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -147,6 +147,7 @@
{% if item.year %}{% trans "Year" %}{{ item.year|unlocalize }}{% endif %} + {% if next or item.cached_towns_label %} {% trans "Towns" %} {% if next %} {{ item|m2m_listing:'towns'|join:" ; "|default:'' }} @@ -154,6 +155,7 @@ {{ item.cached_towns_label }} {% endif %} + {% endif %} {% if item.common_name %}{% trans "Name" %}{{ item.common_name }}{% endif %} {% if item.address %}{% trans "Address / Locality" %}{{ item.address }}{% endif %}
@@ -174,6 +176,7 @@ {% field_flex_2 date_label dates %} {% endwith %}{% endwith %}{% endwith %} {% endif %}{% endif %} + {% if item.is_active != None %}
{% trans "State" %} @@ -187,7 +190,7 @@ {% trans "Closed operation" %} {% endif %} -
+ {% endif %} {% field_flex_2 "Code DRASSM" item.drassm_code %} {% field_flex_2 "Old code" item.old_code %} @@ -297,7 +300,7 @@ {% endif %} - {% if not item.code_patriarche %} + {% if item.code_patriarche == "" %} {% endif %} - + {% if item.geodata_list or item.towns or item.address or item.associated_file.address or item.associated_file.address_complement or item.associated_file.postal_code %}

{% trans "Geographic localisation" %}

@@ -339,7 +342,7 @@
{% if next %} {% field_flex "Towns" item|m2m_listing:'towns'|join:" ; " %} - {% else %} + {% elif item.towns %} {% field_flex_detail_multiple_full "Towns" item.towns %} {% endif %} {% field_flex "Address" item.address %} @@ -349,12 +352,15 @@ {% field_flex "Postal code" item.associated_file.postal_code %} {% endif %}
+ {% endif %} {% if not is_external %} + {% if item.history_creator or item.last_edition_date or item.created %}

{% trans "Sheet"%}

{% include "ishtar/blocks/sheet_creation_section.html" %}
{% endif %} + {% endif %}
@@ -649,4 +655,4 @@ $(document).ready( function () { {% 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 +{% endblock %} diff --git a/archaeological_operations/templates/ishtar/sheet_site.html b/archaeological_operations/templates/ishtar/sheet_site.html index f87888655..c3154fdf5 100644 --- a/archaeological_operations/templates/ishtar/sheet_site.html +++ b/archaeological_operations/templates/ishtar/sheet_site.html @@ -118,11 +118,13 @@ {% endif %} {% if not is_external %} +{% if item.history_creator or item.last_edition_date or item.created %}

{% trans "Sheet"%}

{% include "ishtar/blocks/sheet_creation_section.html" %}
{% endif %} +{% endif %} {% endwith %} {% endwith %} {% endwith %} {% endblock %} -- cgit v1.2.3