54 lines
2.4 KiB
HTML

<section class="subgal">
<div class="galleries-grid">
{% for galleries_line in galleries|reverse|batch(3)|reverse %}
{% if loop.index is divisibleby 3 or loop.index is divisibleby 2 %}
{% set no_big_gallery_cover = true %}
{% endif %}
<div class="galleries-line covers-{{ galleries_line|length }}">
{% for gallery in galleries_line|reverse %}<!-- comment tricks against space between inline-block
--><div class="gallery-square">
<div class="subgaldiv">
{# The ending '/' is really needed here for uWebsockets serving these! #}
<a href="{{ gallery.link }}/">
<div class="gallery-title">
<h2>{{ gallery.title }}</h2>
{% if gallery.sub_title %}<h3>{{ gallery.sub_title }}</h3>{% endif %}
{% if settings.show_date and gallery.date %}<div class="gallery-datetime">{{ gallery.date.strftime("%d %B %Y") }}</div>{% endif %}
{% if gallery.tags %}
{% if not gallery.tags_as_list %}
<div class="gallery-tag">
IN {% for tag in gallery.tags -%} <span> {{ tag }}</span> {% endfor -%}
</div>{% endif %}{% endif %}
</div>
</a>
{% if gallery.cover_type == "video" %}
{% set video = Video(gallery.cover) %}
{{ video.copy() }}
<div class="gallery-cover">
<video autoplay loop muted class="fillWidth">
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
</video>
<img class="fillWidth" alt="" src="{{ video.generate_thumbnail("900") }}">
</div>
{% else %}
{% set cover = Image(gallery.cover) %}
{{ cover.copy() }}
{% if no_big_gallery_cover %}
<div class="gallery-cover" style="background-image: url('{{ cover.generate_thumbnail("x900") }}'), url('{{ cover.generate_thumbnail("x150") }}');"></div>
{% else %}
<div class="gallery-cover" style="background-image: url('{{ cover.generate_thumbnail("x1366") }}'), url('{{ cover.generate_thumbnail("x900") }}');"></div>
{% endif %}
{% endif %}
</div>
{% if gallery.tags %}
{% if gallery.tags_as_list %}
<div class="gallery-tags_as_list">
<ul> {% for tag in gallery.tags %} <li> {{ tag }}</li> {% endfor %} </ul>
</div>{% endif %}{% endif %}
</div><!-- comment tricks against space between inline-block
-->{% endfor %}
</div>
{% endfor %}
</div>
</section>