From d98e130168339263677c546c3bdc62d0ff9620d7 Mon Sep 17 00:00:00 2001 From: thomasdn Date: Sun, 11 Jul 2021 14:51:38 +0200 Subject: [PATCH 1/2] Added common subtemplate for album items to be included from album.html and album_list.html --- sigal/themes/galleria/templates/album.html | 230 +---------------- .../galleria/templates/album_items.html | 231 ++++++++++++++++++ .../themes/galleria/templates/album_list.html | 8 +- 3 files changed, 235 insertions(+), 234 deletions(-) create mode 100644 sigal/themes/galleria/templates/album_items.html diff --git a/sigal/themes/galleria/templates/album.html b/sigal/themes/galleria/templates/album.html index 3187519..65500da 100644 --- a/sigal/themes/galleria/templates/album.html +++ b/sigal/themes/galleria/templates/album.html @@ -14,235 +14,7 @@ {% endblock %} {% block content %} -
- {% if settings.show_map and album.show_map %} - Show/Hide Map (m) - {% endif %} - Fullscreen (f) -
- + {% include 'album_items.html' %} - {% if album.zip %} -
-

Download ZIP -

-
- {% endif %} - - {% if album.description %} -
- {{ album.description }} -
- {% endif %} {% endblock %} -{% block late_js %} - {% macro img_description(media) -%} - {%- if media.big -%}Full size{%- endif -%} - {# clean up tags and whitespace, including newlines, in the description #} - {%- if media.description -%}
{{ media.description | striptags }}{%- endif -%} - {%- if media.exif -%} -
- {%- if media.exif.iso -%}{{ media.exif.iso }} {%- endif -%} - {%- if media.exif.exposure -%}{{ media.exif.exposure }} {%- endif -%} - {%- if media.exif.fstop -%}{{ media.exif.fstop }} {%- endif -%} - {%- if media.exif.focal -%}{{ media.exif.focal }} {%- endif -%} -
- {%- if media.exif.gps -%} - {{ 'N{:.6f}'.format(media.exif.gps.lat) if media.exif.gps.lat > 0 else 'S{:.6f}'.format(-media.exif.gps.lat) }}{{ 'E{:.6f}'.format(media.exif.gps.lon) if media.exif.gps.lon > 0 else 'W{:.6f}'.format(-media.exif.gps.lon) }} - {%- endif -%} - {%- if media.exif.Make or media.exif.Model -%} - {{ media.exif.Make }} {{ media.exif.Model }} - {%- endif -%} - {%- if media.exif.datetime -%} - {{ media.exif.datetime }} - {%- endif -%} - {% endif %} - {%- endmacro %} - - - {% if settings.show_map and album.show_map %} - - - {% endif %} - - - - -{% endblock %} diff --git a/sigal/themes/galleria/templates/album_items.html b/sigal/themes/galleria/templates/album_items.html new file mode 100644 index 0000000..d8cae58 --- /dev/null +++ b/sigal/themes/galleria/templates/album_items.html @@ -0,0 +1,231 @@ +
+ {% if settings.show_map and album.show_map %} + Show/Hide Map (m) + {% endif %} + Fullscreen (f) +
+ + + {% if album.zip %} +
+

Download ZIP +

+
+ {% endif %} + + {% if album.description %} +
+ {{ album.description }} +
+ {% endif %} + +{% block late_js %} + {% macro img_description(media) -%} + {%- if media.big -%}Full size{%- endif -%} + {# clean up tags and whitespace, including newlines, in the description #} + {%- if media.description -%}
{{ media.description | striptags }}{%- endif -%} + {%- if media.exif -%} +
+ {%- if media.exif.iso -%}{{ media.exif.iso }} {%- endif -%} + {%- if media.exif.exposure -%}{{ media.exif.exposure }} {%- endif -%} + {%- if media.exif.fstop -%}{{ media.exif.fstop }} {%- endif -%} + {%- if media.exif.focal -%}{{ media.exif.focal }} {%- endif -%} +
+ {%- if media.exif.gps -%} + {{ 'N{:.6f}'.format(media.exif.gps.lat) if media.exif.gps.lat > 0 else 'S{:.6f}'.format(-media.exif.gps.lat) }}{{ 'E{:.6f}'.format(media.exif.gps.lon) if media.exif.gps.lon > 0 else 'W{:.6f}'.format(-media.exif.gps.lon) }} + {%- endif -%} + {%- if media.exif.Make or media.exif.Model -%} + {{ media.exif.Make }} {{ media.exif.Model }} + {%- endif -%} + {%- if media.exif.datetime -%} + {{ media.exif.datetime }} + {%- endif -%} + {% endif %} + {%- endmacro %} + + + {% if settings.show_map and album.show_map %} + + + {% endif %} + + + + +{% endblock %} diff --git a/sigal/themes/galleria/templates/album_list.html b/sigal/themes/galleria/templates/album_list.html index 9670e21..558c6ad 100644 --- a/sigal/themes/galleria/templates/album_list.html +++ b/sigal/themes/galleria/templates/album_list.html @@ -24,10 +24,8 @@ {% endfor %} + {% include 'album_items.html' %} + + - {% if album.description %} -
- {{ album.description }} -
- {% endif %} {% endblock %} From 5e9ba3e3bd09685d2cc8841277a8e07fa20394e0 Mon Sep 17 00:00:00 2001 From: thomasdn Date: Thu, 19 Aug 2021 16:38:17 +0000 Subject: [PATCH 2/2] Update album_items.html --- sigal/themes/galleria/templates/album_items.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sigal/themes/galleria/templates/album_items.html b/sigal/themes/galleria/templates/album_items.html index d8cae58..ded498c 100644 --- a/sigal/themes/galleria/templates/album_items.html +++ b/sigal/themes/galleria/templates/album_items.html @@ -23,6 +23,7 @@ {% endif %} {% block late_js %} + {% if album.medias %} {% macro img_description(media) -%} {%- if media.big -%}Full size{%- endif -%} {# clean up tags and whitespace, including newlines, in the description #} @@ -228,4 +229,5 @@ Galleria.run("#gallery", {dataSource: data}); + {% endif %} {% endblock %}