From fb53d674a7d02f09c9dcfa9476fce7ba4f293be3 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Sun, 1 Jun 2014 14:19:43 +0200 Subject: [PATCH] gallery: Add comment per image support --- gallery/gallery.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gallery/gallery.py b/gallery/gallery.py index 7c54cf3..985457e 100644 --- a/gallery/gallery.py +++ b/gallery/gallery.py @@ -13,6 +13,7 @@ def add_gallery_post(generator): album = article.metadata.get('gallery') galleryimages = [] gallerycaptions = dict() + gallerycomments = dict() articlegallerypath=os.path.join(gallerycontentpath, album) @@ -25,9 +26,14 @@ def add_gallery_post(generator): line = article.metadata.get('gallerycaptions').encode('ascii','xmlcharrefreplace') gallerycaptions = ast.literal_eval(line) + if 'gallerycomments' in article.metadata.keys(): + line = article.metadata.get('gallerycomments').encode('ascii','xmlcharrefreplace') + gallerycomments = ast.literal_eval(line) + article.album = album article.galleryimages = sorted(galleryimages) article.gallerycaptions = gallerycaptions + article.gallerycomments = gallerycomments def generate_gallery_page(generator):