Skip to content

Commit

Permalink
Merge branch 'fix/img_lazy_loading' into create_img_docker
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Dec 19, 2024
2 parents 6381ee1 + f504172 commit ba00aed
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions atlas/templates/core/listTaxons.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="bg-white border-right p-2">

<div class="col">
<input id="taxonInput" type="text" class="form-control form-control-sm" placeholder="{{ _('filter.species') }}">
<input id="taxonInput" type="text" class="form-control form-control-sm" placeholder="{{ _('filter.species') }}" />
</div>

</div>
Expand All @@ -25,16 +25,15 @@
<div class="pictoImgList mr-2" data-toggle="tooltip" data-original-title="{{ taxon.group2_inpn }}"
data-placement="right">
{% if taxon.path == None %}
<img class="mx-auto d-block INPNgroup"
src="{{ url_for('static', filename='images/picto_'+ taxon.group2_inpn| replace(" ", "_") |urlencode+'.png') }}">

<img loading="lazy" class="mx-auto d-block INPNgroup"
src="{{ url_for('static', filename='images/picto_'+ taxon.group2_inpn| replace(" ", "_") |urlencode+'.png') }}" alt=" " />
{% else %}
{% if configuration.REDIMENSIONNEMENT_IMAGE %}
{% set img_path = configuration.TAXHUB_URL+'/api/tmedias/thumbnail/'+taxon.id_media|string+'?h=500&w=500' %}
{% set img_path = configuration.TAXHUB_URL+'/api/tmedias/thumbnail/'+taxon.id_media|string+'?h=80&w=80' %}
{% else %}
{% set img_path = taxon.path %}
{% endif %}
<img class="lazy pictoImgList" data-src="{{ img_path }}">
<img loading="lazy" class="pictoImgList" src="{{ img_path }}" alt=" " />
{% endif %}
</div>
<div class="media-body">
Expand All @@ -46,7 +45,7 @@
target="_blank">
<img src="{{ url_for('static', filename='images/logo_protection.png') }}"
style="width : 30px; height: 30px" data-placement="left" data-toggle="tooltip"
data-original-title="{{ _('this.taxon.has.a.protected.status') }}">
data-original-title="{{ _('this.taxon.has.a.protected.status') }}" alt=" " />
</a>
{% endif %}
{% endif %}
Expand All @@ -58,7 +57,7 @@
style="width : 30px; height: 30px" data-placement="left" data-toggle="tooltip"
data-original-title="{{ configuration.PATRIMONIALITE.config[taxon.patrimonial].text }}"
data-placement="right"
>
alt=" " />
{% endif %}
{% endif %}

Expand All @@ -84,7 +83,7 @@ <h5>
<a class="badge badge-primary" href="{{ url_for('main.ficheEspece', cd_nom=taxon.cd_ref) }}"
data-toggle="tooltip"
title="{{ _('check.species.sheet') }}" data-placement="left">
<i class="fas fa-list fa-fw"></i> {{ _('species.sheet') }}</i>
<i class="fas fa-list fa-fw"></i> {{ _('species.sheet') }}
</a>
</span>

Expand Down

0 comments on commit ba00aed

Please sign in to comment.