summaryrefslogtreecommitdiff
path: root/ishtar_common/templates
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-04-03 17:53:01 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-04-03 17:53:01 +0200
commit0dac9c341be56b382fb6d5b918997aa2f41995ad (patch)
tree475f582e3995d32c460ec3f472c571b80bb27dad /ishtar_common/templates
parent4946ccb057008e3f1154ee3609498b2427933a48 (diff)
downloadIshtar-0dac9c341be56b382fb6d5b918997aa2f41995ad.tar.bz2
Ishtar-0dac9c341be56b382fb6d5b918997aa2f41995ad.zip
Image detail: do not display Modify link when not relevant (refs #5438)
Diffstat (limited to 'ishtar_common/templates')
-rw-r--r--ishtar_common/templates/ishtar/blocks/window_image.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/window_image.html b/ishtar_common/templates/ishtar/blocks/window_image.html
index 409ad25fa..376093171 100644
--- a/ishtar_common/templates/ishtar/blocks/window_image.html
+++ b/ishtar_common/templates/ishtar/blocks/window_image.html
@@ -1,16 +1,19 @@
-{% load i18n link_to_window %}{% if item.images_number %}
+{% load i18n ishtar_helpers link_to_window %}{% if item.images_number %}
{% if output == "ODT" or output == "PDF"%}
{% include "ishtar/blocks/window_image_odt.html" %}
{% else %}
+{% with can_edit_document=permission_change_own_document|or_:permission_change_document %}
{% trans "Sheet" as sheet_lbl %}
<div class="lightgallery-captions">
{% if item.main_image and item.main_image.image %}{% with image=item.main_image %}
<div id="lightgallery-{{window_id}}-caption-0">
<span class="close">&times</span>
{{image|simple_link_to_window:sheet_lbl}} &nbsp;
+ {% if can_edit_document %}
<a href="{% url 'edit-document' image.pk %}" class="display_details">
<i class="fa fa-pencil"></i> <small>{% trans "Modify" %}</small>
</a>
+ {% endif %}
</div>
{% endwith %}{% endif %}
{% for image in item.images_without_main_image.all %}{% if image.image %}
@@ -18,9 +21,11 @@
<span class="close">&times</span>
{% include "ishtar/blocks/window_image_detail.html" %}
{{image|simple_link_to_window:sheet_lbl}} &nbsp;
+ {% if can_edit_document %}
<a href="{% url 'edit-document' image.pk %}" class="display_details">
<i class="fa fa-pencil"></i> <small>{% trans "Modify" %}</small>
</a>
+ {% endif %}
</div>
{% endif %}{% endfor %}
</div>
@@ -38,5 +43,6 @@
</a>
{% endif %}{% endfor %}
</div>
+{% endwith %}
{% endif%}
{% endif%}