summaryrefslogtreecommitdiff
path: root/archaeological_finds/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-15 17:39:37 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-28 11:40:16 +0100
commita5bb90fa9926c2593965dcfe2859388bc542a08c (patch)
tree42b5d3f49b490ca9f99b10e2a1379250e97c88ff /archaeological_finds/templates
parent63ec480b4e617157d7bbb22820272496f14bb771 (diff)
downloadIshtar-a5bb90fa9926c2593965dcfe2859388bc542a08c.tar.bz2
Ishtar-a5bb90fa9926c2593965dcfe2859388bc542a08c.zip
Treatments: manage treatment without find duplication
Diffstat (limited to 'archaeological_finds/templates')
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html39
-rw-r--r--archaeological_finds/templates/ishtar/sheet_treatment.html5
2 files changed, 41 insertions, 3 deletions
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index 021ea5652..a3ad9fca5 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -167,8 +167,41 @@
</div>
{% endif %}
-{% if item.upstream_treatment or item.downstream_treatment %}
+{% if item.upstream_treatment or item.downstream_treatment or item.treatments.count %}
<h3>{% trans "Treatments"%}</h3>
+ <table id='{{window_id}}-treatments' class="table table-striped">
+ <tr>
+ <th>&nbsp;</th>
+ <th>{% trans "Year - index" %}</th>
+ <th>{% trans "Label" %}</th>
+ <th>{% trans "Type" %}</th>
+ <th>{% trans "State" %}</th>
+ <th>{% trans "Related finds (max. 15 displayed)" %}</th>
+ <th>{% trans "Doer" %}</th>
+ <th>{% trans "Container" %}</th>
+ <th>{% trans "Start date" %}</th>
+ <th>{% trans "End date" %}</th>
+ </tr>
+ {% for treatment in item.treatments.all %}
+ <tr>
+ <td>
+ <a class="display_details" href="#"
+ onclick="load_window('{% url 'show-treatment' treatment.id %}/');">
+ <i class="fa fa-info-circle" aria-hidden="true"></i>
+ </a>
+ </td>
+ <td class='string'>{{ treatment.year }} - {{treatment.index}}</td>
+ <td class='string'>{{ treatment.label|default_if_none:"-" }}</td>
+ <td class='string'>{{ treatment.treatment_types_lbl }}</td>
+ <td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td>
+ <td class='item-list'>{% for it in treatment.limited_finds %}<span>{{it}} {{it|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>
{% if item.upstream_treatment %}
<h3>{% trans "Upstream treatment" %}</h3>
@@ -197,7 +230,7 @@
<td class='string'>{{ treatment.label|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.treatment_types_lbl }}</td>
<td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td>
- <td class='item-list'>{% for item in items %}<span>{{item}} {{ item|link_to_window}}</span>{% endfor %}</td>
+ <td class='item-list'>{% for it in items %}<span>{{it}} {{it|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>
@@ -235,7 +268,7 @@
<td class='string'>{{ treatment.label|default_if_none:"-" }}</td>
<td class='string'>{{ treatment.treatment_types_lbl }}</td>
<td class='string'>{{ treatment.treatment_state|default_if_none:"-" }}</td>
- <td class='item-list'>{% for item in items %}<span>{{item}} {{ item|link_to_window}}</span>{% endfor %}</td>
+ <td class='item-list'>{% for it in items %}<span>{{it}} {{ it|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>
diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html
index e9c9c0758..94569b5f6 100644
--- a/archaeological_finds/templates/ishtar/sheet_treatment.html
+++ b/archaeological_finds/templates/ishtar/sheet_treatment.html
@@ -53,6 +53,11 @@
{% include "ishtar/blocks/sheet_json.html" %}
</div>
+{% trans "Related finds" as finds %}
+{% if item.finds.count %}
+{% dynamic_table_document finds 'finds_for_treatment' 'treatments' item.pk 'TABLE_COLS_FOR_OPE' output %}
+{% endif %}
+
{% trans "Upstream finds" as finds %}
{% if item.upstream.count %}
{% dynamic_table_document finds 'finds_for_treatment' 'downstream_treatment' item.pk 'TABLE_COLS_FOR_OPE' output %}