This commit is contained in:
Σlie *
2026-02-27 22:42:01 +01:00
parent 2465d911a1
commit 96ff8da66c

View File

@ -15,18 +15,17 @@
</form>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div th:each="product : ${products}" class="bg-gray-800 p-4 rounded-xl shadow-lg">
<div th:each="product : ${products}" th:if="${product != null}" class="bg-gray-800 p-4 rounded-xl shadow-lg">
<div class="flex items-center gap-4 mb-4">
<img th:src="${product.imageUrl}" class="w-16 h-16 object-contain rounded">
<h2 class="flex-1 font-semibold text-sm" th:text="${product.name}">Nom du produit</h2>
<img th:src="${product.imageUrl != null ? product.imageUrl : 'https://via.placeholder.com/150'}" class="w-16 h-16 object-contain rounded">
<h2 class="flex-1 font-semibold text-sm" th:text="${product.name ?: 'Produit sans nom'}">Nom</h2>
<a th:href="@{'/delete/' + ${product.id}}" class="text-red-500">🗑️</a>
</div>
<canvas th:id="'chart-' + ${product.id}"></canvas>
<script th:inline="javascript">
/* Code pour générer le graphique Chart.js pour chaque produit */
</script>
</div>
</div>