From 584309ffdf2a1fc0901d3653b97f02ec95f09e70 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 6 Feb 2018 13:02:42 +0100 Subject: Sheets: use lightgallery to display images on sheets --- .../templates/ishtar/sheet_contextrecord.html | 4 +-- .../templates/ishtar/sheet_file.html | 4 +-- .../templates/ishtar/sheet_find.html | 4 +-- .../templates/ishtar/sheet_treatment.html | 4 +-- .../templates/ishtar/sheet_operation.html | 4 +-- .../templates/ishtar/sheet_container.html | 4 +-- .../templates/ishtar/sheet_warehouse.html | 4 +-- ishtar_common/templates/base.html | 6 ++++ .../templates/ishtar/blocks/window_image.html | 42 ++++++++++++++++++++++ ishtar_common/templates/ishtar/sheet.html | 3 ++ ishtar_common/templates/ishtar/sheet_source.html | 2 +- 11 files changed, 59 insertions(+), 22 deletions(-) create mode 100644 ishtar_common/templates/ishtar/blocks/window_image.html diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 4fa98c6a9..cca8f5375 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -12,9 +12,7 @@
- {% if item.image %} - - {% endif%} + {% include "ishtar/blocks/window_image.html" %}

{{ item.parcel.short_label }}

diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html index 20684baf9..b01fe77f6 100644 --- a/archaeological_files/templates/ishtar/sheet_file.html +++ b/archaeological_files/templates/ishtar/sheet_file.html @@ -17,9 +17,7 @@
- {% if item.image %} - - {% endif%} + {% include "ishtar/blocks/window_image.html" %}

{{item.full_internal_ref|default:''}}

diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 237a4d748..67cd479c3 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -12,9 +12,7 @@
- {% if item.image %} - - {% endif%} + {% include "ishtar/blocks/window_image.html" %}

{{ item.label|default:"" }}

diff --git a/archaeological_finds/templates/ishtar/sheet_treatment.html b/archaeological_finds/templates/ishtar/sheet_treatment.html index c1da714c2..21f0e5370 100644 --- a/archaeological_finds/templates/ishtar/sheet_treatment.html +++ b/archaeological_finds/templates/ishtar/sheet_treatment.html @@ -12,9 +12,7 @@
- {% if item.image %} - - {% endif%} + {% include "ishtar/blocks/window_image.html" %}

{{ item.label|default:"" }}

diff --git a/archaeological_operations/templates/ishtar/sheet_operation.html b/archaeological_operations/templates/ishtar/sheet_operation.html index 24e08eacb..2309262fc 100644 --- a/archaeological_operations/templates/ishtar/sheet_operation.html +++ b/archaeological_operations/templates/ishtar/sheet_operation.html @@ -12,9 +12,7 @@
- {% if item.image %} - - {% endif%} + {% include "ishtar/blocks/window_image.html" %}
diff --git a/archaeological_warehouse/templates/ishtar/sheet_container.html b/archaeological_warehouse/templates/ishtar/sheet_container.html index 9522c302c..d29d74c00 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_container.html +++ b/archaeological_warehouse/templates/ishtar/sheet_container.html @@ -11,9 +11,7 @@
- {% if item.image %} - - {% endif%} + {% include "ishtar/blocks/window_image.html" %}

{{ item.reference|default:"" }}

diff --git a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html index 03a8eec5c..c7a1314d8 100644 --- a/archaeological_warehouse/templates/ishtar/sheet_warehouse.html +++ b/archaeological_warehouse/templates/ishtar/sheet_warehouse.html @@ -11,9 +11,7 @@
- {% if item.image %} - - {% endif%} + {% include "ishtar/blocks/window_image.html" %}

{{ item.name|default:"" }}

diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index b2f0b055c..8608448e7 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -19,6 +19,11 @@ src="{{STATIC_URL}}datatables/datatables.min.js?ver={{VERSION}}"> + + + + + @@ -45,6 +50,7 @@ + {% for url_css in JQGRID_CSS %}{% endfor %} {{EXTRA_CSS|safe}} diff --git a/ishtar_common/templates/ishtar/blocks/window_image.html b/ishtar_common/templates/ishtar/blocks/window_image.html new file mode 100644 index 000000000..4b8e67ea9 --- /dev/null +++ b/ishtar_common/templates/ishtar/blocks/window_image.html @@ -0,0 +1,42 @@ +{% if item.image %} +
+ + + + {% comment %} + + + + + + + + + + + + + + + + + + + + + + + + + + {% endcomment %} +
+{% endif%} diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html index ee57d312d..8cfbe22ca 100644 --- a/ishtar_common/templates/ishtar/sheet.html +++ b/ishtar_common/templates/ishtar/sheet.html @@ -80,6 +80,9 @@ '', function(){$("#{{window_id}}").remove();}, true); }); + {% if item.image %} + lightGallery(document.getElementById('lightgallery-{{window_id}}')); + {% endif%} }); {% endblock %} diff --git a/ishtar_common/templates/ishtar/sheet_source.html b/ishtar_common/templates/ishtar/sheet_source.html index a1a8948dc..bedcb587e 100644 --- a/ishtar_common/templates/ishtar/sheet_source.html +++ b/ishtar_common/templates/ishtar/sheet_source.html @@ -9,7 +9,7 @@
- + {% include "ishtar/blocks/window_image.html" %}
-- cgit v1.2.3