From 411ad84b62079aba8468919b1455ca2c7134c820 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 --- 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 +- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 ishtar_common/templates/ishtar/blocks/window_image.html (limited to 'ishtar_common') 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