From 0a03bce3ad9d464ce2b102b87c884fba338a469b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 3 Jul 2011 20:55:29 +0200 Subject: Better references for material type (closes #399) --- ishtar/ishtar_base/models.py | 20 ++++++-------------- ishtar/templates/sheet_operation.html | 21 +++++++++------------ static/media/style.css | 12 +++++++++++- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/ishtar/ishtar_base/models.py b/ishtar/ishtar_base/models.py index f23417a86..d8aa73059 100644 --- a/ishtar/ishtar_base/models.py +++ b/ishtar/ishtar_base/models.py @@ -943,20 +943,12 @@ class BaseItem(BaseHistorizedItem, OwnPerms): def material_type_label(self): item = self.get_last_item() - lbl = item and (unicode(item.material_type) + unicode(_(":"))) or '' - if self.context_record.parcel.operation.code_patriarche: - return lbl + JOINT.join([unicode(it) for it in ( - self.context_record.parcel.operation.code_patriarche, - self.context_record.label, - self.material_index, - self.label)]) - return lbl + JOINT.join([unicode(it) for it in ( - self.context_record.parcel.year, - self.index, - self.context_record.label, - self.material_index, - self.label)]) - + items = [item and unicode(item.material_type) or ''] + ope = self.context_record.operation + items += [ope.code_patriarche or \ + (unicode(ope.year) + "-" + unicode(ope.operation_code))] + items += [self.context_record.label, unicode(self.material_index)] + return JOINT.join(items) def _real_label(self): if not self.context_record.parcel.operation.code_patriarche: diff --git a/ishtar/templates/sheet_operation.html b/ishtar/templates/sheet_operation.html index 5919d8922..1fb2850c1 100644 --- a/ishtar/templates/sheet_operation.html +++ b/ishtar/templates/sheet_operation.html @@ -90,7 +90,7 @@ {{act.signature_date.year}} {{act.ref_sra}} {{act.act_type}} - {{act.signature_date}} + {{act.signature_date}} {% empty %} {% trans "No acts associated to this operation" %} @@ -141,7 +141,7 @@ {% trans "No context record associated to this operation" %} {% endfor %} - +
@@ -158,19 +158,16 @@ {% for context_record in item.context_record.all %} {% for find in context_record.base_items.all %} - + {# Displayed as (Patriarche operation code)-(Record unit label)-(Finds label). #} {# or displayed as (Year)-(index)-(Record unit label)-(Finds label). #} - -{# Displayed as (Patriarche operation code)-(Record unit label)-(material code)-(Finds label indexed by material type). #} -{# or displayed as (Year)-(index)-(Record unit label)-(material code)-(Finds label indexed by material type) #} - - - {# TODO .all|join:", " ? #} - + + + {# TODO .all|join:", " ? #} + - + {#{%trans "Details"%}#} @@ -181,6 +178,6 @@ {% endfor %}
{%trans "Finds"%}
{{ find.full_label }}{{ find.full_label }}{{ find.material_type_label }}{{find.context_record}}{{ find.get_last_item.dating}}{{ find.get_last_item.description }}{{ find.material_type_label }}{{find.context_record.label}}{{ find.get_last_item.dating}}{{ find.get_last_item.description }} {{ find.get_last_item.weight }} {{ find.get_last_item.item_number }}{{ item.context_record.parcel.short_label }}{{ context_record.parcel.short_label }}
{% trans "No find associated to parcel" %} {{parcel.short_label}} {% trans "(no context record)" %}
- +
{% endblock %} diff --git a/static/media/style.css b/static/media/style.css index fb7248e84..2d8cb7ff7 100644 --- a/static/media/style.css +++ b/static/media/style.css @@ -321,11 +321,16 @@ table.confirm tr.spacer td:last-child{ border-radius:8px; } +#window .table{ + width:730px; + overflow:auto; +} + #window table{ font-size:0.9em; margin:10px 0; - width:100%; border-collapse:collapse; + width:100%; } #window caption{ @@ -349,6 +354,11 @@ table.confirm tr.spacer td:last-child{ text-align:left; } +#window table td.ref{ + text-align:left; + white-space:nowrap; +} + #window table td.no_items{ text-align:center; font-style:italic; -- cgit v1.2.3