#218 : Soucis de routage des styles sur la page d'accueil.
This commit is contained in:
@@ -436,6 +436,7 @@ public class DbTitreRepository : ITitreRepository
|
||||
return this.context.Titres
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(t => t.DateCreation)
|
||||
.ThenByDescending(t => t.IdTitre)
|
||||
.Paginate(offset, limit)
|
||||
.Include(t => t.Artiste)
|
||||
.Include(a => a.Styles);
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Webzine.WebApplication.Controllers
|
||||
/// <param name="style">Nom du style musical.</param>
|
||||
/// <param name="page">Numéro de la page.</param>
|
||||
/// <returns>Vue contenant la liste filtree.</returns>
|
||||
[Route("/titres/styles/{style}", Name = "TitresParStyle")]
|
||||
[Route("/titres/style/{style}", Name = "TitresParStyle")]
|
||||
public IActionResult Style(string style, int page = 0)
|
||||
{
|
||||
var offset = page * 10;
|
||||
|
||||
@@ -73,21 +73,34 @@
|
||||
</div>
|
||||
}
|
||||
<!-- Bouton -->
|
||||
<div class="row justify-content-between">
|
||||
<div class="d-flex align-items-center justify-content-between mt-3">
|
||||
@if (Model.Page > 0)
|
||||
{
|
||||
<a asp-action="Index" asp-route-page="@(Model.Page - 1)"
|
||||
class="btn btn-secondary col-auto mt-3">
|
||||
class="btn btn-secondary">
|
||||
<< Titre plus récent
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div></div>
|
||||
}
|
||||
|
||||
<p class="mb-0">
|
||||
Page : @(Model.Page + 1) sur @Model.TotalPages
|
||||
</p>
|
||||
|
||||
@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">
|
||||
class="btn btn-secondary">
|
||||
Titre plus anciens >>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div></div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user