summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/ishtar/blocks/window_image.html
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/templates/ishtar/blocks/window_image.html')
-rw-r--r--ishtar_common/templates/ishtar/blocks/window_image.html27
1 files changed, 21 insertions, 6 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/window_image.html b/ishtar_common/templates/ishtar/blocks/window_image.html
index ab1013df9..62623e89d 100644
--- a/ishtar_common/templates/ishtar/blocks/window_image.html
+++ b/ishtar_common/templates/ishtar/blocks/window_image.html
@@ -3,8 +3,17 @@
{% include "ishtar/blocks/window_image_odt.html" %}
{% else %}
<div class="lightgallery-captions">
- {% for image in item.images.all %}
- <div id="lightgallery-{{window_id}}-caption-{{forloop.counter0}}">
+ {% if item.main_image %}{% with image=item.main_image %}
+ <div id="lightgallery-{{window_id}}-caption-0">
+ <span class="close">&times</span>
+ {% include "ishtar/blocks/window_image_detail.html" %}
+ <a href="{% url 'edit-document' image.pk %}">
+ {% trans "Modify" %} &nbsp;<i class="fa fa-pencil"></i>
+ </a>
+ </div>
+ {% endwith %}{% endif %}
+ {% for image in item.images_without_main_image.all %}
+ <div id="lightgallery-{{window_id}}-caption-{{forloop.counter}}">
<span class="close">&times</span>
{% include "ishtar/blocks/window_image_detail.html" %}
<a href="{% url 'edit-document' image.pk %}">
@@ -14,10 +23,16 @@
{% endfor %}
</div>
<div id="lightgallery-{{window_id}}">
- {% for image in item.images.all %}
- <a data-sub-html="#lightgallery-{{window_id}}-caption-{{forloop.counter0}}" href="{{image.image.url}}"{% if not forloop.first %}
- class="lightgallery-subimage"{% endif %}>
- <img{% if forloop.first %} class='card-img-top'{% endif %} src="{{BASE_URL}}{{image.thumbnail.url}}">
+ {% if item.main_image %}{% with image=item.main_image %}
+ <a data-sub-html="#lightgallery-{{window_id}}-caption-0"
+ href="{{image.image.url}}">
+ <img class='card-img-top' src="{{BASE_URL}}{{image.thumbnail.url}}">
+ </a>
+ {% endwith %}{% endif %}
+ {% for image in item.images_without_main_image.all %}
+ <a data-sub-html="#lightgallery-{{window_id}}-caption-{{forloop.counter}}"
+ href="{{image.image.url}}" class="lightgallery-subimage">
+ <img src="{{BASE_URL}}{{image.thumbnail.url}}">
</a>
{% endfor %}
</div>