From 1f9e7dee25dfd002b6b1ab4636faa9a24f74d09f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 4 Jan 2015 19:58:05 +0100 Subject: generators: Use single function for all templates This commit makes use of a common function for all template parsing and page writing. The behaviour is controlled by the "item" argument passed in. This allows us to have a single code that generates code for list of items as well as for a single item. In the future, this can be used for e.g. combining thumbnails and large images on the same page. Other than that this commit also brings several other changes: - further clarification of theming setup XML file - tag has been moved out of the structure into the structure where it functionally belongs. Only whole albums can be protected and the substitute thumbnail is displayed on index pages. - position marker format has been broken out to a constant - added few more FIXMEs to mark places that will change soon - some template variables have been renamed --- templates/default.xml | 33 +++++++++++++++++++-------------- templates/styles.css | 6 +++--- templates/template_album.html | 26 ++++---------------------- templates/template_index.html | 34 ++++++---------------------------- templates/template_picture.html | 15 ++++++++------- 5 files changed, 40 insertions(+), 74 deletions(-) (limited to 'templates') diff --git a/templates/default.xml b/templates/default.xml index 9197519..c903a4b 100644 --- a/templates/default.xml +++ b/templates/default.xml @@ -9,10 +9,11 @@ the "preview" size will be used instead. --> + it's considered more like a bigger preview size for large screens now. + However it still serves the purpose of supplying metadata (EXIF etc.). --> + this image size availability on the page. --> @@ -72,31 +73,34 @@ - + index.html thumbnail + + emblems-readonly_120.png - + index.html - - preview - + thumbnail - - emblems-readonly_120.png + + preview + images will be generated. Images are processed in either case, for + potential use within album pages. --> @@ -120,7 +124,7 @@ or as a value constant (specify "value(DEFINE_NAME)" to retrieve the value). For "ifdef" negation, use "ifndef" or "else". --> @@ -141,3 +145,4 @@ filenames to avoid conflicts. --> + diff --git a/templates/styles.css b/templates/styles.css index 4b5cc27..ca7121d 100644 --- a/templates/styles.css +++ b/templates/styles.css @@ -221,7 +221,7 @@ div.album_item a:hover { border: 2px solid #A3BED4; } -div.album_item img { +div.album_item img.landscape { /* landscape */ padding-top: 2.25em; } @@ -344,7 +344,7 @@ div.index_item img { top: 1.4em; } -.album_text { +.album_text_landscape { font-size: 190%; font-weight: bold; position: relative; @@ -371,7 +371,7 @@ div.index_item img { top: 0.65em; } -.album_subtext { +.album_subtext_landscape { font-size: 150%; position: relative; left: 13.1em; diff --git a/templates/template_album.html b/templates/template_album.html index 5413c5e..fde340f 100644 --- a/templates/template_album.html +++ b/templates/template_album.html @@ -52,33 +52,15 @@
- +
-
+
- $(IMG_TITLE) + $(IMG_TITLE)
- - -
-
- - $(IMG_TITLE) - - -
- - -
-
- - $(IMG_TITLE) - - -
- +
diff --git a/templates/template_index.html b/templates/template_index.html index 9f90bfe..36d4eec 100644 --- a/templates/template_index.html +++ b/templates/template_index.html @@ -52,39 +52,17 @@
- + - - - - - - - +
diff --git a/templates/template_picture.html b/templates/template_picture.html index 6bd5291..f7e553e 100644 --- a/templates/template_picture.html +++ b/templates/template_picture.html @@ -3,6 +3,7 @@ + $(PAGE_TITLE) @@ -34,7 +35,7 @@
@@ -47,8 +48,8 @@
-
-
+
+
@@ -56,7 +57,7 @@
@@ -91,10 +92,10 @@
+ + -
-
-
+
-- cgit v1.2.3