summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-04-30 16:05:03 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-12 08:43:58 +0200
commit3e08770a223f80409e278b9b9fcf9ec4cbe98966 (patch)
treeb525a13228892ceef1fd12e5e52aa89c786d4c64
parent57cc8c5f51cadeb0f85fbd468723b87d1ffd9990 (diff)
downloadIshtar-3e08770a223f80409e278b9b9fcf9ec4cbe98966.tar.bz2
Ishtar-3e08770a223f80409e278b9b9fcf9ec4cbe98966.zip
Display relation images on the sheet.
-rw-r--r--archaeological_context_records/templates/ishtar/sheet_contextrecord.html9
-rw-r--r--archaeological_operations/templates/ishtar/sheet_operation.html9
-rw-r--r--ishtar_common/templates/ishtar/sheet.html3
3 files changed, 21 insertions, 0 deletions
diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
index 2dd58d49c..dd0579271 100644
--- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
+++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html
@@ -79,6 +79,15 @@
{% trans "Context record relations" as cr_rels %}
{% if item.right_relations.count %}
{% dynamic_table_document cr_rels 'context_records_relations' 'left_record_id' item.pk '' output %}
+
+{% if item.relation_image %}
+<div id="lightgallery-{{window_id}}-relation-image">
+ {% if output != "ODT" %}<a href="{{item.relation_image.url}}">{% endif %}
+ <img src="{{item.relation_image.url}}" class="img-fluid img-thumbnail">
+ {% if output != "ODT" %}</a>{% endif %}
+</div>
+<hr>
+{% endif %}
{% endif %}
diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html
index 8530d0579..7999dc21d 100644
--- a/archaeological_operations/templates/ishtar/sheet_operation.html
+++ b/archaeological_operations/templates/ishtar/sheet_operation.html
@@ -165,6 +165,15 @@
{% if forloop.last %}
</div>{% endif %}
{% endfor %}
+
+{% if item.relation_image %}
+<div id="lightgallery-{{window_id}}-relation-image">
+ {% if output != "ODT" %}<a href="{{item.relation_image.url}}">{% endif %}
+ <img src="{{item.relation_image.url}}" class="img-fluid img-thumbnail">
+ {% if output != "ODT" %}</a>{% endif %}
+</div>
+<hr>
+{% endif %}
{% endif %}
{% if item.archaeological_sites.count %}
diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html
index c5511b859..e12429443 100644
--- a/ishtar_common/templates/ishtar/sheet.html
+++ b/ishtar_common/templates/ishtar/sheet.html
@@ -84,6 +84,9 @@
{% if item.image %}
lightGallery(document.getElementById('lightgallery-{{window_id}}'));
{% endif%}
+ {% if item.relation_image %}
+ lightGallery(document.getElementById('lightgallery-{{window_id}}-relation-image'));
+ {% endif%}
});
</script>
{% endblock %}