Merge branch 'j2/ajout_repo' of https://10.4.0.131/gitea/DI1-P4-E1/Webzine into j2/feat/repository-commentaire
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers;
|
||||
public class ArtisteController : Controller
|
||||
{
|
||||
// Injection du logger via le constructeur
|
||||
private readonly ILogger<ArtisteController> _logger;
|
||||
private readonly ILogger<ArtisteController> logger;
|
||||
private readonly IArtisteRepository _artisteRepository;
|
||||
private readonly List<Artiste> _artistes = new List<Artiste>();
|
||||
|
||||
@@ -18,8 +18,8 @@ public class ArtisteController : Controller
|
||||
public ArtisteController(ILogger<ArtisteController> logger,
|
||||
IArtisteRepository artisteRepository)
|
||||
{
|
||||
this._logger = logger;
|
||||
this._logger.LogDebug(1, "initialisation du ArtisteController d'administration");
|
||||
this.logger = logger;
|
||||
this.logger.LogDebug(1, "initialisation du ArtisteController d'administration");
|
||||
this._artisteRepository = artisteRepository;
|
||||
this._artistes.AddRange(this._artisteRepository.FindAll());
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Webzine.WebApplication.Areas.Administration.Controllers
|
||||
|
||||
if (commentaire == null)
|
||||
{
|
||||
this._logger.LogWarning("Commentaire avec ID {Id} introuvable pour suppression.", id);
|
||||
this.logger.LogWarning("Commentaire avec ID {Id} introuvable pour suppression.", id);
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<thead class="table-active">
|
||||
<tr>
|
||||
<th scope="col" class="p-2">Nom</th>
|
||||
<th scope="col" class="text-center p-2" style="width: 100px;">Actions</th>
|
||||
<th scope="col" class="text-center p-2">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<div class="container">
|
||||
<!-- ARTISTE -->
|
||||
<div class="row mb-3 align-items-center">
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-3 col-form-label">Nom de l'artiste<span class="text-danger">*</span></label>
|
||||
<div class="col-md-9">
|
||||
<input asp-for="Nom" class="form-control" />
|
||||
@@ -10,14 +10,15 @@
|
||||
</div>
|
||||
|
||||
<!-- BIOGRAPHIE -->
|
||||
<div class="row mb-3 align-items-center">
|
||||
<label class="col-md-3 col-form-label">Biographie<span class="text-danger">*</span></label>
|
||||
<div class="row mb-3">
|
||||
<label class="col-md-3 col-form-label">Biographie</label>
|
||||
<div class="col-md-9">
|
||||
<input asp-for="Biographie" class="form-control"/>
|
||||
<textarea asp-for="Biographie" class="form-control" rows="5"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- BOUTONS -->
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-9 offset-md-3">
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
<thead class="table-active">
|
||||
<tr>
|
||||
<th scope="col">Titre</th>
|
||||
<th scope="col">Auteur</th>
|
||||
<th scope="col">Nom</th>
|
||||
<th scope="col">Commentaire</th>
|
||||
<th scope="col">Date de création</th>
|
||||
<th scope="col" class="text-center p-2" style="width: 100px" ;>Actions</th>
|
||||
<th scope="col" class="text-center p-2">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -25,7 +25,9 @@
|
||||
{
|
||||
<tr class="align-middle">
|
||||
<td>
|
||||
@commentaire.Titre.Libelle
|
||||
<a asp-action="Details" asp-controller="Titre" asp-route-id="@commentaire.Titre.IdTitre">
|
||||
@commentaire.Titre.Libelle
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@commentaire.Auteur
|
||||
|
||||
@@ -12,19 +12,19 @@
|
||||
<div class="col-md-4">
|
||||
<a asp-area="Administration"
|
||||
asp-controller="Artiste">
|
||||
<div class="ratio ratio-4x3">
|
||||
|
||||
<div class="card shadow-sm p-4 bg-light h-100 dashboard-card">
|
||||
<i class="fa fa-users fa-3x text-primary mb-3"></i>
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center text-primary">
|
||||
<i class="fa fa-users fa-5x text-primary mb-3"></i>
|
||||
|
||||
<h3>
|
||||
@Model.NombreArtistes
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
artistes
|
||||
</p>
|
||||
<h2>
|
||||
@Model.NombreArtistes
|
||||
</h2>
|
||||
<p>
|
||||
artistes
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -33,17 +33,17 @@
|
||||
<a asp-area=""
|
||||
asp-controller="Artiste"
|
||||
asp-route-nom="@Model.ArtisteLePlusChronique">
|
||||
<div class="ratio ratio-4x3">
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center text-primary">
|
||||
<i class="fa fa-user fa-5x text-primary mb-3"></i>
|
||||
|
||||
<div class="card shadow-sm p-4 bg-light h-100 dashboard-card">
|
||||
<i class="fa fa-user fa-3x text-primary mb-3"></i>
|
||||
<h2>
|
||||
@Model.ArtisteLePlusChronique
|
||||
</h2>
|
||||
|
||||
<h3>
|
||||
@Model.ArtisteLePlusChronique
|
||||
</h3>
|
||||
|
||||
<p>artiste le plus chroniqué</p>
|
||||
<p>artiste le plus chroniqué</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -52,19 +52,20 @@
|
||||
<a asp-area=""
|
||||
asp-controller="Artiste"
|
||||
asp-route-nom="@Model.AlbumLePlusChronique">
|
||||
<div class="ratio ratio-4x3">
|
||||
|
||||
<div class="card shadow-sm p-4 bg-light h-100 dashboard-card">
|
||||
<i class="fa fa-trophy fa-3x text-primary mb-3"></i>
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center text-primary">
|
||||
<i class="fa fa-trophy fa-5x text-primary mb-3"></i>
|
||||
|
||||
<h3>
|
||||
<h2>
|
||||
@Model.AlbumLePlusChronique
|
||||
</h3>
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
artiste avec le plus d'albums distincts
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -72,19 +73,20 @@
|
||||
<div class="col-md-4">
|
||||
<a asp-area="Administration"
|
||||
asp-controller="Titre">
|
||||
<div class="ratio ratio-4x3">
|
||||
|
||||
<div class="card shadow-sm p-4 bg-light h-100 dashboard-card">
|
||||
<i class="fa fa-book fa-3x text-primary mb-3"></i>
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center text-primary">
|
||||
<i class="fa fa-book fa-5x text-primary mb-3"></i>
|
||||
|
||||
<h3>
|
||||
<h2>
|
||||
@Model.NombreBiographies
|
||||
</h3>
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
biographies d'artistes
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -94,19 +96,20 @@
|
||||
asp-controller="Titre"
|
||||
asp-action="Details"
|
||||
asp-route-id="@Model.IdMusiqueLaPlusJouee">
|
||||
<div class="ratio ratio-4x3">
|
||||
|
||||
<div class="card shadow-sm p-4 bg-light h-100 dashboard-card">
|
||||
<i class="fa fa-compact-disc fa-3x text-primary mb-3"></i>
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center text-primary">
|
||||
<i class="fa fa-compact-disc fa-5x text-primary mb-3"></i>
|
||||
|
||||
<h4>
|
||||
<h2>
|
||||
@Model.MusiqueLaPlusJouee
|
||||
</h4>
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
titre le plus lu
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -114,19 +117,20 @@
|
||||
<div class="col-md-4">
|
||||
<a asp-area="Administration"
|
||||
asp-controller="Titre">
|
||||
<div class="ratio ratio-4x3">
|
||||
|
||||
<div class="card shadow-sm p-4 bg-light h-100 dashboard-card">
|
||||
<i class="fa fa-music fa-3x text-primary mb-3"></i>
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center text-primary">
|
||||
<i class="fa fa-music fa-5x text-primary mb-3"></i>
|
||||
|
||||
<h3>
|
||||
<h2>
|
||||
@Model.NombreTitres
|
||||
</h3>
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
titres
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -134,50 +138,57 @@
|
||||
<div class="col-md-4">
|
||||
<a asp-area="Administration"
|
||||
asp-controller="Styles">
|
||||
<div class="ratio ratio-4x3">
|
||||
|
||||
<div class="card shadow-sm p-4 bg-light h-100 dashboard-card">
|
||||
<i class="fa fa-tags fa-3x text-primary mb-3"></i>
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center text-primary">
|
||||
<i class="fa fa-tags fa-5x text-primary mb-3"></i>
|
||||
|
||||
<h3>
|
||||
<h2>
|
||||
@Model.NombreGenres
|
||||
</h3>
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
styles de musique
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- NOMBRE DE LECTURES -->
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-4 bg-light h-100">
|
||||
<i class="fa fa-eye fa-3x text-dark mb-3"></i>
|
||||
<div class="ratio ratio-4x3">
|
||||
|
||||
<h3>
|
||||
@Model.NombreLectures
|
||||
</h3>
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center">
|
||||
<i class="fa fa-eye fa-5x text-dark mb-3"></i>
|
||||
|
||||
<p>
|
||||
lectures
|
||||
</p>
|
||||
<h2>
|
||||
@Model.NombreLectures
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
lectures
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- TOTAL LIKES -->
|
||||
<div class="col-md-4">
|
||||
<div class="card shadow-sm p-4 bg-light h-100">
|
||||
<i class="fa fa-thumbs-up fa-3x text-dark mb-3"></i>
|
||||
<div class="ratio ratio-4x3">
|
||||
|
||||
<h3>
|
||||
<div class="py-5 bg-light rounded-3 d-flex flex-column justify-content-center align-items-center">
|
||||
<i class="fa fa-thumbs-up fa-5x text-dark mb-3"></i>
|
||||
|
||||
<h2>
|
||||
@Model.NombreLikes
|
||||
</h3>
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
likes
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
@* Input *@
|
||||
<div class="me-3">
|
||||
<input asp-for="Libelle" class="form-control" style="width: 250px;" />
|
||||
<input asp-for="Libelle" class="form-control" />
|
||||
</div>
|
||||
|
||||
@* Bouton *@
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
@* Input *@
|
||||
<div class="me-3">
|
||||
<input asp-for="Libelle" class="form-control" style="width: 250px;" />
|
||||
<input asp-for="Libelle" class="form-control" />
|
||||
</div>
|
||||
|
||||
@* Bouton *@
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<thead class="table-active">
|
||||
<tr>
|
||||
<th scope="col" class="p-2">Libellé</th>
|
||||
<th scope="col" class="text-center p-2" style="width: 100px;">Actions</th>
|
||||
<th scope="col" class="text-center p-2">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -28,11 +28,11 @@
|
||||
{
|
||||
@foreach (Webzine.Entity.Style style in Model)
|
||||
{
|
||||
<tr class="align-middle">
|
||||
<td class="p-2">
|
||||
<tr >
|
||||
<td class="p-2 w-75">
|
||||
@style.Libelle
|
||||
</td>
|
||||
<td class="text-center p-2">
|
||||
<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>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
<!-- JAQUETTE -->
|
||||
<div class="row mb-3 align-items-center">
|
||||
<label class="col-md-3 col-form-label">Jaquette<span class="text-danger">*</span></label>
|
||||
<label class="col-md-3 col-form-label">Jaquette de l'album<span class="text-danger">*</span></label>
|
||||
<div class="col-md-9">
|
||||
<input asp-for="UrlJaquette"
|
||||
class="form-control"/>
|
||||
@@ -102,13 +102,13 @@
|
||||
</div>
|
||||
|
||||
<!-- LECTURES / LIKES (AFFICHAGE UNIQUEMENT) -->
|
||||
<div class="row mb-4 align-items-center">
|
||||
<div class="row align-items-center">
|
||||
<label class="col-md-3 col-form-label">Nb de lectures<span class="text-danger">*</span></label>
|
||||
<div class="col-md-3">
|
||||
@Model.NbLectures
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-4 align-items-center">
|
||||
<div class="row align-items-center">
|
||||
<label class="col-md-3 col-form-label">Nb de likes<span class="text-danger">*</span></label>
|
||||
<div class="col-md-3">
|
||||
@Model.NbLikes
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
// Copyright (c) Equipe 1 - . All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
using Webzine.Repository.Contracts;
|
||||
|
||||
namespace Webzine.WebApplication.Controllers
|
||||
{
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Webzine.Repository.Fake;
|
||||
using Webzine.Repository.Contracts;
|
||||
using Webzine.WebApplication.ViewModels.Accueil;
|
||||
|
||||
/// <summary>
|
||||
@@ -25,13 +23,16 @@ namespace Webzine.WebApplication.Controllers
|
||||
/// </summary>
|
||||
/// <param name="logger">Service de journalisation injecté pour enregistrer les événements et les erreurs.</param>
|
||||
/// <param name="configuration">Service d'injection de configuration pour accéder aux paramètres de l'application.</param>
|
||||
/// <param name="titreRepository">Repository des titres injecté pour accéder aux données des titres.</param>
|
||||
public AccueilController(ILogger<AccueilController> logger, IConfiguration configuration, ITitreRepository titreRepository)
|
||||
public AccueilController(
|
||||
ILogger<AccueilController> logger,
|
||||
IConfiguration configuration,
|
||||
ITitreRepository titreRepository)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.configuration = configuration;
|
||||
this.titreRepository = titreRepository;
|
||||
this.logger.LogDebug(1, "initialisation du AccueilController");
|
||||
this.titreRepository = titreRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -43,20 +44,19 @@ namespace Webzine.WebApplication.Controllers
|
||||
this.logger.LogInformation("Arrivée sur la page d'accueil");
|
||||
|
||||
var derniereChronique = this.configuration.GetValue<int>("Webzine:NombreDerniereChronique");
|
||||
var topTitres = this.configuration.GetValue<int>("Webzine:NombreDeTopTitres");
|
||||
var titres = this.titreRepository.FindAll()
|
||||
.ToList();
|
||||
var nbTopTitres = this.configuration.GetValue<int>("Webzine:NombreDeTopTitres");
|
||||
|
||||
// var titres = FakeDataFactory.GetTitres();
|
||||
// var titres = this.titreRepository.FindTitres(derniereChronique, nbTopTitres);
|
||||
var titres = this.titreRepository.FindAll();
|
||||
|
||||
var vm = new AccueilIndexViewModel
|
||||
{
|
||||
DerniersTitres = titres
|
||||
.OrderByDescending(t => t.DateCreation)
|
||||
.Take(derniereChronique)
|
||||
.ToList(),
|
||||
DerniersTitres = titres.Take(derniereChronique).ToList(),
|
||||
|
||||
TopTitres = titres
|
||||
.OrderByDescending(t => t.NbLikes)
|
||||
.Take(topTitres)
|
||||
.Take(nbTopTitres)
|
||||
.ToList(),
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ApiController : ControllerBase
|
||||
return Ok(new
|
||||
{
|
||||
nom = "webzine",
|
||||
version = "1.0",
|
||||
version = "2.0",
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
public class ArtisteController : Controller
|
||||
{
|
||||
// Injection du logger via le constructeur
|
||||
private readonly ILogger<ArtisteController> _logger;
|
||||
private readonly ILogger<ArtisteController> logger;
|
||||
private readonly IArtisteRepository _artisteRepository;
|
||||
|
||||
/// <summary>
|
||||
@@ -18,8 +18,8 @@
|
||||
public ArtisteController(ILogger<ArtisteController> logger,
|
||||
IArtisteRepository artisteRepository)
|
||||
{
|
||||
this._logger = logger;
|
||||
this._logger.LogDebug("Initialisation du ArtisteController");
|
||||
this.logger = logger;
|
||||
this.logger.LogDebug("Initialisation du ArtisteController");
|
||||
this._artisteRepository = artisteRepository;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
if (string.IsNullOrEmpty(nom))
|
||||
{
|
||||
this._logger.LogWarning("Nom de l'artiste manquant dans la requête.");
|
||||
this.logger.LogWarning("Nom de l'artiste manquant dans la requête.");
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
if (artiste == null)
|
||||
{
|
||||
this._logger.LogWarning("Artiste non trouvé pour le nom : {NomArtiste}", nomPropre);
|
||||
this.logger.LogWarning("Artiste non trouvé pour le nom : {NomArtiste}", nomPropre);
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
var viewModel = new ArtisteDetailsViewModel
|
||||
@@ -63,7 +63,7 @@
|
||||
.OrderBy(g => g.Key),
|
||||
};
|
||||
|
||||
this._logger.LogInformation("Artiste trouvé : {NomArtiste}", nom);
|
||||
this.logger.LogInformation("Artiste trouvé : {NomArtiste}", nom);
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
@@ -1,75 +1,68 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Webzine.Repository.Contracts;
|
||||
using Webzine.WebApplication.ViewModels.Recherche;
|
||||
using Webzine.WebApplication.ViewModels.Titre;
|
||||
// <copyright file="RechercheController.cs" company=" Equipe 1 - ">
|
||||
// Copyright (c) Equipe 1 - . All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Webzine.WebApplication.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Controleur responsable de la recherche d'artistes et de titres musicaux.
|
||||
/// </summary>
|
||||
[Route("recherche")]
|
||||
public class RechercheController : Controller
|
||||
namespace Webzine.WebApplication.Controllers
|
||||
{
|
||||
private readonly ILogger<RechercheController> logger;
|
||||
private readonly ITitreRepository titreRepository;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Webzine.Repository.Contracts;
|
||||
using Webzine.WebApplication.ViewModels.Recherche;
|
||||
using Webzine.WebApplication.ViewModels.Titre;
|
||||
|
||||
/// <summary>
|
||||
/// Initialise une nouvelle instance de la classe <see cref="RechercheController"/>.
|
||||
/// </summary>
|
||||
/// <param name="logger">Service de journalisation injecté pour suivre les opérations du contrôleur.</param>
|
||||
/// <param name="titreRepository">Repository des titres injecté pour effectuer les recherches d'artistes et de titres.</param>
|
||||
public RechercheController(ILogger<RechercheController> logger, ITitreRepository titreRepository)
|
||||
[Route("recherche")]
|
||||
public class RechercheController : Controller
|
||||
{
|
||||
this.logger = logger;
|
||||
this.titreRepository = titreRepository;
|
||||
}
|
||||
private readonly ILogger<RechercheController> logger;
|
||||
private readonly ITitreRepository titreRepository;
|
||||
|
||||
/// <summary>
|
||||
/// Affiche les résultats de la recherche d'artistes et de titres en fonction du mot-clé fourni.
|
||||
/// </summary>
|
||||
/// <param name="mot">Le mot-clé de recherche utilisé pour trouver les artistes et les titres correspondants.</param>
|
||||
/// <returns>Une vue contenant les résultats de la recherche d'artistes et de titres.</returns>
|
||||
[HttpPost("")]
|
||||
public IActionResult Index(string mot)
|
||||
{
|
||||
this.logger.LogInformation("Recherche artistes/titres pour le mot : {Mot}.", mot);
|
||||
|
||||
var titres = this.titreRepository.Search(mot)
|
||||
.Concat(this.titreRepository.SearchByStyle(mot))
|
||||
.DistinctBy(t => t.IdTitre)
|
||||
.OrderBy(t => t.Libelle)
|
||||
.Select(t => new TitreStyleItem
|
||||
{
|
||||
IdTitre = t.IdTitre,
|
||||
Libelle = t.Libelle,
|
||||
ArtisteNom = t.Artiste?.Nom,
|
||||
UrlJaquette = t.UrlJaquette,
|
||||
Duree = t.Duree,
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var artistes = this.titreRepository.FindAll()
|
||||
.Select(t => t.Artiste)
|
||||
.Where(a => !string.IsNullOrWhiteSpace(a.Nom)
|
||||
&& !string.IsNullOrWhiteSpace(mot)
|
||||
&& a.Nom.Contains(mot, StringComparison.OrdinalIgnoreCase))
|
||||
.DistinctBy(a => a!.IdArtiste)
|
||||
.OrderBy(a => a!.Nom)
|
||||
.Select(a => new RechercheArtisteItem
|
||||
{
|
||||
Nom = a!.Nom,
|
||||
NombreDeTitres = a.Titres?.Count ?? 0,
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var vm = new RechercheIndexViewModel
|
||||
public RechercheController(ILogger<RechercheController> logger, ITitreRepository titreRepository)
|
||||
{
|
||||
Mot = mot,
|
||||
Artistes = artistes,
|
||||
Titres = titres,
|
||||
};
|
||||
this.logger = logger;
|
||||
this.titreRepository = titreRepository;
|
||||
}
|
||||
|
||||
return this.View(vm);
|
||||
[HttpPost("")]
|
||||
public IActionResult Index(string mot)
|
||||
{
|
||||
this.logger.LogInformation("Recherche artistes/titres pour le mot : {Mot}.", mot);
|
||||
|
||||
var titres = this.titreRepository.Search(mot)
|
||||
.Concat(this.titreRepository.SearchByStyle(mot))
|
||||
.DistinctBy(t => t.IdTitre)
|
||||
.OrderBy(t => t.Libelle)
|
||||
.Select(t => new TitreStyleItem
|
||||
{
|
||||
IdTitre = t.IdTitre,
|
||||
Libelle = t.Libelle,
|
||||
ArtisteNom = t.Artiste?.Nom,
|
||||
UrlJaquette = t.UrlJaquette,
|
||||
Duree = t.Duree,
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var artistes = this.titreRepository.FindAll()
|
||||
.Select(t => t.Artiste)
|
||||
.Where(a => a != null
|
||||
&& !string.IsNullOrWhiteSpace(a.Nom)
|
||||
&& !string.IsNullOrWhiteSpace(mot)
|
||||
&& a.Nom.Contains(mot, StringComparison.OrdinalIgnoreCase))
|
||||
.DistinctBy(a => a!.IdArtiste)
|
||||
.OrderBy(a => a!.Nom)
|
||||
.Select(a => new RechercheArtisteItem
|
||||
{
|
||||
Nom = a!.Nom,
|
||||
NombreDeTitres = a.Titres?.Count ?? 0,
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var vm = new RechercheIndexViewModel
|
||||
{
|
||||
Mot = mot,
|
||||
Artistes = artistes,
|
||||
Titres = titres,
|
||||
};
|
||||
|
||||
return this.View(vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,166 +1,171 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Webzine.Entity;
|
||||
using Webzine.Repository.Contracts;
|
||||
using Webzine.WebApplication.ViewModels.Titre;
|
||||
// <copyright file="TitreController.cs" company=" Equipe 1 - ">
|
||||
// Copyright (c) Equipe 1 - . All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Webzine.WebApplication.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Controleur responsable de la gestion des titres musicaux :
|
||||
/// affichage des details, filtrage par style,
|
||||
/// ajout de likes, commentaires et recherche.
|
||||
/// </summary>
|
||||
[Route("titre")]
|
||||
public class TitreController : Controller
|
||||
namespace Webzine.WebApplication.Controllers
|
||||
{
|
||||
private readonly ILogger<TitreController> _logger;
|
||||
private readonly ITitreRepository _titreRepository;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Webzine.Entity;
|
||||
using Webzine.Repository.Contracts;
|
||||
using Webzine.WebApplication.ViewModels.Titre;
|
||||
|
||||
/// <summary>
|
||||
/// Initialise une nouvelle instance de la classe <see cref="TitreController"/>.
|
||||
/// Controleur responsable de la gestion des titres musicaux :
|
||||
/// affichage des details, filtrage par style,
|
||||
/// ajout de likes, commentaires et recherche.
|
||||
/// </summary>
|
||||
/// <param name="logger">Service de journalisation injecte.</param>
|
||||
/// <param name="titreRepository">Repository des titres injecte.</param>
|
||||
public TitreController(ILogger<TitreController> logger, ITitreRepository titreRepository)
|
||||
[Route("titre")]
|
||||
public class TitreController : Controller
|
||||
{
|
||||
this._logger = logger;
|
||||
this._titreRepository = titreRepository;
|
||||
private readonly ILogger<TitreController> logger;
|
||||
private readonly ITitreRepository titreRepository;
|
||||
|
||||
this._logger.LogInformation("Initialisation du controleur TitreController.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Affiche le detail d'un titre specifique.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifiant du titre.</param>
|
||||
/// <returns>Vue des details ou 404 si introuvable.</returns>
|
||||
[HttpGet("{id}")]
|
||||
public IActionResult Details(int id)
|
||||
{
|
||||
this._logger.LogInformation("Demande d'affichage du detail pour le titre ID {Id}.", id);
|
||||
|
||||
var titre = this._titreRepository.Find(id);
|
||||
|
||||
if (titre == null)
|
||||
/// <summary>
|
||||
/// Initialise une nouvelle instance de la classe <see cref="TitreController"/>.
|
||||
/// </summary>
|
||||
/// <param name="logger">Service de journalisation injecte.</param>
|
||||
/// <param name="titreRepository">Repository des titres injecte.</param>
|
||||
public TitreController(ILogger<TitreController> logger, ITitreRepository titreRepository)
|
||||
{
|
||||
this._logger.LogWarning("Titre avec ID {Id} introuvable.", id);
|
||||
return this.RedirectToAction("Index");
|
||||
this.logger = logger;
|
||||
this.titreRepository = titreRepository;
|
||||
|
||||
this.logger.LogInformation("Initialisation du controleur TitreController.");
|
||||
}
|
||||
|
||||
var vm = new TitreDetail
|
||||
/// <summary>
|
||||
/// Affiche le detail d'un titre specifique.
|
||||
/// </summary>
|
||||
/// <param name="id">Identifiant du titre.</param>
|
||||
/// <returns>Vue des details ou 404 si introuvable.</returns>
|
||||
[HttpGet("{id}")]
|
||||
public IActionResult Details(int id)
|
||||
{
|
||||
Details = new TitreContent
|
||||
this.logger.LogInformation("Demande d'affichage du detail pour le titre ID {Id}.", id);
|
||||
|
||||
var titre = this.titreRepository.Find(id);
|
||||
|
||||
if (titre == null)
|
||||
{
|
||||
IdTitre = titre.IdTitre,
|
||||
Libelle = titre.Libelle,
|
||||
Chronique = titre.Chronique,
|
||||
DateSortie = titre.DateSortie,
|
||||
NbLikes = titre.NbLikes,
|
||||
UrlJaquette = titre.UrlJaquette,
|
||||
UrlEcoute = titre.UrlEcoute,
|
||||
ArtisteNom = titre.Artiste.Nom,
|
||||
Styles = titre.Styles,
|
||||
Commentaires = titre.Commentaires,
|
||||
},
|
||||
CommentForm = new TitreComment
|
||||
this.logger.LogWarning("Titre avec ID {Id} introuvable.", id);
|
||||
return this.RedirectToAction("Index");
|
||||
}
|
||||
|
||||
var vm = new TitreDetail
|
||||
{
|
||||
IdTitre = titre.IdTitre,
|
||||
},
|
||||
};
|
||||
Details = new TitreContent
|
||||
{
|
||||
IdTitre = titre.IdTitre,
|
||||
Libelle = titre.Libelle,
|
||||
Chronique = titre.Chronique,
|
||||
DateSortie = titre.DateSortie,
|
||||
NbLikes = titre.NbLikes,
|
||||
UrlJaquette = titre.UrlJaquette,
|
||||
UrlEcoute = titre.UrlEcoute,
|
||||
ArtisteNom = titre.Artiste.Nom,
|
||||
Styles = titre.Styles,
|
||||
Commentaires = titre.Commentaires,
|
||||
},
|
||||
CommentForm = new TitreComment
|
||||
{
|
||||
IdTitre = titre.IdTitre,
|
||||
},
|
||||
};
|
||||
|
||||
return this.View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Affiche les titres correspondant a un style musical donne.
|
||||
/// </summary>
|
||||
/// <param name="style">Nom du style musical.</param>
|
||||
/// <returns>Vue contenant la liste filtree.</returns>
|
||||
[HttpGet("style/{style}")]
|
||||
public IActionResult Style(string style)
|
||||
{
|
||||
this._logger.LogInformation("Recherche des titres pour le style : {Style}.", style);
|
||||
|
||||
var titresFiltres = this._titreRepository.SearchByStyle(style).ToList();
|
||||
|
||||
var vm = new TitreStyle
|
||||
{
|
||||
StyleName = style,
|
||||
Titres = titresFiltres.Select(MapTitreItem).ToList(),
|
||||
};
|
||||
|
||||
return this.View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ajoute un like a un titre.
|
||||
/// </summary>
|
||||
/// <param name="model">Modele contenant l'identifiant du titre.</param>
|
||||
/// <returns>Redirection vers la page detail.</returns>
|
||||
[HttpPost("like")]
|
||||
public IActionResult Like(TitreLike model)
|
||||
{
|
||||
this._logger.LogInformation("Ajout d'un like pour le titre ID {Id}.", model.IdTitre);
|
||||
|
||||
var titre = this._titreRepository.Find(model.IdTitre);
|
||||
|
||||
if (titre == null)
|
||||
{
|
||||
this._logger.LogWarning("Impossible d'ajouter un like. Titre ID {Id} introuvable.", model.IdTitre);
|
||||
return this.RedirectToAction("Index");
|
||||
return this.View(vm);
|
||||
}
|
||||
|
||||
titre.NbLikes++;
|
||||
|
||||
return this.RedirectToAction("Details", new { id = model.IdTitre });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ajoute un commentaire a un titre.
|
||||
/// </summary>
|
||||
/// <param name="model">Donnees du commentaire.</param>
|
||||
/// <returns>Redirection vers la page detail.</returns>
|
||||
[HttpPost("comment")]
|
||||
public IActionResult Comment(TitreComment model)
|
||||
{
|
||||
if (!this.ModelState.IsValid)
|
||||
/// <summary>
|
||||
/// Affiche les titres correspondant a un style musical donne.
|
||||
/// </summary>
|
||||
/// <param name="style">Nom du style musical.</param>
|
||||
/// <returns>Vue contenant la liste filtree.</returns>
|
||||
[HttpGet("style/{style}")]
|
||||
public IActionResult Style(string style)
|
||||
{
|
||||
this._logger.LogWarning("Echec de validation du modele de commentaire pour le titre ID {Id}.", model.IdTitre);
|
||||
this.logger.LogInformation("Recherche des titres pour le style : {Style}.", style);
|
||||
|
||||
var titresFiltres = this.titreRepository.SearchByStyle(style).ToList();
|
||||
|
||||
var vm = new TitreStyle
|
||||
{
|
||||
StyleName = style,
|
||||
Titres = titresFiltres.Select(MapTitreItem).ToList(),
|
||||
};
|
||||
|
||||
return this.View(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ajoute un like a un titre.
|
||||
/// </summary>
|
||||
/// <param name="model">Modele contenant l'identifiant du titre.</param>
|
||||
/// <returns>Redirection vers la page detail.</returns>
|
||||
[HttpPost("like")]
|
||||
public IActionResult Like(TitreLike model)
|
||||
{
|
||||
this.logger.LogInformation("Ajout d'un like pour le titre ID {Id}.", model.IdTitre);
|
||||
|
||||
var titre = this.titreRepository.Find(model.IdTitre);
|
||||
|
||||
if (titre == null)
|
||||
{
|
||||
this.logger.LogWarning("Impossible d'ajouter un like. Titre ID {Id} introuvable.", model.IdTitre);
|
||||
return this.RedirectToAction("Index");
|
||||
}
|
||||
|
||||
titre.NbLikes++;
|
||||
|
||||
return this.RedirectToAction("Details", new { id = model.IdTitre });
|
||||
}
|
||||
|
||||
var titre = this._titreRepository.Find(model.IdTitre);
|
||||
|
||||
if (titre == null)
|
||||
/// <summary>
|
||||
/// Ajoute un commentaire a un titre.
|
||||
/// </summary>
|
||||
/// <param name="model">Donnees du commentaire.</param>
|
||||
/// <returns>Redirection vers la page detail.</returns>
|
||||
[HttpPost("comment")]
|
||||
public IActionResult Comment(TitreComment model)
|
||||
{
|
||||
this._logger.LogWarning("Impossible d'ajouter le commentaire. Titre ID {Id} introuvable.", model.IdTitre);
|
||||
return this.RedirectToAction("Index");
|
||||
if (!this.ModelState.IsValid)
|
||||
{
|
||||
this.logger.LogWarning("Echec de validation du modele de commentaire pour le titre ID {Id}.", model.IdTitre);
|
||||
return this.RedirectToAction("Details", new { id = model.IdTitre });
|
||||
}
|
||||
|
||||
var titre = this.titreRepository.Find(model.IdTitre);
|
||||
|
||||
if (titre == null)
|
||||
{
|
||||
this.logger.LogWarning("Impossible d'ajouter le commentaire. Titre ID {Id} introuvable.", model.IdTitre);
|
||||
return this.RedirectToAction("Index");
|
||||
}
|
||||
|
||||
var commentaire = new Commentaire
|
||||
{
|
||||
Auteur = model.Auteur,
|
||||
Contenu = model.Contenu,
|
||||
DateCreation = DateTime.Now,
|
||||
IdTitre = model.IdTitre,
|
||||
};
|
||||
|
||||
titre.Commentaires.Add(commentaire);
|
||||
|
||||
this.logger.LogInformation("Commentaire ajoute avec succes au titre ID {Id}.", model.IdTitre);
|
||||
|
||||
return this.RedirectToAction("Details", new { id = model.IdTitre });
|
||||
}
|
||||
|
||||
var commentaire = new Commentaire
|
||||
private static TitreStyleItem MapTitreItem(Titre titre)
|
||||
{
|
||||
Auteur = model.Auteur,
|
||||
Contenu = model.Contenu,
|
||||
DateCreation = DateTime.Now,
|
||||
IdTitre = model.IdTitre,
|
||||
};
|
||||
|
||||
titre.Commentaires.Add(commentaire);
|
||||
|
||||
this._logger.LogInformation("Commentaire ajoute avec succes au titre ID {Id}.", model.IdTitre);
|
||||
|
||||
return this.RedirectToAction("Details", new { id = model.IdTitre });
|
||||
}
|
||||
|
||||
private static TitreStyleItem MapTitreItem(Titre titre)
|
||||
{
|
||||
return new TitreStyleItem
|
||||
{
|
||||
IdTitre = titre.IdTitre,
|
||||
Libelle = titre.Libelle,
|
||||
ArtisteNom = titre.Artiste?.Nom,
|
||||
UrlJaquette = titre.UrlJaquette,
|
||||
Duree = titre.Duree,
|
||||
};
|
||||
return new TitreStyleItem
|
||||
{
|
||||
IdTitre = titre.IdTitre,
|
||||
Libelle = titre.Libelle,
|
||||
ArtisteNom = titre.Artiste?.Nom,
|
||||
UrlJaquette = titre.UrlJaquette,
|
||||
Duree = titre.Duree,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ try
|
||||
builder.Services.AddScoped<IStyleRepository, DbStyleRepository>();
|
||||
builder.Services.AddScoped<IArtisteRepository, DbArtisteRepository>();
|
||||
builder.Services.AddScoped<ICommentaireRepository, DbCommentaireRepository>();
|
||||
builder.Services.AddScoped<DbEntityRepository>();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -45,13 +46,21 @@ try
|
||||
//builder.Services.AddScoped<ICommentaireRepository, LocalCommentaireRepository>();
|
||||
}
|
||||
|
||||
|
||||
// https://learn.microsoft.com/fr-fr/aspnet/core/performance/response-compression?view=aspnetcore-10.0#configuration
|
||||
// Ajoute le service de compression des réponses HTTP pour réduire la taille des données envoyées au client et améliorer les performances de l'application.
|
||||
builder.Services.AddResponseCompression();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<WebzineDbContext>();
|
||||
db.Database.EnsureDeleted();
|
||||
db.Database.EnsureCreated();
|
||||
var repo = scope.ServiceProvider.GetRequiredService<DbEntityRepository>();
|
||||
repo.SeedBaseDeDonnees();
|
||||
}
|
||||
|
||||
app.UseResponseCompression();
|
||||
|
||||
// Active la possibilite de servir des fichiers statiques presents dans
|
||||
@@ -65,12 +74,6 @@ try
|
||||
},
|
||||
});
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<WebzineDbContext>();
|
||||
db.Database.EnsureCreated();
|
||||
}
|
||||
|
||||
// Active le middleware permettant le routage des requetes entrantes.
|
||||
app.UseRouting();
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Webzine.Repository.Contracts;
|
||||
|
||||
namespace Webzine.WebApplication.ViewComponents
|
||||
{
|
||||
/// <summary>
|
||||
/// View component pour la sidebar, récupère les styles depuis le repository.
|
||||
/// </summary>
|
||||
public class SidebarViewComponent : ViewComponent
|
||||
{
|
||||
private readonly IStyleRepository styleRepository;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SidebarViewComponent"/> class.
|
||||
/// </summary>
|
||||
/// <param name="styleRepository">Repository des styles injecté.</param>
|
||||
public SidebarViewComponent(IStyleRepository styleRepository)
|
||||
{
|
||||
this.styleRepository = styleRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Récupère tous les styles triés par libellé et les passe à la vue.
|
||||
/// </summary>
|
||||
/// <returns>Une vue contenant la liste des styles.</returns>
|
||||
public IViewComponentResult Invoke()
|
||||
{
|
||||
var styles = this.styleRepository.FindAll()
|
||||
.OrderBy(s => s.Libelle)
|
||||
.ToList();
|
||||
|
||||
return this.View(styles);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,30 @@
|
||||
namespace Webzine.WebApplication.ViewModels.Accueil
|
||||
{
|
||||
using Webzine.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// ViewModel pour la page d'accueil du webzine, affichant les derniers titres et les titres les plus populaires.
|
||||
/// </summary>
|
||||
public class AccueilIndexViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Définit la liste des derniers titres ajoutés au webzine.
|
||||
/// Obtient ou définit la liste des derniers titres ajoutés au webzine.
|
||||
/// </summary>
|
||||
public List<Entity.Titre> DerniersTitres { get; set; } = [];
|
||||
public List<Titre> DerniersTitres { get; set; } = new List<Titre>();
|
||||
|
||||
/// <summary>
|
||||
/// Définit la liste des titres les plus populaires du webzine.
|
||||
/// Obtient ou définit la liste des titres les plus populaires du webzine.
|
||||
/// </summary>
|
||||
public List<Entity.Titre> TopTitres { get; set; } = [];
|
||||
public List<Titre> TopTitres { get; set; } = new List<Titre>();
|
||||
|
||||
/// <summary>
|
||||
/// Obtient ou définit le nombre de titre disponible.
|
||||
/// </summary>
|
||||
// public int NombreDeTitre { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Obtient ou définit le nombre de titre paginé.
|
||||
/// </summary>
|
||||
// public int Pagination { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<!-- Chronique -->
|
||||
<p class="mt-2 mb-3 text-muted">
|
||||
@titre.Chronique
|
||||
@(titre.Chronique.Length > 200 ? titre.Chronique.Substring(0, 200) + "..." : titre.Chronique)
|
||||
</p>
|
||||
|
||||
<!-- Footer -->
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
<div class="card-body">
|
||||
<a asp-controller="Titre" asp-action="Details" asp-route-id="@titre.IdTitre" class="card-link">
|
||||
@titre.Album
|
||||
@titre.Libelle
|
||||
</a>
|
||||
<br />
|
||||
par
|
||||
|
||||
@@ -58,7 +58,7 @@ else
|
||||
<a asp-controller="Titre"
|
||||
asp-action="Details"
|
||||
asp-route-id="@titre.IdTitre"
|
||||
class="text-primary fw-bold">
|
||||
class="text-primary">
|
||||
@titre.Libelle
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -4,14 +4,15 @@
|
||||
|
||||
<div class="container">
|
||||
<h1>Contact</h1>
|
||||
<div>
|
||||
<div class="my-2">
|
||||
C.U.C.D.B - DIIAGE <br />
|
||||
69 Avenue Aristide Briand<br />
|
||||
21000 Dijon
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<div class ="my-2">
|
||||
<i class="fa-solid fa-phone"></i> Phone : 03 80 40 50 60<br />
|
||||
<i class="fa-solid fa-envelope"></i> secretariat@cucdb.fr
|
||||
<i class="fa-solid fa-envelope"></i> <span class="text-primary">secretariat@cucdb.fr</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -21,43 +22,43 @@
|
||||
<h2>Suivez-nous</h2>
|
||||
<div class="row g-4 text-center">
|
||||
<div class="col-md-4">
|
||||
<a href="#" class="card h-100 p-4 shadow-sm border-0 bg-light-subtle">
|
||||
<i class="fa-solid fa-link fa-3x text-primary mb-3"></i>
|
||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
||||
<i class="fa-solid fa-link fa-3x text-primary mb-3 align-self-center"></i>
|
||||
<div class="fw-bold text-primary">Site officiel du DIIAGE</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<a href="#" class="card h-100 p-4 shadow-sm border-0 bg-light-subtle">
|
||||
<i class="fa-brands fa-facebook fa-3x text-primary mb-3"></i>
|
||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
||||
<i class="fa-brands fa-facebook fa-3x text-primary mb-3 align-self-center"></i>
|
||||
<div class="fw-bold text-primary">Facebook</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<a href="#" class="card h-100 p-4 shadow-sm border-0 bg-light-subtle">
|
||||
<i class="fa-brands fa-instagram fa-3x text-primary mb-3"></i>
|
||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
||||
<i class="fa-brands fa-instagram fa-3x text-primary mb-3 align-self-center"></i>
|
||||
<div class="fw-bold text-primary">Instagram</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<a href="#" class="card h-100 p-4 shadow-sm border-0 bg-light-subtle">
|
||||
<i class="fa-brands fa-linkedin fa-3x text-primary mb-3"></i>
|
||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
||||
<i class="fa-brands fa-linkedin fa-3x text-primary mb-3 align-self-center"></i>
|
||||
<div class="fw-bold text-primary">LinkedIn</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<a href="#" class="card h-100 p-4 shadow-sm border-0 bg-light-subtle">
|
||||
<i class="fa-solid fa-map fa-3x text-primary mb-3"></i>
|
||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
||||
<i class="fa-solid fa-map fa-3x text-primary mb-3 align-self-center"></i>
|
||||
<div class="fw-bold text-primary">Google Maps</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<a href="#" class="card h-100 p-4 shadow-sm border-0 bg-light-subtle">
|
||||
<i class="fa-brands fa-twitter fa-3x text-primary mb-3"></i>
|
||||
<a href="#" class="card h-100 p-4 border-0 bg-light">
|
||||
<i class="fa-brands fa-twitter fa-3x text-primary mb-3 align-self-center"></i>
|
||||
<div class="fw-bold text-primary">Twitter</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
@model IEnumerable<Webzine.Entity.Style>
|
||||
|
||||
<aside class="col-lg-3 d-none d-lg-block">
|
||||
<div>
|
||||
<h2>À propos</h2>
|
||||
<p>Retrouvez les dernières pépites sur notre webzine.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Styles</h2>
|
||||
<ul>
|
||||
@foreach (var style in Model)
|
||||
{
|
||||
<li>
|
||||
<a asp-controller="Titre"
|
||||
asp-action="Style"
|
||||
asp-route-style="@style.Libelle">
|
||||
@style.Libelle
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</aside>
|
||||
@@ -11,19 +11,19 @@
|
||||
<link rel="stylesheet" href="~/css/app.css">
|
||||
</head>
|
||||
<body>
|
||||
<partial name="_Header"/>
|
||||
<div class="container-fluid flex-grow-1 py-4">
|
||||
<div class="row">
|
||||
<main class="col mx-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
@if(ViewContext.RouteData.Values["area"]?.ToString() != "Administration")
|
||||
{
|
||||
<partial name="_Sidebar" />
|
||||
}
|
||||
</div>
|
||||
<partial name="_Header"/>
|
||||
<div class="container-fluid flex-grow-1 py-4">
|
||||
<div class="row">
|
||||
<main class="col mx-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
@if(ViewContext.RouteData.Values["area"]?.ToString() != "Administration")
|
||||
{
|
||||
@await Component.InvokeAsync("Sidebar")
|
||||
}
|
||||
</div>
|
||||
<partial name="_Footer" />
|
||||
</div>
|
||||
<partial name="_Footer" />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
@*
|
||||
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
*@
|
||||
@{
|
||||
}
|
||||
<aside class="col-lg-3 d-none d-lg-block">
|
||||
<div>
|
||||
<h2>À propos</h2>
|
||||
<p>Retrouvez les dernières pépites sur notre webzine.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Styles</h2>
|
||||
<ul>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Acid house">Acid house</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Ambient">Ambient</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Deep house">Deep house</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Disco">Disco</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Downtempo">Downtempo</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Drum n bass">Drum n bass</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Dub Techno">Dub Techno</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Electro">Electro</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Electronic">Electronic</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Experimental">Experimental</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Funk">Funk</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Garage">Garage</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Hardcore">Hardcore</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Hardstyle">Hardstyle</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Hip hop">Hip hop</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="House">House</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Indie">Indie</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Industrial">Industrial</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Jazz">Jazz</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Latin">Latin</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Metal">Metal</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Minimal">Minimal</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Pop">Pop</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Progressive">Progressive</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Punk">Punk</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="R&B">R&B</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Rap">Rap</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Reggae">Reggae</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Rock">Rock</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Soul">Soul</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Techno">Techno</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Trance">Trance</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="Trip hop">Trip hop</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="UK garage">UK garage</a></li>
|
||||
<li><a asp-controller="Titre" asp-action="Style" asp-route-id="World">World</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</aside>
|
||||
@@ -6,6 +6,7 @@
|
||||
}
|
||||
},
|
||||
"Webzine": {
|
||||
// TODO : préciser les modes environnement et repo
|
||||
"NombreDerniereChronique": 3,
|
||||
"NombreDeTopTitres": 3
|
||||
},
|
||||
|
||||
BIN
Webzine.WebApplication/wwwroot/images/avatar.png
Normal file
BIN
Webzine.WebApplication/wwwroot/images/avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Reference in New Issue
Block a user