From f2da9ccb65af904c47572e5ad862fbe97d67bd97 Mon Sep 17 00:00:00 2001 From: Titoko Date: Tue, 1 Nov 2016 15:04:37 +0100 Subject: [PATCH] Add a back button in subIndex --- prosopopee/prosopopee.py | 6 +-- .../themes/exposure/static/css/style.css | 40 +++++++++++++++++++ .../themes/exposure/templates/index.html | 13 +++++- prosopopee/themes/light/static/css/style.css | 36 +++++++++++++++++ prosopopee/themes/light/templates/index.html | 13 +++++- 5 files changed, 103 insertions(+), 5 deletions(-) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index d6c43ef..6e6520c 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -308,7 +308,7 @@ def process_directory(gallery_name, settings, parent_templates, parent_gallery_p process_directory(subgallery.name, settings, subgallery_templates, gallery_path) ) - build_index(settings, sub_page_galleries_cover, subgallery_templates, gallery_path) + build_index(settings, sub_page_galleries_cover, subgallery_templates, gallery_path, True) gallery_cover['sub_gallery'] = sub_page_galleries_cover return gallery_cover @@ -398,8 +398,7 @@ def build_gallery(settings, gallery_settings, gallery_path, template): open(Path("build").joinpath(gallery_light_path, "index.html"), "w").write(html) - -def build_index(settings, galleries_cover, templates, gallery_path=''): +def build_index(settings, galleries_cover, templates, gallery_path='', sub_index=False): index_template = templates.get_template("index.html") galleries_cover = reversed(sorted(filter(lambda x: x != {}, galleries_cover), key=lambda x: x["date"])) @@ -414,6 +413,7 @@ def build_index(settings, galleries_cover, templates, gallery_path=''): html = index_template.render( settings=settings, galleries=galleries_cover, + sub_index=sub_index, Image=Image, Video=Video ).encode("Utf-8") diff --git a/prosopopee/themes/exposure/static/css/style.css b/prosopopee/themes/exposure/static/css/style.css index d3594fe..495220e 100644 --- a/prosopopee/themes/exposure/static/css/style.css +++ b/prosopopee/themes/exposure/static/css/style.css @@ -265,3 +265,43 @@ nav ul li > a.item-menu::before { height: 100%; width: 100%; } + +.back-to-home { + text-align: center; +} + +.back-to-home hr { + width: 14%; + color: #DDD; +} + +.back-to-home #logo { + background: transparent url("../img/logo.svg") no-repeat scroll center top / cover; + border-radius: 100em; + border: 7px solid black; + margin: auto; + margin-top: 1em; + height: 150px; + width: 150px; + color: transparent; + font-size: 40px; +} + +.back-to-home a { + position: relative; + text-decoration: none; + color: transparent; +} + +.back-to-home #logo:hover { + background-color: black; + text-decoration: none; + color: white; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + text-transform: uppercase; + font-family: 'montserrat', sans-serif; + font-weight: bold; +} \ No newline at end of file diff --git a/prosopopee/themes/exposure/templates/index.html b/prosopopee/themes/exposure/templates/index.html index 93a13a1..28d5541 100644 --- a/prosopopee/themes/exposure/templates/index.html +++ b/prosopopee/themes/exposure/templates/index.html @@ -6,7 +6,18 @@ {% endblock %} {% block logo %} - + {% if sub_index %} +
+
+ + + +
+ {% else %} + + {% endif %} {% endblock %} {% block content %} diff --git a/prosopopee/themes/light/static/css/style.css b/prosopopee/themes/light/static/css/style.css index 3cd4eda..0ace685 100644 --- a/prosopopee/themes/light/static/css/style.css +++ b/prosopopee/themes/light/static/css/style.css @@ -263,3 +263,39 @@ nav ul li > a.item-menu::before { .gallery-cover img.fillWidth { height: 100%; } + +.back-to-home hr { + width: 14%; + color: #DDD; +} + +.back-to-home #logo { + background: transparent url("../img/logo.svg") no-repeat scroll center top / cover; + border-radius: 100em; + border: 7px solid black; + margin: auto; + margin-top: 1em; + height: 150px; + width: 150px; + color: transparent; + font-size: 40px; +} + +.back-to-home a { + position: relative; + text-decoration: none; + color: transparent; +} + +.back-to-home #logo:hover { + background-color: black; + text-decoration: none; + color: white; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + text-transform: uppercase; + font-family: 'montserrat', sans-serif; + font-weight: bold; +} diff --git a/prosopopee/themes/light/templates/index.html b/prosopopee/themes/light/templates/index.html index 6e15679..04ee28c 100644 --- a/prosopopee/themes/light/templates/index.html +++ b/prosopopee/themes/light/templates/index.html @@ -6,7 +6,18 @@ {% endblock %} {% block logo %} - + {% if sub_index %} +
+
+ + + +
+ {% else %} + + {% endif %} {% endblock %} {% block content %}