Files
drupal-reha/web/themes/custom/reha/templates/file-link.html.twig
T
2025-10-03 15:32:29 +02:00

32 lines
805 B
Twig
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{#
/**
* @file
* Default theme implementation for a link to a file.
*
* Available variables:
* - attributes: The HTML attributes for the containing element.
* - link: A link to the file.
* - file_size: The size of the file.
* - file: L'objet fichier (si fourni).
*
* @see template_preprocess_file_link()
*
* @ingroup themeable
*/
#}
<span{{ attributes }}>
{# Si cest une image PNG ou JPG → ajouter la classe popup-link #}
{% if file.mime == 'image/png' or file.mime == 'image/jpeg' %}
{{ link|replace({'<a ': '<a class="popup-link" '})|raw }}
{% else %}
{{ link }}
{% endif %}
</span>
{% if file_size %}
<span>({{ file_size }})</span>
{% endif %}
<div id="popup-overlay">
<span class="popup-close">&times;</span>
<img id="popup-image" src="" alt="Aperçu"/>
</div>