Skip to content

Commit

Permalink
[Bugfix] Correction des pictogrammes dans les tuiles en mode sombre (#…
Browse files Browse the repository at this point in the history
…231)

* Fix a bug that prevented tiles to correctly display in dark mode if stored on a S3

* Allow the pictograms to work in dark mode
  • Loading branch information
Ash-Crow authored Oct 30, 2024
1 parent df946f9 commit 75d845c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<div class="fr-grid-row fr-grid-row--gutters">
{% if value.image_side == "left" %}
<div class="fr-col-12 fr-col-sm-{{ value.image_ratio }}">
<div class="bordered fr-px-2w">{% image value.image original class="fr-responsive-img" alt="" %}</div>
<div class="bordered fr-px-2w">
{% include "content_manager/blocks/image_svg_or_raster.html" with extra_classes="fr-responsive-img" alt="" %}
</div>
</div>
<div class="fr-col-12 fr-col-sm{{ -12|add:value.image_ratio }}">
{{ value.text|richtext }}
Expand Down Expand Up @@ -33,7 +35,9 @@
{% endif %}
</div>
<div class="fr-col-12 fr-col-sm-{{ value.image_ratio }}">
<div class="bordered fr-px-2w">{% image value.image original class="fr-responsive-img" alt="" %}</div>
<div class="bordered fr-px-2w">
{% include "content_manager/blocks/image_svg_or_raster.html" with extra_classes="fr-responsive-img" alt="" %}
</div>
</div>
{% endif %}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% load wagtailimages_tags %}

{% image value.image original as artwork %}

{% if artwork.file.name|slice:"-4:" == ".svg" %}
<div class="fr-responsive-img">
<svg aria-hidden="true" class="fr-artwork" viewBox="0 0 80 80">
<use class="fr-artwork-decorative" href="{{ artwork.full_url }}#artwork-decorative"></use>
<use class="fr-artwork-minor" href="{{ artwork.full_url }}#artwork-minor"></use>
<use class="fr-artwork-major" href="{{ artwork.full_url }}#artwork-major"></use>
</svg>
</div>
{% else %}
{% image value.image original class=extra_classes alt=alt %}
{% endif %}
2 changes: 1 addition & 1 deletion content_manager/templates/content_manager/blocks/tile.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<div class="fr-tile__header">
{% image value.image original as pictogram %}

{% if pictogram.url|slice:"-4:" == ".svg" %}
{% if pictogram.file.name|slice:"-4:" == ".svg" %}
<div class="fr-tile__pictogram">
<svg aria-hidden="true"
class="fr-artwork"
Expand Down

0 comments on commit 75d845c

Please sign in to comment.