From a9a1a82a5cc32ea8e5b7a8051de5ff4cd0c6fdc7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 21 Jul 2014 12:11:57 +0200 Subject: Improve layout of parcels --- archaeological_operations/models.py | 1 + .../ishtar/blocks/window_tables/parcels.html | 22 ++++++++++++++++++++ .../templates/ishtar/sheet_operation.html | 24 +++------------------- 3 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 archaeological_operations/templates/ishtar/blocks/window_tables/parcels.html (limited to 'archaeological_operations') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 7a2748032..020e66bfb 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -631,6 +631,7 @@ class Parcel(LightHistorizedItem): class Meta: verbose_name = _(u"Parcel") verbose_name_plural = _(u"Parcels") + ordering = ('year', 'section', 'parcel_number') @property def short_label(self): diff --git a/archaeological_operations/templates/ishtar/blocks/window_tables/parcels.html b/archaeological_operations/templates/ishtar/blocks/window_tables/parcels.html new file mode 100644 index 000000000..06a1fa7b1 --- /dev/null +++ b/archaeological_operations/templates/ishtar/blocks/window_tables/parcels.html @@ -0,0 +1,22 @@ +{% load i18n %} + + + + + + + + {##} + + {% for parcel in item.grouped_parcels %} + + + + + + {##} + + {% empty %} + + {% endfor %} +
{{ parcels_label }}
{% trans "Town" %}{% trans "Year" %}{% trans "Section" %}{% trans "Parcels" %}{% trans "Owner" %}
{{parcel.town}}{% if parcel.year %}{{parcel.year}}{% endif %}{{parcel.section}}{{parcel.parcel_numbers|join:", "}}{{operation.parcel.owner}}
{% trans "No parcel" %}
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 098bbd72b..0b5e58d56 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -80,27 +80,9 @@

{{ item.lambert_y }}

{{ item.altitude }}

{% endcomment %} - - - - - - - - {##} - - {% for parcel in item.grouped_parcels %} - - - - - - {##} - - {% empty %} - - {% endfor %} -
{%trans "Associated parcels"%}
{% trans "Commune" %}{% trans "Year" %}{% trans "Section" %}{% trans "Parcels" %}{% trans "Owner" %}
{{parcel.town}}{{parcel.year}}{{parcel.section}}{{parcel.parcel_numbers|join:", "}}{{operation.parcel.owner}}
{% trans "No parcel associated to this operation" %}
+ +{% trans "Associated parcels" as parcels_label %} +{% include "ishtar/blocks/window_tables/parcels.html" %} {% trans "Administrativ acts" as administrativeacts_label %} {% table_administrativact administrativeacts_label item.administrative_act.all %} -- cgit v1.2.3