Files
webzine/Webzine.WebApplication/Views/Recherche/Index.cshtml
2026-03-10 21:38:40 +01:00

86 lines
3.1 KiB
Plaintext

@model Webzine.WebApplication.ViewModels.Recherche.RechercheIndexViewModel
@{
ViewData["Title"] = "Recherche";
Layout = "_Layout";
}
<div class="container mt-4">
<div class="row">
<div class="col-md-8">
<h1 class="mb-4">Resultats pour "@Model.Mot"</h1>
<hr />
@if (string.IsNullOrWhiteSpace(Model.Mot))
{
<div class="alert alert-info">
Saisissez un mot-cle pour lancer une recherche.
</div>
}
else if (!Model.Artistes.Any() && !Model.Titres.Any())
{
<div class="alert alert-info">
Aucun artiste ni titre ne correspond a votre recherche.
</div>
}
else
{
@if (Model.Artistes.Any())
{
<h2 class="h4 mt-4">Artistes</h2>
@foreach (var artiste in Model.Artistes)
{
<div class="my-3">
<a asp-controller="Artiste"
asp-action="Index"
asp-route-nom="@artiste.Nom">
@artiste.Nom
</a>
<span class="text-muted">(@artiste.NombreDeTitres titre(s))</span>
</div>
}
}
@if (Model.Titres.Any())
{
<h2 class="h4 mt-4">Titres</h2>
@foreach (var titre in Model.Titres)
{
<div class="d-flex align-items-start my-3">
<a asp-controller="Titre"
asp-action="Details"
asp-route-id="@titre.IdTitre"
class="me-3 text-black">
<img src="@titre.UrlJaquette" alt="@titre.Libelle" width="70" height="70" class="object-fit-cover" />
</a>
<div class="justify-content-center d-flex flex-column">
<div>
<a asp-controller="Artiste"
asp-action="Index"
asp-route-nom="@titre.ArtisteNom">
@titre.ArtisteNom
</a>
-
<a asp-controller="Titre"
asp-action="Details"
asp-route-id="@titre.IdTitre">
@titre.Libelle
</a>
</div>
<div>
Duree : @TimeSpan.FromSeconds(titre.Duree).ToString(@"mm\:ss")
</div>
</div>
</div>
}
}
}
</div>
</div>
</div>