mirror of
https://github.com/ae-utbm/sith.git
synced 2025-12-21 07:13:21 +00:00
Use real images with lazy loading in sas albums and user pictures
This commit is contained in:
@@ -2,15 +2,19 @@
|
||||
<a href="{{ url('sas:album', album_id=a.id) }}">
|
||||
{% if a.file %}
|
||||
{% set img = a.get_download_url() %}
|
||||
{% set src = a.name %}
|
||||
{% elif a.children.filter(is_folder=False, is_moderated=True).exists() %}
|
||||
{% set img = a.children.filter(is_folder=False).first().as_picture.get_download_thumb_url() %}
|
||||
{% set picture = a.children.filter(is_folder=False).first().as_picture %}
|
||||
{% set img = picture.get_download_thumb_url() %}
|
||||
{% set src = picture.name %}
|
||||
{% else %}
|
||||
{% set img = static('core/img/sas.jpg') %}
|
||||
{% set src = "sas.jpg" %}
|
||||
{% endif %}
|
||||
<div
|
||||
class="album{% if not a.is_moderated %} not_moderated{% endif %}"
|
||||
style="background-image: url('{{ img }}');"
|
||||
>
|
||||
<img src="{{ img }}" alt="{{ src }}" loading="lazy" />
|
||||
{% if not a.is_moderated %}
|
||||
<div class="overlay"> </div>
|
||||
<div class="text">{% trans %}To be moderated{% endtrans %}</div>
|
||||
|
||||
Reference in New Issue
Block a user