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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user