Merge branch 'dev' into J1/feat/AdminTitreIHM

# Conflicts:
#	Webzine.WebApplication/Areas/Administration/ViewModels/Accueil/AccueilIndexViewModel.cs
#	Webzine.WebApplication/Areas/Administration/ViewModels/ArtisteModel.cs
#	Webzine.WebApplication/Areas/Administration/Views/Commentaires/Index.cshtml
#	Webzine.WebApplication/Areas/Administration/Views/Shared/_Layout.cshtml
#	Webzine.WebApplication/Controllers/AccueilController.cs
#	Webzine.WebApplication/Webzine.WebApplication.csproj
This commit is contained in:
mirage
2026-03-05 16:55:44 +01:00
38 changed files with 781 additions and 331 deletions

View File

@@ -0,0 +1,42 @@
@model Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire.CommentaireDeleteViewModel
@{
ViewData["Title"] = "Supprimer un commentaire";
}
<div class="container mt-4">
<h1 class="mb-3">Supprimer un commentaire</h1>
<hr />
<p class="mb-4">
Êtes-vous sûr de vouloir supprimer le commentaire suivant ?
</p>
<div class="mb-4">
<h4>@Model.Contenu</h4>
<div class="text-muted">
— <strong>@Model.Auteur</strong>
le @Model.DateCreation.ToString("dd/MM/yyyy HH:mm:ss")
sur <em>@Model.TitreLibelle</em>
</div>
</div>
<form asp-action="Delete" method="post">
<input type="hidden" asp-for="IdCommentaire" />
<button type="submit" class="btn btn-danger">
Supprimer
</button>
</form>
<br/>
<br/>
<a asp-action="Index"
class="btn-link">
Retour à l'administration des commentaires
</a>
</div>

View File

@@ -0,0 +1,48 @@
@model Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire.CommentaireViewModel
@{
ViewData["Title"] = "Commentaires";
}
<div class="justify-content-center m-5">
<h1 class="mb-4">Commentaires</h1>
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered">
<thead class="table-light">
<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>
</tr>
</thead>
<tbody>
@foreach (Webzine.Entity.Commentaire commentaire in Model.Commentaires)
{
<tr class="align-middle">
<td>
@commentaire.Titre.Libelle
</td>
<td>
@commentaire.Auteur
</td>
<td>
@commentaire.Contenu
</td>
<td>
@commentaire.DateCreation.ToString("dd/MM/yyyy HH:mm:ss")
</td>
<td class="text-center">
<a asp-action="Delete" asp-route-id="@commentaire.IdCommentaire" class="d-inline btn btn-link text-primary">
<i class="fas fa-trash"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>

View File

@@ -1,89 +1 @@
@using Webzine.WebApplication.ViewModels
@using Webzine.Entity
@model CommentaireViewModel
@{
ViewData["Title"] = "Commentaires";
}
<style>
.commentaires-container {
overflow-x: auto;
}
.commentaires-table {
width: 100%;
border-collapse: collapse;
margin-top: 1.5rem;
background: white;
}
.commentaires-table thead {
background: #ddd;
font-weight: bold;
}
.commentaires-table th, .commentaires-table td {
padding: 1rem;
border: 1px solid #ccc;
text-align: left;
}
.btn-delete {
color: #0066cc;
border: none;
background: none;
cursor: pointer;
font-size: 1.2rem;
}
.btn-delete:hover {
color: #ff4444;
}
</style>
<h1>Commentaires</h1>
<div class="commentaires-container">
<table class="commentaires-table">
<thead>
<tr>
<th>Titre</th>
<th>Auteur</th>
<th>Commentaire</th>
<th>Date de création</th>
<th style="text-align: center;">Actions</th>
</tr>
</thead>
<tbody>
@foreach (Webzine.Entity.Commentaire commentaire in Model.Commentaires)
{
<tr>
<td>
<!-- Titre est un objet, on affiche sa propriété Libelle -->
@(commentaire.Titre != null ? commentaire.Titre.Libelle : "Titre inconnu")
</td>
<td>
<!-- On utilise Auteur (et pas Nom) -->
@commentaire.Auteur
</td>
<td>
@commentaire.Contenu
</td>
<td>
@commentaire.DateCreation.ToString("dd/MM/yyyy HH:mm:ss")
</td>
<td style="text-align: center;">
<!-- On utilise IdCommentaire (et pas Id) -->
<form method="post" action="@Url.Action("Delete", new { id = commentaire.IdCommentaire })" style="display: inline;">
@Html.AntiForgeryToken()
<button type="submit" class="btn-delete" title="Supprimer">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,58 @@
@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<!-- Logo -->
<a class="navbar-brand" href="#">Webzine</a>
<!-- bouton mobile -->
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarWebzine">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarWebzine">
<!-- Menu -->
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" href="#">
<i class="fa-solid fa-house"></i> Accueil
</a>
</li>
@* TODO : Modifier, il s'agit d'une liste *@
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fa-solid fa-screwdriver-wrench"></i> Administration
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<i class="fa-solid fa-envelope"></i> Contact
</a>
</li>
</ul>
<!-- Barre de recherche -->
<form class="d-flex">
<div class="input-group">
<div class="form-outline">
<input class="form-control me-2" type="search" placeholder="Trouver un artiste / titre">
</div>
<button class="btn btn-primary" type="submit">
<i class="fa-solid fa-magnifying-glass"></i>
</button>
</div>
</form>
</div>
</div>
</nav>
</header>

View File

@@ -14,14 +14,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
</head>
<body>
<div class="container">
@await Html.PartialAsync("_Header")
<div class="row mt-5">
<main class="col-9">
@RenderBody()
</main>
@await Html.PartialAsync("_Sidebar")
</div>
</div>
@await Html.PartialAsync("_Header")
@RenderBody()
</body>
</html>

View File

@@ -0,0 +1,2 @@
@* Permet de factoriser les imports de tag helpers *@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}