From e92789adec1ed5c510ac54b80a63175f037a7167 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 29 Sep 2015 11:00:49 +0200 Subject: Context record window: dynamic table for find --- .../templates/ishtar/sheet_contextrecord.html | 46 +++------------------- archaeological_finds/views.py | 2 + 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 %}

{% trans "Operation resume"%}

{{ item.operation.year }}

-

{{ item.operation.operation_code }}

+{% field "Numerical reference" item.operation.operation_code %} {% if item.operation.code_patriarche %}

{{ item.operation.code_patriarche }}

@@ -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 %} - - - - - - - - - - - - - - - - - {% for find in item.base_finds.all %} - - {# OPE|MAT.CODE|UE|FIND_index #} - - {# OPE|FIND_index #} - - - - {# TODO .all|join:", " ? #} - - - - - - - - {#{%trans "Details"%}#} - - {% empty %} - - {% endfor %} -
{%trans "Finds"%}
{% trans "Complete Id" %}{% trans "Short Id" %}{% trans "Material type" %}{% trans "Context record" context "short"%}{% trans "Periods" %}{% trans "Description" %}{% trans "Weight" %}{% trans "Numbers" %}{% trans "Parcel" %}{% trans "Container ref." %}{% trans "Warehouse" %} 
{{ find.complete_id|default:""}}{{ find.short_id|default:"" }}{{ find.get_last_find.material_type|default:"" }}{{find.context_record.label}}{{ find.get_last_find.dating}}{{ find.get_last_find.description }}{{ find.get_last_find.weight|default:"" }}{{ find.get_last_find.item_number }}{{ item.context_record.parcel.short_label }}{{ find.get_last_find.container.reference|default:""}}{{ find.get_last_find.container.location|default:""}}
{% trans "No find associated to this context record" %}
+{% 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': -- cgit v1.2.3