summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-07-17 01:16:33 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-07-17 01:19:45 +0200
commit29601ea7460e8489426d36fe734bdd81bed11bcc (patch)
tree256b6c3a0ffa31d05e01bbc1b12a43bab4d52008
parent87f02bed4a257e0ac5c92ce7df7f39234d42ce61 (diff)
downloadIshtar-29601ea7460e8489426d36fe734bdd81bed11bcc.tar.bz2
Ishtar-29601ea7460e8489426d36fe734bdd81bed11bcc.zip
Better display of finds in sheets
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecord.html11
-rw-r--r--archaeological_finds/models.py4
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operation.html4
3 files changed, 11 insertions, 8 deletions
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
index d8e06f022..7fd004362 100644
--- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
@@ -100,8 +100,9 @@
<caption>{%trans "Finds"%}</caption>
<tr>
<th>{% trans "Find" %}</th>
+ <th>{% trans "Id by material type" %}</th>
<th>{% trans "Material type" %}</th>
- <th>{% trans "Context record" %}</th>
+ <th>{% trans "Context record" context "short"%}</th>
<th>{% trans "Periods" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Weight" %}</th>
@@ -111,14 +112,14 @@
</tr>
{% for find in item.base_finds.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>
+ <td class="ref">{{ 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 class="string">{{ find.material|default:"" }}</td>
+ <td>{{find.context_record.label}}</td>
<td>{{ find.get_last_find.dating}}</td>{# TODO .all|join:", " ? #}
<td>{{ find.get_last_find.description }}</td>
<td>{{ find.get_last_find.weight }}</td>
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 4d44e67fd..c7ed9083e 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -72,11 +72,11 @@ class BaseFind(BaseHistorizedItem, OwnPerms):
return finds and finds[0]
def full_label(self):
- return self._real_label() or self._temp_label()
+ return self._real_label() or self._temp_label() or u""
def material_type_label(self):
find = self.get_last_find()
- finds = [find and unicode(find.material_type) or '']
+ finds = [find and find.material_type.code or '']
ope = self.context_record.operation
finds += [ope.code_patriarche or \
(unicode(ope.year) + "-" + unicode(ope.operation_code))]
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index 3a6a20e74..1e43c7112 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -145,8 +145,9 @@
<caption>{%trans "Finds"%}</caption>
<tr>
<th>{% trans "Find" %}</th>
+ <th>{% trans "Id by material type" %}</th>
<th>{% trans "Material type" %}</th>
- <th>{% trans "Context record" %}</th>
+ <th>{% trans "Context record" context "short"%}</th>
<th>{% trans "Periods" %}</th>
<th>{% trans "Description" %}</th>
<th>{% trans "Weight" %}</th>
@@ -161,6 +162,7 @@
{# Displayed as (Patriarche operation code)-(Record unit label)-(Finds label). #}
{# or displayed as (Year)-(index)-(Record unit label)-(Finds label). #}
<td class="ref">{{ find.material_type_label }}</td>
+ <td class="string">{{ find.material|default:"" }}</td>
<td>{{find.context_record.label}}</td>
<td class='string'>{{ find.get_last_find.dating}}</td>{# TODO .all|join:", " ? #}
<td class='string'>{{ find.get_last_find.description }}</td>