@page
@model Server.Pages.Panel.Users.IndexModel

@{
    var pageTitle =
        Resources.DataDictionary.Users;

    ViewData[Constants.ViewDataKeyName.PageTitle] = pageTitle;
}


<div class="my-2 float-end">
    <a class="btn btn-primary" asp-page="Create">@(Resources.ButtonCaptions.Create)</a>
</div>
<table class="table table-hover">
    <thead>
        <tr>
            @(Html.Ub_DisplayStringWithTh(Resources.DataDictionary.UserName))
            @(Html.Ub_DisplayStringWithTh(Resources.DataDictionary.Password))
            @(Html.Ub_DisplayStringWithTh(Resources.DataDictionary.Mobile))
            @(Html.Ub_DisplayStringWithTh(Resources.DataDictionary.IsActive))
            <th scope="col"></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var user in Model.Users)
        {
            <tr>
                @(Html.Ub_DisplayStringWithTd(user.Username))
                @(Html.Ub_DisplayStringWithTd(user.Password))
                @(Html.Ub_DisplayStringWithTd(user.Mobile))
                @(Html.Ub_DisplayBooleanWithTd(user.IsActive))
                <td>
                    <div class="btn-group" role="group" aria-label="Basic example">
                        <a asp-page="Update" asp-route-Id="@(user.Id)" class="btn btn-warning">@(Resources.ButtonCaptions.Edit)</a>
                        <a asp-page="Delete" asp-route-Id="@(user.Id)" class="btn btn-danger">@(Resources.ButtonCaptions.Delete)</a>
                    </div>
                </td>
            </tr>
        }
    </tbody>
</table>