summaryrefslogtreecommitdiff
path: root/templates/lib
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2024-12-27 20:31:02 -0600
committerluxagraf <sng@luxagraf.net>2024-12-27 20:31:02 -0600
commitdf3bc581e496412ef8c263dbf1cfe00f184e4e59 (patch)
tree1b6d47357e7be1ef6f568852c849644e23b342d9 /templates/lib
parent8c7b0e1abe1983fac38322c3bc01165c4c693d7e (diff)
img: cleaned up image parse code and template for clusters
Diffstat (limited to 'templates/lib')
-rw-r--r--templates/lib/img_cluster.html17
1 files changed, 12 insertions, 5 deletions
diff --git a/templates/lib/img_cluster.html b/templates/lib/img_cluster.html
index 317bf8b..8117298 100644
--- a/templates/lib/img_cluster.html
+++ b/templates/lib/img_cluster.html
@@ -1,6 +1,13 @@
-{% load get_image_by_size %}{% if caption or exif %}<figure {%if cluster_class != "picwide"%}class="{{cluster_class}}"{%endif%}>{%endif%}
- <a href="{%get_image_by_size image "original"%}" title="view larger image {% if image.photo_credit_source%}(photo by {{image.photo_credit_source}}){%endif%}">
- <img class="{% if caption or exif %}{%else%}{%if cluster_class != "picwide"%}{{cluster_class}}{%endif%}{%endif%} {%if extra%}{{extra}}{%endif%}" {%if cluster_class == "picwide"%} sizes="(max-width: 1439px) 100vw, (min-width: 1440px) 1440px" srcset="{% for size in image.sizes.all%}{% get_image_by_size image size.slug %} {{size.width}}w{% if forloop.last%}"{%else%}, {%endif%}{%endfor%}{% for size in image.sizes.all%}{%if not forloop.first and not forloop.last%} src="{% get_image_by_size image size.slug%}"{%endif%}{%endfor%}{%else%} src="{% get_image_by_size image cluster_class %}"{%endif%} alt="{%if image.alt %}{{image.alt}}{%else%}{{image.title}}{%endif%} photographed by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}Scott Gilbertson{%endif%}"></a>
-{% if caption or exif %}<figcaption>{% endif %}{% if caption %}{{image.caption|safe}}{% endif %}{% if exif %} | <small>Camera: {{image.exif_make}} {{image.exif_model}} with {{image.exif_lens}}</small>{% endif %}{% if caption or exif %}</figcaption>
-</figure>
+{% load get_image_by_size %}{%if cluster_class != "picwide"%}<span class="{{cluster_class}}">{%endif%}
+{% if caption %}<figure {%if cluster_class != "picwide"%}class="{{cluster_class}}"{%endif%}>{%endif%}
+ <a href="{%get_image_by_size image "original"%}" title="view larger image">
+ <img {%if cluster_class == "picwide"%} class="picwide"
+ sizes="(max-width: 1439px) 100vw, (min-width: 1440px) 1440px" srcset="{% for size in image.sizes.all%}{% get_image_by_size image size.slug %} {{size.width}}w{% if forloop.last%}"{%else%}, {%endif%}{%endfor%}
+ {% for size in image.sizes.all%}{%if not forloop.first and not forloop.last%} src="{% get_image_by_size image size.slug%}"{%endif%}{%endfor%}
+ {%else%}
+ src="{% get_image_by_size image cluster_class %}"
+ {%endif%}
+ alt="{%if image.alt %}{{image.alt}}{%else%}{{image.title}}{%endif%} by {% if image.photo_credit_source %}{{image.photo_credit_source}}{%else%}Scott Gilbertson{%endif%}"></a>
+ {% if caption %}<figcaption>{{image.caption|safe}}</figcaption></figure>
{% endif %}
+ {%if cluster_class != "picwide"%}</span>{%endif%}