chg: [chats explorer] image lazy loading

pull/607/merge
terrtia 2024-10-03 14:34:50 +02:00
parent dd32604b7b
commit f93d82eff4
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@
<div>
<a href="{{ url_for('chats_explorer.objects_user_account')}}?subtype={{ message['user-account']['subtype'] }}&id={{ message['user-account']['id'] }}">
<img src="{% if message['user-account']['icon'] %}{{ url_for('objects_image.image', filename=message['user-account']['icon'])}}{% else %}{{ url_for('static', filename='image/ail-icon.png') }}{% endif %}"
class="rounded-circle mr-1" alt="{{ message['user-account']['id'] }}" width="60" height="60">
class="rounded-circle mr-1" alt="{{ message['user-account']['id'] }}" width="60" height="60" loading="lazy">
</a>
<div class="text-center">
<div class="text-muted small text-nowrap">{{ message['date'] }}</div>
@ -42,7 +42,7 @@
<h4 class="text-secondary mb-0">
{% if message['forwarded_from']['icon'] %}
<a href="{{ url_for('chats_explorer.objects_user_account')}}?subtype={{ message['user-account']['subtype'] }}&id={{ message['user-account']['id'] }}">
<img src="{{ url_for('objects_image.image', filename=message['forwarded_from']['icon'])}}" class="rounded-circle mr-1" alt="{{ message['forwarded_from']['id'] }}" width="40" height="40">
<img src="{{ url_for('objects_image.image', filename=message['forwarded_from']['icon'])}}" class="rounded-circle mr-1" alt="{{ message['forwarded_from']['id'] }}" width="40" height="40" loading="lazy">
</a>
{# {% else %}#}
{# <svg height="30" width="30">#}
@ -91,7 +91,7 @@
{% endif %}
{% if message['images'] %}
{% for message_image in message['images'] %}
<img class="object_image mb-1" src="{{ url_for('objects_image.image', filename=message_image['id'])}}">
<img class="object_image mb-1" src="{{ url_for('objects_image.image', filename=message_image['id'])}}" loading="lazy">
{% if message_image['ocr'] %}
<span>
<a class="btn btn-info" target="_blank" href="{{ url_for('objects_ocr.object_ocr', id=message_image['id'])}}"><i class="fas fa-expand"></i> OCR</a>