summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecord.html46
-rw-r--r--archaeological_finds/views.py2
2 files changed, 8 insertions, 40 deletions
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
index 8d1a4de63..a984ef8b5 100644
--- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
@@ -1,5 +1,5 @@
{% extends "ishtar/sheet.html" %}
-{% load i18n window_tables %}
+{% load i18n window_field window_tables %}
{% block head_sheet %}
{{block.super}}
@@ -94,7 +94,7 @@
{% if item.operation %}
<h3>{% trans "Operation resume"%}</h3>
<p><label>{%trans "Year:"%}</label> <span class='value'>{{ item.operation.year }}</span></p>
-<p><label>{%trans "Numerical reference:"%}</label> <span class='value'>{{ item.operation.operation_code }}</span></p>
+{% field "Numerical reference" item.operation.operation_code %}
{% if item.operation.code_patriarche %}
<p><label>{%trans "Patriarche OA code:"%}</label>
<span class='value'>{{ item.operation.code_patriarche }}</span></p>
@@ -126,44 +126,10 @@
{% trans "Document from this context record" as cr_docs %}
{% if item.source.count %} {% table_document cr_docs item.source.all %}{% endif %}
-<table class='simple'>
- <caption>{%trans "Finds"%}</caption>
- <tr>
- <th>{% trans "Complete Id" %}</th>
- <th>{% trans "Short Id" %}</th>
- <th>{% trans "Material type" %}</th>
- <th>{% trans "Context record" context "short"%}</th>
- <th>{% trans "Periods" %}</th>
- <th>{% trans "Description" %}</th>
- <th>{% trans "Weight" %}</th>
- <th>{% trans "Numbers" %}</th>
- <th>{% trans "Parcel" %}</th>
- <th>{% trans "Container ref." %}</th>
- <th>{% trans "Warehouse" %}</th>
- <th class='link'>&nbsp;</th>
- </tr>
- {% for find in item.base_finds.all %}
- <tr>
- {# OPE|MAT.CODE|UE|FIND_index #}
- <td class="ref">{{ find.complete_id|default:""}}</td>
- {# OPE|FIND_index #}
- <td class="ref">{{ find.short_id|default:"" }}</td>
- <td class="string">{{ find.get_last_find.material_type|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|default:"" }}</td>
- <td>{{ find.get_last_find.item_number }}</td>
- <td>{{ item.context_record.parcel.short_label }}</td>
- <td class='ref'>{{ find.get_last_find.container.reference|default:""}}</td>
- <td class='string'>{{ find.get_last_find.container.location|default:""}}</td>
- <td class='link'><a class='display_details' href="#">{% trans "Details" %}</a></td>
- {#<a href="#" class='display_details' onclick='load_window("{% url show-find find.pk%}");'>{%trans "Details"%}</a></td>#}
- </tr>
- {% empty %}
- <tr><td colspan="9" class='no_items'>{% trans "No find associated to this context record" %}</td></tr>
- {% endfor %}
-</table>
+{% trans "Finds" as finds %}
+{% if item.base_finds.count %}
+{% dynamic_table_document finds 'finds' 'base_finds__context_record' item.pk %}
+{% endif %}
{% trans "Documents from associated finds" as find_docs %}
{% if item.find_docs_q.count %} {% table_document find_docs item.find_docs_q.all %}{% endif %}
diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py
index 880a3bdfa..5caaae64d 100644
--- a/archaeological_finds/views.py
+++ b/archaeological_finds/views.py
@@ -40,6 +40,8 @@ get_find = get_item(
reversed_bool_fields=['image__isnull'],
base_request={'downstream_treatment__isnull': True},
extra_request_keys={
+ 'base_finds__context_record':
+ 'base_finds__context_record__pk',
'base_finds__context_record__parcel__town':
'base_finds__context_record__parcel__town',
'base_finds__context_record__operation__year':