Files
webzine/Webzine.WebApplication/Areas/Administration/Views/Commentaires/Index.cshtml
b.nodon 0c7996ae1f Rework #30 #31 #43 :
- Changement de la route
- CSS remplacé par bootstrap
2026-03-05 15:28:27 +01:00

52 lines
2.1 KiB
Plaintext

@model Webzine.WebApplication.Areas.Administration.ViewModels.CommentaireViewModel
@{
ViewData["Title"] = "Commentaires";
}
<div class="justify-content-center m-5">
<h1 class="mb-4">Commentaires</h1>
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered">
<thead class="table-light">
<tr>
<th scope="col">Titre</th>
<th scope="col">Auteur</th>
<th scope="col">Commentaire</th>
<th scope="col">Date de création</th>
<th scope="col" class="text-center">Actions</th>
</tr>
</thead>
<tbody>
@foreach (Webzine.Entity.Commentaire commentaire in Model.Commentaires)
{
<tr class="align-middle">
<td>
@(commentaire.Titre != null ? commentaire.Titre.Libelle : "Titre inconnu")
</td>
<td>
@commentaire.Auteur
</td>
<td>
@commentaire.Contenu
</td>
<td>
@commentaire.DateCreation.ToString("dd/MM/yyyy HH:mm:ss")
</td>
<td class="text-center">
<form method="post" action="@Url.Action("Delete", new { id = commentaire.IdCommentaire })" class="d-inline">
@Html.AntiForgeryToken()
<!-- Bouton rouge (text-danger) sans fond (btn-link) -->
<button type="submit" class="btn btn-link text-primary p-0" title="Supprimer" onclick="return confirm('Êtes-vous sûr de vouloir supprimer ce commentaire ?');">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>