From 330215cf864ad3a917d51d6be15d68f360c166dc Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 20 Dec 2018 19:49:52 +0100 Subject: Manage main image: model, auto associate default image --- .../templates/ishtar/blocks/window_image.html | 27 +++++++++++++++++----- .../templates/ishtar/blocks/window_image_odt.html | 10 ++++++-- 2 files changed, 29 insertions(+), 8 deletions(-) (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 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 %}
- {% for image in item.images.all %} -
+ {% if item.main_image %}{% with image=item.main_image %} +
+ × + {% include "ishtar/blocks/window_image_detail.html" %} + + {% trans "Modify" %}   + +
+ {% endwith %}{% endif %} + {% for image in item.images_without_main_image.all %} +
× {% include "ishtar/blocks/window_image_detail.html" %} @@ -14,10 +23,16 @@ {% endfor %}
- {% for image in item.images.all %} - - + {% if item.main_image %}{% with image=item.main_image %} + + + + {% endwith %}{% endif %} + {% for image in item.images_without_main_image.all %} + + {% endfor %}
diff --git a/ishtar_common/templates/ishtar/blocks/window_image_odt.html b/ishtar_common/templates/ishtar/blocks/window_image_odt.html index 9c9383cdd..548d0b46f 100644 --- a/ishtar_common/templates/ishtar/blocks/window_image_odt.html +++ b/ishtar_common/templates/ishtar/blocks/window_image_odt.html @@ -1,7 +1,13 @@ {% load i18n %}
- {% for image in item.images.all %} -
+ {% if item.main_image %}{% with image=item.main_image %} +
+ + {% include "ishtar/blocks/window_image_detail.html" %} +
+ {% endwith %}{% endif %} + {% for image in item.images_without_main_image.all %} +
{% include "ishtar/blocks/window_image_detail.html" %}
-- cgit v1.2.3