@model Webzine.WebApplication.Areas.Administration.ViewModels.Commentaire.CommentaireViewModel

@{
    ViewData["Title"] = "Commentaires";
}


<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-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 p-2" style="width: 100px" ;>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>