diff options
| -rw-r--r-- | ishtar_common/templates/ishtar/blocks/window_image.html | 13 | 
1 files changed, 6 insertions, 7 deletions
diff --git a/ishtar_common/templates/ishtar/blocks/window_image.html b/ishtar_common/templates/ishtar/blocks/window_image.html index dcf0c2f5e..8f0c0dbed 100644 --- a/ishtar_common/templates/ishtar/blocks/window_image.html +++ b/ishtar_common/templates/ishtar/blocks/window_image.html @@ -4,17 +4,16 @@  {% else %}  {% trans "Sheet" as sheet_lbl %}  <div class="lightgallery-captions"> -    {% if item.main_image %}{% with image=item.main_image %} +    {% if item.main_image and item.main_image.image %}{% with image=item.main_image %}      <div id="lightgallery-{{window_id}}-caption-0">          <span class="close">×</span> -        {% include "ishtar/blocks/window_image_detail.html" %}          {{image|simple_link_to_window:sheet_lbl}}            <a href="{% url 'edit-document' image.pk %}" class="display_details">              <i class="fa fa-pencil"></i> <small>{% trans "Modify" %}</small>          </a>      </div>      {% endwith %}{% endif %} -    {% for image in item.images_without_main_image.all %} +    {% for image in item.images_without_main_image.all %}{% if image.image %}      <div id="lightgallery-{{window_id}}-caption-{{forloop.counter}}">          <span class="close">×</span>          {% include "ishtar/blocks/window_image_detail.html" %} @@ -23,21 +22,21 @@              <i class="fa fa-pencil"></i> <small>{% trans "Modify" %}</small>          </a>      </div> -    {% endfor %} +    {% endif %}{% endfor %}  </div>  <div id="lightgallery-{{window_id}}"> -    {% if item.main_image %}{% with image=item.main_image %} +    {% if item.main_image and item.main_image.image %}{% with image=item.main_image %}      <a data-sub-html="#lightgallery-{{window_id}}-caption-0"         href="{{image.image.url}}" class="window-main-image">          <img class='card-img-top' src="{{BASE_URL}}{{image.thumbnail.url}}">      </a>      {% endwith %}{% endif %} -    {% for image in item.images_without_main_image.all %} +    {% for image in item.images_without_main_image.all %}{% if image.image %}      <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 %} +    {% endif %}{% endfor %}  </div>  {% endif%}  {% endif%}  | 
