From a4142aa3f32c2154f998470fc1312548ba238478 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Sat, 30 Aug 2014 19:27:38 +0200 Subject: [PATCH] table-based galleries --- pelican-bootstrap3/templates/article.html | 58 +++++++++++++++++++++-- pelican-bootstrap3/templates/gallery.html | 50 +++++++++++++++++++ 2 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 pelican-bootstrap3/templates/gallery.html diff --git a/pelican-bootstrap3/templates/article.html b/pelican-bootstrap3/templates/article.html index a8e7703..640c8c9 100644 --- a/pelican-bootstrap3/templates/article.html +++ b/pelican-bootstrap3/templates/article.html @@ -42,17 +42,67 @@ {% for image in article.galleryimages %} + {% if (loop.index % GALLERY_IMG_PER_ROW) == 0 %} {% endif %} {% endfor %} - + {% if (article.galleryimages.__len__() % GALLERY_IMG_PER_ROW) != 0 %} + {% endif %} diff --git a/pelican-bootstrap3/templates/gallery.html b/pelican-bootstrap3/templates/gallery.html new file mode 100644 index 0000000..b1cc784 --- /dev/null +++ b/pelican-bootstrap3/templates/gallery.html @@ -0,0 +1,50 @@ +{% extends "base.html" %} +{% block title %}{{ page.title }} - {{ SITENAME }}{% endblock %} + +{% block breadcrumbs %} + {% if DISPLAY_BREADCRUMBS %} + + {% endif %} +{% endblock %} + +{% block content %} +
+

{{ page.title }}

+ {% import 'includes/translations.html' as translations with context %} + {{ translations.translations_for(page) }} + {% if PDF_PROCESSOR %} + + get the pdf + + {% endif %} +
+ {% for album, images in page.gallery.iteritems() %} +

{{ album }}

+ + + + {% for image in images %} + + {% if (loop.index % GALLERY_IMG_PER_ROW) == 0 %} + + + {% endif %} + {% endfor %} + + + + + + {% endfor %} +
+
+{% endblock %} +