add theme vars: gallery name & path to home

This commit is contained in:
Simon
2011-05-05 00:32:37 +02:00
parent 37fc09c28e
commit d1ef4ff541

View File

@@ -70,6 +70,11 @@ class Theme():
for dirpath, dirnames, imglist in self.filelist():
theme = { 'path': os.path.relpath(self.path, dirpath) }
home_path = os.path.join(os.path.relpath(self.path, dirpath), INDEX_PAGE)
gallery_name = ""
if dirpath != self.path:
gallery_name = os.path.basename(dirpath).replace('_',' ').replace('-',' ').capitalize()
images = []
for i in imglist:
@@ -91,8 +96,8 @@ class Theme():
albums.append(album)
# print album
page = self.template.render(self.meta,
images=images,
page = self.template.render(self.meta, gallery_name=gallery_name,
home_path=home_path, images=images,
albums=albums, theme=theme)
# save