]> git.0d.be Git - django-panik-combo.git/commitdiff
don't misbalance <div> when gallery is empty
authorFrédéric Péters <fpeters@0d.be>
Mon, 4 Mar 2019 12:35:03 +0000 (13:35 +0100)
committerFrédéric Péters <fpeters@0d.be>
Mon, 4 Mar 2019 12:35:03 +0000 (13:35 +0100)
gallery/templates/combo/gallery.html

index 627ab10e8675d9f5f5b9407ccd51814dacec2c75..6be3c9f22a8b134cd531da44c814602951689594 100644 (file)
@@ -7,7 +7,7 @@
 <img src="{{ im.url }}"/>
 <span>{% if image.title %}{{ image.title }}{% endif %}</span>
 </div>
-<div>
+<div> {# extra opened <div> #}
 {% endthumbnail %}
   {% endif %}
 {% thumbnail image.image "60x60" crop="50% 25%" as im %}
         {% if image.title %} title="{{image.title}}" {% endif %}/></span>
 {% endthumbnail %}
 {% endthumbnail %}
+
+  {% if forloop.last %}
+  </div> {# close extra <div> #}
+  {% endif %}
 {% endfor %}
 </div>
-</div>
 <script type="text/javascript">
 $(function() {
   var $gallery = $('#gallery-{{cell.id}}');