#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
{
[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;
/// <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"/>.
/// </summary>
/// <param name="logger">Service de journalisation injecté.</param>
public StylesController(ILogger<StylesController> logger)
public StyleController(ILogger<StyleController> logger)
{
_logger = logger;
_logger.LogInformation("Initialisation du contrôleur StylesController.");
_logger.LogInformation("Initialisation du contrôleur StyleController.");
var factory = new DataFactory();

View File

@@ -24,7 +24,7 @@ public class TitreController : Controller
{
_logger = logger;
_logger.LogInformation("Initialisation du contrôleur TitreController.");
_logger.LogInformation("Initialisation du contrôleur TitreController pour l'Administration.");
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>
<hr />
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered">
<thead class="table-light">
<thead class="table-active">
<tr>
<th scope="col">Titre</th>
<th scope="col">Auteur</th>
<th scope="col">Commentaire</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>
</thead>
<tbody>

View File

@@ -9,53 +9,55 @@
<h1 class="mb-3">Titres</h1>
<hr />
<a asp-action="" class="btn btn-primary mb-3">
<i class="fa fa-plus"></i> Ajouter un nouvel titre
<a asp-action="Create" class="btn btn-primary mb-3">
<i class="fa fa-plus"></i> Ajouter un nouveau titre
</a>
<div class="table-responsive">
<table class="table table-striped table-bordered align-middle">
<thead class="table-light">
<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)
{
<table class="table table-striped table-hover table-bordered">
<thead class="table-active">
<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 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>
<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>
}
</tbody>
</table>
</thead>
<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>