PavelAndreyev1337_itransition-course-project/CollectionApp/CollectionApp.WEB/Views/Admin/Index.cshtml
@using Microsoft.AspNetCore.Mvc.Localization
@using CollectionApp.DAL.Entities
@model IEnumerable<User>

@inject IViewLocalizer Localizer

@{
    Layout = "_Layout";
}

<div class="table-responsive">
    <table class="table mt-2">
        <thead>
            <tr class="d-flex">
                <th class="col-5">@Localizer["Username"]</th>
                <th class="col-5">@Localizer["Email"]</th>
                <th class="col-2"></th>
            </tr>
        </thead>
        <tbody>
            @foreach (var user in @Model)
            {
                <tr class="d-flex @(user.LockoutEnabled ? "table-danger": "")" 
                    title="@(user.LockoutEnabled ? "Blocked": "")">
                    <td class="col-5 text-break">
                        <a asp-controller="Collection"
                           asp-action="Index"
                           asp-route-userId="@user.Id">
                            @user.UserName
                        </a>
                    </td>
                    <td class="col-5 text-break">@user.Email</td>
                    <td class="col-2">
                        <form asp-controller="Admin"
                                asp-action="AddAdmin"
                                asp-route-userId="@user.Id"
                                class="d-inline">
                            <button class="btn btn-success btn-sm m-1"
                                    type="submit"
                                    data-toggle="tooltip"
                                    data-placement="bottom"
                                    title="@Localizer["AddAdmin"]">
                                <i class="bi bi-star"></i>
                            </button>
                        </form>
                        <form asp-controller="Admin"
                                asp-action="BlockUser"
                                asp-route-userId="@user.Id"
                                class="d-inline">
                            <button class="btn btn-warning btn-sm m-1"
                                    type="submit"
                                    data-toggle="tooltip"
                                    data-placement="bottom"
                                    title="@Localizer["Block"]">
                                <i class="bi bi-lock"></i>
                            </button>
                        </form>
                        <form asp-controller="Admin"
                                asp-action="DeleteUser"
                                asp-route-userId="@user.Id"
                                class="d-inline">
                            <button class="btn btn-danger btn-sm m-1 delete-btn"
                                    type="submit"
                                    data-toggle="tooltip"
                                    data-placement="bottom"
                                    title="@Localizer["Delete"]">
                                <i class="bi bi-trash"></i>
                            </button>
                        </form>
                    </td>
                </tr>
                }
        </tbody>
    </table>
</div>

<script src="~/js/profile.js"></script>
