J1: Admin/Styles/Edit #65:

- Création de StyleEditViewModel
- Création de la vue edit
- Integration du edit dans le controller
This commit is contained in:
b.nodon
2026-03-06 13:21:34 +01:00
parent 9002836da0
commit 58de77a532
4 changed files with 144 additions and 19 deletions

View File

@@ -4,22 +4,23 @@
ViewData["Title"] = "Styles";
}
<div class="justify-content-center m-5">
<div class="d-flex justify-content-between align-items-center mb-4">
<h1>Gestion des Styles</h1>
@* Lien vers la création (optionnel si vous n'avez pas encore fait l'action Create) *@
<div class="container mt-4">
<h1 class="mb-3">Styles</h1>
<hr />
<div class="mb-3">
<a asp-action="Create" class="btn btn-primary">
<i class="fas fa-plus"></i> Nouveau Style
<i class="fas fa-plus"></i> Ajouter un nouvel style
</a>
</div>
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered">
<thead class="table-light">
<table class="table table-striped table-hover table-bordered table-sm">
<thead class="table-active">
<tr>
<th scope="col" style="width: 10%;">#</th>
<th scope="col">Libellé</th>
<th scope="col" class="text-center" style="width: 15%;">Actions</th>
<th scope="col" class="p-2">Libellé</th>
<th scope="col" class="text-center p-2" style="width: 100px;">Actions</th>
</tr>
</thead>
<tbody>
@@ -28,15 +29,14 @@
@foreach (Webzine.Entity.Style style in Model.Styles)
{
<tr class="align-middle">
<td>
@style.IdStyle
</td>
<td>
<td class="p-2">
@style.Libelle
</td>
<td class="text-center">
@* Bouton Supprimer (correspond à votre action Delete) *@
<a asp-action="Delete" asp-route-id="@style.IdStyle" class="d-inline btn btn-link text-main" title="Supprimer">
<td class="text-center p-2">
<a asp-action="Edit" asp-route-id="@style.IdStyle" class="text-primary me-2" title="Éditer">
<i class="fas fa-edit"></i>
</a>
<a asp-action="Delete" asp-route-id="@style.IdStyle" class="text-primary" title="Supprimer">
<i class="fas fa-trash"></i>
</a>
</td>
@@ -46,7 +46,7 @@
else
{
<tr>
<td colspan="3" class="text-center">Aucun style disponible.</td>
<td colspan="2" class="text-center p-2">Aucun style disponible.</td>
</tr>
}
</tbody>