]> git.0d.be Git - panikweb.git/commitdiff
templates: restore old/appropriate gallery template
authorFrédéric Péters <fpeters@0d.be>
Thu, 11 Jun 2020 10:20:58 +0000 (12:20 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 11 Jun 2020 10:20:58 +0000 (12:20 +0200)
panikweb_templates/templates/combo/gallerycell.html

index 1a420da77ea22e346d8eccdad80961c0e2053ed1..49451a96643d81a480042e482e8bdcc81908c477 100644 (file)
@@ -1,35 +1,28 @@
 {% load thumbnail %}
-{% if cell.title %}
-<h2>{{ cell.title }}</h2>
-{% endif %}
+{% if cell.title %}<h3>{{ cell.title }}</h3>{% endif %}
 <div class="gallery" id="gallery-{{cell.id}}">
 {% for image in cell.image_set.all %}
   {% if forloop.first %}
-{% thumbnail image.image "640x480" crop="50% 25%" as im %}
-<div class="first">
-<img src="{{ im.url }}"/>
-<span>{% if image.title %}{{ image.title }}{% endif %}</span>
+<div class="first" style="display: none;">
+<img src="#"/>
+<span class="gallery-legend"></span>
 </div>
-<div> {# extra opened <div> #}
-{% endthumbnail %}
+<div>
   {% endif %}
-{% thumbnail image.image "60x60" crop="50% 25%" as im %}
+{% thumbnail image.image "200x100" crop="50% 25%" as im %}
+{% if cell.slug == 'portrait' %}
+{% thumbnail image.image "480x640" crop="50% 25%" as im_large %}
+<span class="image" data-image-large="{{ im_large.url }}"><img src="{{ im.url }}"
+        class="portrait" {% if image.title %} title="{{image.title}}" {% endif %}/></span>
+{% endthumbnail %}
+{% else %}
 {% thumbnail image.image "640x480" crop="50% 25%" as im_large %}
-<span data-image-large="{{ im_large.url }}"><img src="{{ im.url }}"
+<span class="image" data-image-large="{{ im_large.url }}"><img src="{{ im.url }}"
         {% if image.title %} title="{{image.title}}" {% endif %}/></span>
-{% endthumbnail %}
 {% endthumbnail %}
 
-  {% if forloop.last %}
-  </div> {# close extra <div> #}
-  {% endif %}
+{% endif %}
+{% endthumbnail %}
 {% endfor %}
 </div>
-<script type="text/javascript">
-$(function() {
-  var $gallery = $('#gallery-{{cell.id}}');
-  $gallery.find('span').on('click', function() {
-    $gallery.find('div.first img').attr('src', $(this).data('image-large'));
-  });
-});
-</script>
+</div>