2025-02-09 16:10:35 +01:00
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
|
2025-02-09 16:39:38 +01:00
|
|
|
{% block title %}Product index{% endblock %}
|
2025-02-09 16:10:35 +01:00
|
|
|
|
2025-02-09 16:39:38 +01:00
|
|
|
{% block body %}
|
2025-02-26 16:33:36 +01:00
|
|
|
|
|
|
|
|
2025-02-26 18:19:05 +01:00
|
|
|
<h1>Index des produits</h1>
|
|
|
|
<a href="{{ path('app_product_new') }}"class="btn btn-primary btn-create" >Créer</a>
|
2025-02-09 16:10:35 +01:00
|
|
|
|
2025-02-09 16:39:38 +01:00
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Id</th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Price</th>
|
|
|
|
<th>Stock</th>
|
2025-02-14 14:25:23 +01:00
|
|
|
<th>Image</th>
|
|
|
|
<th>Comment</th>
|
2025-02-26 16:33:36 +01:00
|
|
|
<th>Utilisateur-ice</th>
|
2025-02-09 16:39:38 +01:00
|
|
|
<th>actions</th>
|
|
|
|
</tr>
|
2025-02-09 16:10:35 +01:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for product in products %}
|
|
|
|
<tr>
|
2025-02-09 16:39:38 +01:00
|
|
|
<td>{{ product.id }}</td>
|
|
|
|
<td>{{ product.name }}</td>
|
2025-02-09 16:10:35 +01:00
|
|
|
<td>{{ product.price }}</td>
|
2025-02-09 16:39:38 +01:00
|
|
|
<td>{{ product.stock }}</td>
|
2025-02-26 16:33:36 +01:00
|
|
|
<td>
|
|
|
|
<a href="{{ path('app_product_show', {'id': product.id}) }}">
|
|
|
|
<img src="{{ product.image }}" alt="{{ product.name }}" style="width: 100px; height: 100px;">
|
|
|
|
</a>
|
|
|
|
</td>
|
2025-02-14 14:25:23 +01:00
|
|
|
<td>{{ product.comment }}</td>
|
2025-02-26 16:33:36 +01:00
|
|
|
<td>{{ product.user.name }}, {{ product.user.email }}</td>
|
2025-02-09 16:10:35 +01:00
|
|
|
<td>
|
2025-02-09 16:39:38 +01:00
|
|
|
<a href="{{ path('app_product_show', {'id': product.id}) }}">show</a>
|
|
|
|
<a href="{{ path('app_product_edit', {'id': product.id}) }}">edit</a>
|
2025-02-09 16:10:35 +01:00
|
|
|
</td>
|
|
|
|
</tr>
|
2025-02-09 16:39:38 +01:00
|
|
|
{% else %}
|
|
|
|
<tr>
|
2025-02-14 14:25:23 +01:00
|
|
|
<td colspan="7">no records found</td>
|
2025-02-09 16:39:38 +01:00
|
|
|
</tr>
|
2025-02-09 16:10:35 +01:00
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2025-02-26 18:19:05 +01:00
|
|
|
<a href="{{ path('app_product_new') }}"class="btn btn-primary btn-create" >Créer</a>
|
2025-02-09 16:10:35 +01:00
|
|
|
{% endblock %}
|