diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-07-03 20:55:29 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-07-03 20:55:29 +0200 | 
| commit | f6dc6ffebbe7c85acb1d19021757abbacf363566 (patch) | |
| tree | a81cef6146f79fdb506c720866e43d705ab65f7c | |
| parent | 05a714313fc9500068d93b9b522687cc7498cd2d (diff) | |
| download | Ishtar-f6dc6ffebbe7c85acb1d19021757abbacf363566.tar.bz2 Ishtar-f6dc6ffebbe7c85acb1d19021757abbacf363566.zip  | |
Better references for material type (closes #399)
| -rw-r--r-- | ishtar/ishtar_base/models.py | 20 | ||||
| -rw-r--r-- | ishtar/templates/sheet_operation.html | 21 | ||||
| -rw-r--r-- | 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 @@      <td>{{act.signature_date.year}}</td>      <td>{{act.ref_sra}}</td>      <td class='string'>{{act.act_type}}</td> -    <td>{{act.signature_date}}</td> +    <td class="string">{{act.signature_date}}</td>    </tr>    {% empty %}    <tr><td colspan="4" class='no_items'>{% trans "No acts associated to this operation" %}</td></tr> @@ -141,7 +141,7 @@    <tr><td colspan="6" class='no_items'>{% trans "No context record associated to this operation" %}</td></tr>    {% endfor %}  </table> - +<div class='table'>  <table>    <caption>{%trans "Finds"%}</caption>    <tr> @@ -158,19 +158,16 @@    {% for context_record in item.context_record.all %}    {% for find in context_record.base_items.all %}    <tr> -    <td>{{ find.full_label }}</td> +    <td class="ref">{{ find.full_label }}</td>  {# Displayed as (Patriarche operation code)-(Record unit label)-(Finds label). #}  {# or displayed as (Year)-(index)-(Record unit label)-(Finds label). #} -    <td>{{ find.material_type_label }}</td> -{# 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) #} - -    <td class='string'>{{find.context_record}}</td> -    <td>{{ find.get_last_item.dating}}</td>{# TODO .all|join:", " ? #} -    <td>{{ find.get_last_item.description }}</td> +    <td class="ref">{{ find.material_type_label }}</td> +    <td>{{find.context_record.label}}</td> +    <td class='string'>{{ find.get_last_item.dating}}</td>{# TODO .all|join:", " ? #} +    <td class='string'>{{ find.get_last_item.description }}</td>      <td>{{ find.get_last_item.weight }}</td>      <td>{{ find.get_last_item.item_number }}</td> -    <td>{{ item.context_record.parcel.short_label }}</td> +    <td class="ref">{{ context_record.parcel.short_label }}</td>      <td class='link'><a href="#">{% trans "Details" %}</a></td>      {#<a href="#" onclick='load_window("{% url show-find find.pk%}");'>{%trans "Details"%}</a></td>#}    </tr> @@ -181,6 +178,6 @@    <tr><td colspan="9" class='no_items'>{% trans "No find associated to parcel" %} {{parcel.short_label}} {% trans "(no context record)" %}</td></tr>    {% endfor %}  </table> - +</div>  {% 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;  | 
