1234567891011121314151617181920212223242526272829303132 |
- {#
- /**
- * @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 c’est 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">×</span>
- <img id="popup-image" src="" alt="Aperçu"/>
- </div>
|