#192 Pagination des pages admin. On peut passer à la page précédente seulement si le numéro de page est >0 et la dernière page n'affiche pas de bouton pour la page suivante.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
@model IEnumerable<Webzine.Entity.Artiste>
|
||||
@model Webzine.WebApplication.Areas.Administration.ViewModels.Artiste.ArtisteIndexViewModel;
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Artiste";
|
||||
@@ -21,7 +21,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach (var artiste in Model)
|
||||
@foreach (var artiste in Model.Artistes)
|
||||
{
|
||||
<tr class="align-middle">
|
||||
<td class="p-2">
|
||||
@@ -44,5 +44,21 @@
|
||||
}
|
||||
</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">
|
||||
<< 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 >>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
@model Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire.CommentaireViewModel
|
||||
@model Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire.CommentaireIndexViewModel;
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Commentaires";
|
||||
@@ -47,5 +47,21 @@
|
||||
}
|
||||
</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">
|
||||
<< 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 >>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
@model IEnumerable<Webzine.Entity.Style>
|
||||
@model Webzine.WebApplication.Areas.Administration.ViewModels.Style.StyleIndexViewModel;
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Styles";
|
||||
@@ -24,9 +24,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ( Model.Any())
|
||||
@if (Model.Styles.Any())
|
||||
{
|
||||
@foreach (Webzine.Entity.Style style in Model)
|
||||
@foreach (Webzine.Entity.Style style in Model.Styles)
|
||||
{
|
||||
<tr >
|
||||
<td class="p-2 w-75">
|
||||
@@ -52,4 +52,19 @@
|
||||
</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">
|
||||
<< 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 >>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
@model IEnumerable<Webzine.WebApplication.Areas.Administration.ViewModels.Titre.AdminTitreList>
|
||||
@model Webzine.WebApplication.Areas.Administration.ViewModels.Titre.TitreIndexViewModel;
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Titres";
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<tbody>
|
||||
|
||||
@foreach (var item in Model)
|
||||
@foreach (var item in Model.Titres)
|
||||
{
|
||||
<tr>
|
||||
<td>@item.Nom</td>
|
||||
@@ -59,5 +59,21 @@
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</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">
|
||||
<< 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 >>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user