Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
212
/
task
/
212
/
root
/
proc
/
212
/
root
/
proc
/
70528
/
cwd
/
templates
/
back
/
product
/
//proc/212/task/212/root/proc/212/root/proc/70528/cwd/templates/back/product/images.html.twig
{% extends "back/layout.html.twig" %} {% block content %} <a href="{{ path("back_product_edit", { id : product.id }) }}" class="btn btn-primary mb-3">Retour</a> <div class="row mb-3"> {% for image in product.productImages %} <div class="col-md-3" id="container-{{ image.id }}"> <img src="{{ vich_uploader_asset(image, "imageFile") }}" alt="Image du produit"> <a class="btn btn-danger delete-image mt-3" data-id="{{ image.id }}">Supprimer</a> </div> {% endfor %} </div> {{ form_start(form) }} {{ form_row(form.imageFile) }} {{ form_row(form.name) }} <div class="align-right-center"> <a href="{{ path("back_product_list") }}" class="btn btn-secondary btn-sm float-end me-2">Terminer</a> <input type="submit" value="Ajouter l'image" class="btn btn-primary float-end"> </div> {{ form_end(form) }} <style> .vich-image a { display: none; } </style> <script> let deleteImages = document.getElementsByClassName("delete-image"); for (let i = 0; i < deleteImages.length; i++) { deleteImages[i].addEventListener("click", () => { request = new XMLHttpRequest(); let id = deleteImages[i].getAttribute("data-id"); request.open("POST", `/admin/product/image/${id}/delete`); request.onload = () => { document.getElementById (`container-${id}`).style.display = "none"; } request.send(); }) } </script> {% endblock %}