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

70 lines
2.4 KiB
Plaintext

@model Webzine.WebApplication.Areas.Administration.ViewModels.Style.StyleIndexViewModel;
@{
ViewData["Title"] = "Styles";
}
<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> Ajouter un nouvel style
</a>
</div>
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-sm">
<thead class="table-active">
<tr>
<th scope="col" class="p-2">Libellé</th>
<th scope="col" class="text-center p-2">Actions</th>
</tr>
</thead>
<tbody>
@if (Model.Styles.Any())
{
@foreach (Webzine.Entity.Style style in Model.Styles)
{
<tr >
<td class="p-2 w-75">
@style.Libelle
</td>
<td class="text-center w-auto 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" title="Supprimer">
<i class="fas fa-trash"></i>
</a>
</td>
</tr>
}
}
else
{
<tr>
<td colspan="2" class="text-center p-2">Aucun style disponible.</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>