Don't generate the tinies if every photo was a headliner.

This commit is contained in:
voussoir 2026-08-30 07:52:46 -07:00
parent f54bc44bfb
commit 062dff910e

View file

@ -79,6 +79,7 @@ class Album:
def render_web(self, index=None, is_root=False, totalcount=None): def render_web(self, index=None, is_root=False, totalcount=None):
headliners = [p for p in self.photos if p.etq_photo.has_tag(HEADLINER_TAGNAME)] headliners = [p for p in self.photos if p.etq_photo.has_tag(HEADLINER_TAGNAME)]
non_headliners = [p for p in self.photos if not p.etq_photo.has_tag(HEADLINER_TAGNAME)]
return jinja2.Template(''' return jinja2.Template('''
<article id="{{article_id}}" class="album"> <article id="{{article_id}}" class="album">
@ -88,11 +89,13 @@ class Album:
{{photo.render_web(is_root=1)}} {{photo.render_web(is_root=1)}}
{% endfor %} {% endfor %}
{% if non_headliners %}
<div class="album_tinies"> <div class="album_tinies">
{% for photo in photos %} {% for photo in photos %}
{{photo.render_tiny()}} {{photo.render_tiny()}}
{% endfor %} {% endfor %}
</div> </div>
{% endif %}
</div> </div>
</article> </article>
''').render( ''').render(
@ -100,6 +103,7 @@ class Album:
web_url=self.web_url, web_url=self.web_url,
photos=self.photos, photos=self.photos,
headliners=headliners, headliners=headliners,
non_headliners=non_headliners,
) )
def render_atom(self): def render_atom(self):