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_warehouse/models.py | 6 +++--- archaeological_warehouse/templates/ishtar/sheet_container.html | 4 +++- archaeological_warehouse/templates/ishtar/sheet_warehouse.html | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'archaeological_warehouse') diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index d39e90e97..e9f012ff7 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -1583,9 +1583,9 @@ class Container( @property def associated_filename(self): filename = datetime.date.today().strftime("%Y-%m-%d") - filename += "-" + self.reference - filename += "-" + self.location.name - filename += "-" + str(self.index) + filename += "-" + (self.reference or "") + filename += "-" + (self.location.name or "") + filename += "-" + str((self.index or "")) if self.cached_division is None: self.skip_history_when_saving = True self.save() diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index a8e2ab13e..c34e5de7c 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -2,7 +2,7 @@ {% load i18n l10n ishtar_helpers window_header window_field window_tables link_to_window %} {% block head_title %}{% trans "Container" %} - -{{ item.reference|default:"" }} ({{ item.container_type|default:"" }}) - {{item.location}} +{{ item.reference|default:"" }}{% if item.container_type %} ({{ item.container_type|default:"" }}){% endif %}{% if item.location %} - {{item.location}}{% endif %} {% endblock %} {% block toolbar %} @@ -173,11 +173,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 %}
{% trans "Sheet"%}
{% include "ishtar/blocks/sheet_creation_section.html" %}
{% endif %} + {% endif %}