]> git.0d.be Git - panikweb.git/commitdiff
templates: rename gallery template
authorFrédéric Péters <fpeters@0d.be>
Thu, 11 Jun 2020 09:51:38 +0000 (11:51 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 11 Jun 2020 09:51:38 +0000 (11:51 +0200)
panikweb_templates/templates/combo/gallery.html [deleted file]
panikweb_templates/templates/combo/gallerycell.html [new file with mode: 0644]

diff --git a/panikweb_templates/templates/combo/gallery.html b/panikweb_templates/templates/combo/gallery.html
deleted file mode 100644 (file)
index 6be3c9f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-{% load thumbnail %}
-<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>
-<div> {# extra opened <div> #}
-{% endthumbnail %}
-  {% endif %}
-{% thumbnail image.image "60x60" crop="50% 25%" as im %}
-{% thumbnail image.image "640x480" crop="50% 25%" as im_large %}
-<span 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 %}
-{% 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>
diff --git a/panikweb_templates/templates/combo/gallerycell.html b/panikweb_templates/templates/combo/gallerycell.html
new file mode 100644 (file)
index 0000000..6be3c9f
--- /dev/null
@@ -0,0 +1,32 @@
+{% load thumbnail %}
+<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>
+<div> {# extra opened <div> #}
+{% endthumbnail %}
+  {% endif %}
+{% thumbnail image.image "60x60" crop="50% 25%" as im %}
+{% thumbnail image.image "640x480" crop="50% 25%" as im_large %}
+<span 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 %}
+{% 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>