Ajout du moteur de recherche dans le header
This commit is contained in:
85
Webzine.WebApplication/Views/Recherche/Index.cshtml
Normal file
85
Webzine.WebApplication/Views/Recherche/Index.cshtml
Normal file
@@ -0,0 +1,85 @@
|
||||
@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>
|
||||
@@ -3,11 +3,11 @@
|
||||
*@
|
||||
@{
|
||||
}
|
||||
<div class="text-bg-light my-2 pb-0">
|
||||
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4">
|
||||
<div class="site-footer text-bg-light mt-auto">
|
||||
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3">
|
||||
<div class="col-md-4 d-flex align-items-center">
|
||||
|
||||
<span class="mb-3 mb-md-0 ms-5 text-body-secondary">© ASP .NET Core - DIIAGE 2025 - 2026</span>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -62,10 +62,13 @@
|
||||
</ul>
|
||||
|
||||
<!-- Barre de recherche -->
|
||||
<form class="d-flex">
|
||||
<form class="d-flex" asp-controller="Recherche" asp-action="Index" method="post">
|
||||
<div class="input-group">
|
||||
<div class="form-outline">
|
||||
<input class="form-control me-2" type="search" placeholder="Trouver un artiste / titre">
|
||||
<input class="form-control me-2"
|
||||
type="search"
|
||||
name="mot"
|
||||
placeholder="Trouver un artiste, un titre ou un style">
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<i class="fa-solid fa-magnifying-glass"></i>
|
||||
@@ -75,4 +78,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
</header>
|
||||
|
||||
@@ -15,18 +15,20 @@
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="pb-0 mb-0">
|
||||
<div class="site-shell">
|
||||
<partial name="_Header"/>
|
||||
<div class="row mt-5">
|
||||
<main class="col mx-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
@if(ViewContext.RouteData.Values["area"]?.ToString() != "Administration")
|
||||
{
|
||||
<partial name="_Sidebar" />
|
||||
}
|
||||
<div class="container-fluid flex-grow-1 py-4">
|
||||
<div class="row g-0">
|
||||
<main class="col mx-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
@if(ViewContext.RouteData.Values["area"]?.ToString() != "Administration")
|
||||
{
|
||||
<partial name="_Sidebar" />
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<partial name="_Footer" />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user