From 0dac9c341be56b382fb6d5b918997aa2f41995ad Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 3 Apr 2023 17:53:01 +0200 Subject: Image detail: do not display Modify link when not relevant (refs #5438) --- ishtar_common/templates/ishtar/blocks/window_image.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ishtar_common/templates') 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 %}
{% if item.main_image and item.main_image.image %}{% with image=item.main_image %}
× {{image|simple_link_to_window:sheet_lbl}}   + {% if can_edit_document %} {% trans "Modify" %} + {% endif %}
{% endwith %}{% endif %} {% for image in item.images_without_main_image.all %}{% if image.image %} @@ -18,9 +21,11 @@ × {% include "ishtar/blocks/window_image_detail.html" %} {{image|simple_link_to_window:sheet_lbl}}   + {% if can_edit_document %} {% trans "Modify" %} + {% endif %}
{% endif %}{% endfor %} @@ -38,5 +43,6 @@ {% endif %}{% endfor %} +{% endwith %} {% endif%} {% endif%} -- cgit v1.2.3