From 802603ace7dc82084abcb412499b3a194ecab404 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 23 Jun 2020 14:21:39 +0200 Subject: Container: improve sheet layout --- archaeological_warehouse/models.py | 6 +++++- .../templates/ishtar/sheet_container.html | 11 ++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 97fa38c88..565b64af2 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -149,6 +149,10 @@ class Warehouse(Address, DocumentItem, GeoItem, QRCodeItem, DashboardFormItem, def __str__(self): return self.name + @property + def short_label(self): + return self.name + def natural_key(self): return (self.uuid, ) @@ -380,7 +384,6 @@ class WarehouseDivisionLinkManager(models.Manager): container_type__txt_idx=container_type) - class ContainerType(GeneralType): stationary = models.BooleanField( _("Stationary"), default=False, @@ -893,6 +896,7 @@ class Container(DocumentItem, Merge, LightHistorizedItem, QRCodeItem, GeoItem, while parent: localisations.append(parent) parent = parent.parent + localisations.append(self.location) return reversed(localisations) def get_localisation(self, place): diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index 60f49b7ae..c9cbc3e0a 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -2,11 +2,7 @@ {% load i18n window_header window_field window_tables link_to_window %} {% block head_title %}{% trans "Container" %} - -{% if item.cached_division %} -{{item.cached_division}} -{% else %} -{{ item.container_type|default:"" }} {{ item.reference|default:"" }} {% endif %} -- {{ item.location.name|default:"" }} +{{ item.reference|default:"" }} ({{ item.container_type|default:"" }}) - {{item.location}} {% endblock %} {% block toolbar %} @@ -35,9 +31,7 @@ {% else %}
{% endif %} - {% field_flex_detail "Warehouse" item.location %} - {% if item.parent %} -
+
{% trans "Location" %}
- {% endif %} {% include "ishtar/blocks/sheet_creation_section.html" %} {% field_flex_full "Comment" item.comment "
" "
" %} {% include "ishtar/blocks/sheet_json.html" %} -- cgit v1.2.3