@inherits ViewModelTemplate<UserListViewModel>
@using Dynamicweb.Frontend
@using Dynamicweb.Rendering
@using Dynamicweb.Users.Frontend
@using Dynamicweb.Security.UserManagement

@if (Model.Users.Count() > 0)
{
    <div class="d-grid gap-3" style="grid-template-columns: repeat(auto-fill, minmax(300px, 1fr))">
        @foreach (var user in Model.Users)
        {
            @RenderPartial("Users/UserView/List/Employees/EmployeesListItem.cshtml", user)
        }
    </div>

    if (Model.PageCount > 1)
    {
        <form class="mt-3">
            <ul class="pagination m-0">
                @for (int i = 1; i <= Model.PageCount; i++)
                {
                    var active = (i == Model.CurrentPage) ? "active" : string.Empty;
                    <li class="page-item @active">
                        <button type="submit" class="page-link" name="PageNum" value="@i">@i</button>
                    </li>
                }
            </ul>
        </form>
    }
}
else
{
    <div class="card alert alert-info text-center mt-3" role="alert">
        @Translate("No employees found")
    </div>
}
