{# Galerie media produit (images + videos) - responsive mobile #} {% set productMedia = product.productMedia %}

Media ({{ productMedia|length }})

{# Bouton ajouter #}
{# Zone de preview avant upload #} {# Galerie des medias uploades #} {% if productMedia|length > 0 %}
{% for pm in productMedia %} {% set mediaUrl = pm.media and pm.media.filePath ? path('app_media_serve', {path: pm.media.filePath}) : '' %} {% set isVideo = pm.media and pm.media.category == 'video' %}
{# Thumbnail cliquable - ouvre overlay #}
{% if mediaUrl %} {% if isVideo %}
{% else %} {{ pm.altText|default(product.name) }} {% endif %} {% else %}
{% endif %} {% if pm.isPrimary %} Principale {% endif %} {% if isVideo %} {% endif %}
{# Barre d'actions en bas de la card #}
{# Ouvrir #} {# Telecharger #} {# Definir comme principale #} {% if not pm.isPrimary %}
{% else %} {% endif %} {# Supprimer #} {% include 'components/pos/_confirm_modal.html.twig' with { modal_id: 'del-img-' ~ pm.id, title: 'Supprimer le media', message: 'Ce fichier sera definitivement supprime.', action_url: path('manager_pos_products_delete_image', {id: product.id, mediaId: pm.id}), csrf_token_name: 'delete_product_image_' ~ pm.id, } %}
{% endfor %}
{% else %}

Aucun media

Cliquez sur "Ajouter" pour charger des images ou videos

{% endif %} {# Overlay pour preview plein ecran #}