@model IEnumerable<Webzine.WebApplication.Areas.Administration.ViewModels.Titre.AdminTitreList>

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

<div class="container mt-4">

    <h1 class="mb-3">Titres</h1>
    <hr />

    <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-hover table-bordered">
            <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>
                    <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>