Fill image ALTs if they're not set manually

This commit is contained in:
Michał Gdula 2023-04-06 21:26:40 +00:00
parent 5791a72f0a
commit 3dd29cbfb8
4 changed files with 7 additions and 7 deletions

View file

@ -127,10 +127,10 @@
<div class="images size-{{ group.images|length }}">
{% if group.images|length > 0 %}
{% for image in group.images %}
<img data-src="{{ url_for('api.file', file_name=image.filename) }}?r=thumb" onload="this.classList.add('loaded');" id="lazy-load" class="data-{{ loop.index }}"/>
<img data-src="{{ url_for('api.file', file_name=image.filename) }}?r=thumb" onload="this.classList.add('loaded');" id="lazy-load" class="data-{{ loop.index }}" {% if image.alt %}{{ image.alt }}{% else %}Image Thumbnail{% endif %}/>
{% endfor %}
{% else %}
<img src="{{ url_for('static', filename='error.png') }}" class="loaded"/>
<img src="{{ url_for('static', filename='error.png') }}" class="loaded" alt="Error thumbnail"/>
{% endif %}
</div>
</a>