Files
webzine/Webzine.WebApplication/Areas/Administration/Views/Commentaire/Index.cshtml

67 lines
2.4 KiB
Plaintext

@model Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire.CommentaireIndexViewModel;
@{
ViewData["Title"] = "Commentaires";
}
<div class="container mt-4">
<h1 class="mb-4">Commentaires</h1>
<hr />
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered">
<thead class="table-active">
<tr>
<th scope="col">Titre</th>
<th scope="col">Nom</th>
<th scope="col">Commentaire</th>
<th scope="col">Date de création</th>
<th scope="col" class="text-center p-2">Actions</th>
</tr>
</thead>
<tbody>
@foreach (Webzine.Entity.Commentaire commentaire in Model.Commentaires)
{
<tr class="align-middle">
<td>
<a asp-controller="Titre" asp-action="Index" asp-route-id="@commentaire.Titre.IdTitre">
@commentaire.Titre.Libelle
</a>
</td>
<td>
@commentaire.Auteur
</td>
<td>
@commentaire.Contenu
</td>
<td>
@commentaire.DateCreation.ToString("dd/MM/yyyy HH:mm:ss")
</td>
<td class="text-center">
<a asp-action="Delete" asp-route-id="@commentaire.IdCommentaire" class="d-inline btn btn-link text-primary">
<i class="fas fa-trash"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
<div class="row justify-content-between">
@if (Model.Page > 0)
{
<a asp-action="Index" asp-route-page="@(Model.Page - 1)"
class="btn btn-secondary col-auto mt-3">
&lt;&lt; Page précédente
</a>
}
@if (Model.Page < Model.TotalPages - 1)
{
<a asp-action="Index" asp-route-page="@(Model.Page + 1)"
class="btn btn-secondary col-auto mt-3 ms-auto">
Page suivante &gt;&gt;
</a>
}
</div>
</div>