#6 Vues et controlleur pour Style et Commentaire au singulier. #12 Mise en conformité du style vues, les memes icones sont utilisés sur toutes les pages admin. Ajout de la route pour creer un titre.

This commit is contained in:
josephine.vetu
2026-03-11 22:35:05 +01:00
parent 5e78921c7c
commit ae76600f6a
10 changed files with 56 additions and 54 deletions

View File

@@ -9,21 +9,21 @@ using Webzine.WebApplication.Areas.Administration.ViewModels.Style;
namespace Webzine.WebApplication.Areas.Administration.Controllers namespace Webzine.WebApplication.Areas.Administration.Controllers
{ {
[Area("Administration")] [Area("Administration")]
public class StylesController : Controller public class StyleController : Controller
{ {
private readonly ILogger<StylesController> _logger; private readonly ILogger<StyleController> _logger;
private readonly List<Style> _styles; private readonly List<Style> _styles;
/// <summary> /// <summary>
/// Initialise une nouvelle instance du <see cref="StylesController"/>. /// Initialise une nouvelle instance du <see cref="StyleController"/>.
/// Les données sont générées dynamiquement via <see cref="DataFactory"/>. /// Les données sont générées dynamiquement via <see cref="DataFactory"/>.
/// </summary> /// </summary>
/// <param name="logger">Service de journalisation injecté.</param> /// <param name="logger">Service de journalisation injecté.</param>
public StylesController(ILogger<StylesController> logger) public StyleController(ILogger<StyleController> logger)
{ {
_logger = logger; _logger = logger;
_logger.LogInformation("Initialisation du contrôleur StylesController."); _logger.LogInformation("Initialisation du contrôleur StyleController.");
var factory = new DataFactory(); var factory = new DataFactory();

View File

@@ -24,7 +24,7 @@ public class TitreController : Controller
{ {
_logger = logger; _logger = logger;
_logger.LogInformation("Initialisation du contrôleur TitreController."); _logger.LogInformation("Initialisation du contrôleur TitreController pour l'Administration.");
var factory = new DataFactory(); var factory = new DataFactory();

View File

@@ -5,18 +5,19 @@
} }
<div class="justify-content-center m-5"> <div class="container mt-4">
<h1 class="mb-4">Commentaires</h1> <h1 class="mb-4">Commentaires</h1>
<hr />
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-hover table-bordered"> <table class="table table-striped table-hover table-bordered">
<thead class="table-light"> <thead class="table-active">
<tr> <tr>
<th scope="col">Titre</th> <th scope="col">Titre</th>
<th scope="col">Auteur</th> <th scope="col">Auteur</th>
<th scope="col">Commentaire</th> <th scope="col">Commentaire</th>
<th scope="col">Date de création</th> <th scope="col">Date de création</th>
<th scope="col" class="text-center">Actions</th> <th scope="col" class="text-center p-2" style="width: 100px" ;>Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -9,53 +9,55 @@
<h1 class="mb-3">Titres</h1> <h1 class="mb-3">Titres</h1>
<hr /> <hr />
<a asp-action="" class="btn btn-primary mb-3"> <a asp-action="Create" class="btn btn-primary mb-3">
<i class="fa fa-plus"></i> Ajouter un nouvel titre <i class="fa fa-plus"></i> Ajouter un nouveau titre
</a> </a>
<div class="table-responsive">
<table class="table table-striped table-bordered align-middle"> <table class="table table-striped table-hover table-bordered">
<thead class="table-light"> <thead class="table-active">
<tr>
<th>Artiste</th>
<th>Titre</th>
<th>Durée</th>
<th>Date de sortie</th>
<th class="text-center"><i class="fa fa-eye"></i></th>
<th class="text-center"><i class="fa fa-thumbs-up"></i></th>
<th class="text-center"><i class="fa fa-comments"></i></th>
<th class="text-center action-column">Actions</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr> <tr>
<td>@item.Artiste</td> <th>Artiste</th>
<td>@item.Titre</td> <th>Titre</th>
<td>@item.Duree</td> <th>Durée</th>
<td>@item.DateSortie.ToString("dd/MM/yyyy")</td> <th>Date de sortie</th>
<th class="text-center"><i class="fa fa-eye"></i></th>
<td class="text-center">@item.NbLectures</td> <th class="text-center"><i class="fa fa-thumbs-up"></i></th>
<td class="text-center">@item.NbLikes</td> <th class="text-center"><i class="fa fa-comments"></i></th>
<td class="text-center">@item.NbCommentaires</td> <th class="text-center action-column">Actions</th>
<td class="text-center action-column">
<a asp-action="Edit" asp-route-id="@item.Id"
class="btn btn-sm btn-outline-primary">
<i class="fa fa-pen"></i>
</a>
<a asp-action="Delete" asp-route-id="@item.Id"
class="btn btn-sm btn-outline-danger">
<i class="fa fa-trash"></i>
</a>
</td>
</tr> </tr>
} </thead>
</tbody>
</table>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>@item.Artiste</td>
<td>@item.Titre</td>
<td>@item.Duree</td>
<td>@item.DateSortie.ToString("dd/MM/yyyy")</td>
<td class="text-center">@item.NbLectures</td>
<td class="text-center">@item.NbLikes</td>
<td class="text-center">@item.NbCommentaires</td>
<td class="text-center action-column">
<a asp-action="Edit" asp-route-id="@item.Id"
class="btn btn-sm text-primary">
<i class="fa fa-edit"></i>
</a>
<a asp-action="Delete" asp-route-id="@item.Id"
class="btn btn-sm text-primary">
<i class="fa fa-trash"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div> </div>