summaryrefslogtreecommitdiff
path: root/archaeological_finds/templates/ishtar/sheet_find.html
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/templates/ishtar/sheet_find.html')
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html162
1 files changed, 104 insertions, 58 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index c5d3eb638..d23de0e8e 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -1,5 +1,5 @@
{% extends "ishtar/sheet.html" %}
-{% load i18n window_field from_dict %}
+{% load i18n window_field from_dict link_to_window %}
{% block head_sheet %}
{{block.super}}
@@ -10,7 +10,7 @@
{% if previous or next %}
<div class='tool'>
-{%if previous%}
+{% if previous %}
<a href="#" onclick='load_window("{% url show-historized-find item.pk previous|date:"c"%}");$("#{{window_id}}").hide();return false;'>{%trans "Previous version"%} ({{previous}})</a>
{% endif %}
{% if previous and next %} - {% endif %}
@@ -25,84 +25,125 @@
<div class='tool modify'><a href='{% url find_modify item.pk %}'>{% trans "Modify" %}</a></div>
{% if item.image %}
-<a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}"><img src='{{item.thumbnail.url}}'/></a>
+<a href='{{item.image.url}}' rel="prettyPhoto" title="{{item.label}}" class='photo'><img src='{{item.thumbnail.url}}'/></a>
{% endif%}
-{% field "Free-ID" item.label %}
-{% field "Previous ID" item.previous_id %}
-{% field "Description" item.description %}
-{% field "Created by" item.history_creator.ishtaruser.full_label %}
-{% field "Administrative index" item.administrative_index %}
-{% field_multiple "Material types" item.material_types %}
-{% field "Dating" item.dating %}
-{% field "Length (cm)" item.length %}
-{% field "Width (cm)" item.width %}
-{% field "Height (cm)" item.height %}
-{% field "Diameter (cm)" item.diameter %}
-{% field "Volume (l)" item.volume %}
+<ul class='form-flex'>
+{% field_li "Free-ID" item.label %}
+{% field_li "Previous ID" item.previous_id %}
+{% field_li "Description" item.description %}
+{% field_li "Created by" item.history_creator.ishtaruser.full_label %}
+{% field_li "Administrative index" item.administrative_index %}
+{% field_li_multiple "Material types" item.material_types %}
+{% field_li "Dating" item.dating %}
+{% field_li "Length (cm)" item.length %}
+{% field_li "Width (cm)" item.width %}
+{% field_li "Height (cm)" item.height %}
+{% field_li "Diameter (cm)" item.diameter %}
+{% field_li "Volume (l)" item.volume %}
{% if item.weight %}{% with item.weight|add:' '|add:item.weight_unit as weight %}
-{% field "Weight" weight %}
+{% field_li "Weight" weight %}
{% endwith %}{% endif %}
-{% field "Weight" item.weight %}
+{% if item.dimensions_comment %}
+</ul>
+{% field "Dimensions comment" item.dimensions_comment "<pre>" "</pre>" %}
+<ul class='form-flex'>
+{% endif %}
-{% field "Find number" item.find_number %}
-{% field "Conservatory state" item.conservatory_state %}
-{% field_multiple "Type of preservation to consider" item.preservation_to_considers %}
-{% field_multiple "Object types" item.object_types %}
-{% field_multiple "Integrity" item.integrities %}
+{% field_li "Find number" item.find_number %}
+{% field_li "Conservatory state" item.conservatory_state %}
+{% if item.conservatory_comment %}
+</ul>
+{% field "Conservatory comment" item.conservatory_comment "<pre>" "</pre>" %}
+<ul class='form-flex'>
+{% endif %}
+{% field_li_multiple "Type of preservation to consider" item.preservation_to_considers %}
+{% field_li_multiple "Object types" item.object_types %}
+{% field_li_multiple "Integrity" item.integrities %}
{% if item.CHECK_DICT %}
-{% field "Checked" item.checked|from_dict:item.CHECK_DICT %}
+{% field_li "Checked" item.checked|from_dict:item.CHECK_DICT %}
{% endif%}
{% if item.history_object and item.history_object.CHECK_DICT %}
-{% field "Checked" item.checked|from_dict:item.history_object.CHECK_DICT %}
+{% field_li "Checked" item.checked|from_dict:item.history_object.CHECK_DICT %}
{% endif%}
+{% field_li "Container" item.container %}
+</ul>
-{% if item.upstream_treatment %}<p><label>{%trans "Upstream treatment"%}{% trans ":"%}</label>
-<span class='value'>{{item.upstream_treatment}} ({% for up in item.upstream_treatment.upstream_treatment.all %}{% if forloop.counter0 %}, {%endif %}{{up}}{% endfor %})</span></p>{% endif%}
-{% if item.downstream_treatment %}<p><label>{%trans "Downstream treatment"%}{% trans ":"%}</label>
-<span class='value'>{{item.downstream_treatment}} ({% for dt in item.downstream_treatment.downstream_treatment.all %}{% if forloop.counter0 %}, {%endif %}{{dt}}{% endfor %})</span></p>{% endif%}
-{% if item.container %}<p><label>{%trans "Container"%}{% trans ":"%}</label>
-<span class='value'>{{item.container}}</span></p>{% endif%}
+{% if item.upstream_treatment %}
+<table class='simple' id='{{window_id}}-upstream'>
+ <caption>{% trans "Upstream treatment" %}</caption>
+ <tr>
+ <th>{% trans "Type" %}</th>
+ <th>{% trans "Related find" %}</th>
+ <th>{% trans "Person" %}</th>
+ <th>{% trans "Container" %}</th>
+ <th>{% trans "Start date" %}</th>
+ <th>{% trans "End date" %}</th>
+ </tr>
+ {% for items, treatment in item.upstream_treatments %}
+ <tr>
+ <td class='string'>{{ treatment.treatment_type }}</td>
+ <td class='item-list'>{% for item in items %}<span>{{item}} {{ item|link_to_window}}</span>{% endfor %}</td>
+ <td class='string'>{{ treatment.person|default_if_none:"-" }}</td>
+ <td class='string'>{{ treatment.container|default_if_none:"-" }}</td>
+ <td class='string'>{{ treatment.start_date|default_if_none:"-" }}</td>
+ <td class='string'>{{ treatment.end_date|default_if_none:"-" }}</td>
+ </tr>
+ {% endfor %}
+</table>
+{% endif %}
+
+{% if item.downstream_treatment %}
+<table class='simple' id='{{window_id}}-downstream'>
+ <caption>{% trans "Downstream treatment" %}</caption>
+ <tr>
+ <th>{% trans "Type" %}</th>
+ <th>{% trans "Related find" %}</th>
+ <th>{% trans "Person" %}</th>
+ <th>{% trans "Start date" %}</th>
+ <th>{% trans "End date" %}</th>
+ </tr>
+ {% for items, treatment in item.downstream_treatments %}
+ <tr>
+ <td class='string'>{{ treatment.treatment_type }}</td>
+ <td class='item-list'>{% for item in items %}<span>{{item}} {{ item|link_to_window}}</span>{% endfor %}</td>
+ <td class='string'>{{ treatment.person|default_if_none:"" }}</td>
+ <td class='string'>{{ treatment.start_date|default_if_none:"" }}</td>
+ <td class='string'>{{ treatment.end_date|default_if_none:"" }}</td>
+ </tr>
+ {% endfor %}
+</table>
+{% endif %}
<h3>{% trans "Associated base finds"%}</h3>
{% for base_find in item.base_finds.all %}
-<p><label>{%trans "Complete ID"%}{% trans ":"%}</label>
-<span class='value'>{{base_find.complete_id}}</span></p>
-
-{% field "Short ID" base_find.short_id %}
+<ul class='form-flex'>
+{% field_li "Complete ID" base_find.complete_id %}
+{% field_li "Short ID" base_find.short_id %}
{% if base_find.IS_ISOLATED_DICT %}
-{% field "Batch/object" base_find.batch|from_dict:base_find.IS_ISOLATED_DICT %}
+{% field_li "Batch/object" base_find.batch|from_dict:base_find.IS_ISOLATED_DICT %}
{% endif %}
{% if base_find.history_object and base_find.history_object.IS_ISOLATED_DICT %}
-{% field "Batch/object" base_find.batch|from_dict:base_find.history_object.IS_ISOLATED_DICT %}
+{% field_li "Batch/object" base_find.batch|from_dict:base_find.history_object.IS_ISOLATED_DICT %}
{% endif %}
-{% if base_find.discovery_date %}
-<p><label>{%trans "Discovery date"%}{% trans ":"%}</label>
-<span class='value'>{{base_find.discovery_date}}</span></p>
-{% endif%}
-{% if base_find.description %}
-<p><label>{%trans "Description"%}{% trans ":"%}</label>
-<span class='value'>{{base_find.description}}</span></p>
-{% endif%}
-{% field "Comment" base_find.comment "<pre>" "</pre>" %}
-{% if base_find.special_interest %}
-<p><label>{%trans "Special interest"%}{% trans ":"%}</label>
-<span class='value'>{{base_find.special_interest}}</span></p>
-{% endif%}
+{% field_li "Discovery date" base_find.discovery_date %}
+{% field_li "Special interest" base_find.special_interest %}
+{% field_li_detail "Context record" base_find.context_record %}
+{% if base_find.context_record %}{% field_li "Parcel" base_find.context_record.parcel %}
+{% field_li_detail "Operation" base_find.context_record.operation %}{% endif %}
+</ul>
-<p><label>{%trans "Related context record"%}{% trans ":"%}</label>
-<span class='value'><a href="#" onclick='load_window("{% url show-contextrecord base_find.context_record.pk ''%}");'>{{ base_find.context_record }}</a></span></p>
-<p><label>{%trans "Related parcel"%}{% trans ":"%}</label>
-<span class='value'>{{base_find.context_record.parcel}}</span></p>
-<p><label>{%trans "Related operation"%}{% trans ":"%}</label>
-<span class='value'><a href="#" onclick='load_window("{% url show-operation base_find.context_record.operation.pk ''%}");'>{{ base_find.context_record.operation }}</a></span></p>
+{% field "Description" base_find.description "<pre>" "</pre>" %}
+{% field "Comment" base_find.comment "<pre>" "</pre>" %}
{% if forloop.counter0 %}<hr/>{% endif %}
{% endfor %}
-<table class='simple'>
+{% if item.source.count %}
+<h3>{% trans "Documents"%}</h3>
+<table id='{{window_id}}-docs'>
<caption>{%trans "Documents"%}</caption>
<tr>
<th>{% trans "Title" %}</th>
@@ -115,11 +156,16 @@
<td class='string'>{{ doc.title }}</td>
<td class='string'>{{doc.source_type}}</td>
<td class='string'>{{ doc.authors.all|join:", " }}</td>
- <td class='string'>{% if doc.associated_url %}<a href='{{doc.associated_url}}'>{% trans "Link"%}</a>{% endif %}</td>
+ <td class='string'>{% if doc.associated_url %}<a href='{{doc.associated_url}}' target="_blank">{% trans "Link"%}</a>{% endif %}</td>
</tr>
{% empty %}
- <tr><td colspan="4" class='no_items'>{% trans "No document associated to this find" %}</td></tr>
{% endfor %}
</table>
+<script type='text/javascript'>
+tableToGrid('#{{window_id}}-docs', {
+ width: null, shrinkToFit: false});
+</script>
+{% endif %}
+
{% endblock %}