<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
      xmlns:uind="http://www.w3.org/1999/xhtml" xmlns:ctp="http://www.w3.org/1999/xhtml">
    <head th:replace="_fragments :: head('Users & Roles')"></head>
    <body>
        <div class="container-fluid">
            <header class="row page-header" th:replace="_fragments :: page-header"></header>
            <main class="row page-main">
                <!-- sidebar starts -->
<!--                <aside class="col-sm-2" th:replace="_inventory-account-sidebar :: sidebar"></aside>-->
                <!-- sidebar ends -->
                <!--header starts-->
                <div class="col-sm">
                    <div th:replace="_notices :: page-notices"></div>
                    <div class="mb-4 d-flex justify-content-between">
                        <h3>Add User </h3>
                        <a th:href="@{/users/new}" class="btn btn-primary">Add New</a>
                    </div>
                    <div th:replace="_fragments :: table-loading-skeleton"></div>
                    <table th:if="${ #lists != null && #lists.size(users) !=  0 }" class="table table-striped table-bordered" data-table data-order="[[ 0, &quot;asc&quot; ]]">
                        <thead>
                            <tr>
                                <th>User</th>
                                <th>Roles</th>
                                <th>Enabled</th>
                                <th>Inventory Accounts</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr th:each="user : ${users}" th:object="${user}">
                                <td th:text="*{username}"></td>
                                <td th:text="*{authorities}"></td>
                                <td>
                                    <input onclick="return false;" type="checkbox" th:checked="*{enabled}" />
                                </td>
                                <td th:text="*{inventoryAccounts}"></td>
                                <td>
                                    <a th:href="@{'/users/edit/' + *{username}}" class="btn btn-sm btn-secondary"
                                       title="Edit">
                                        <i class="bi bi-pencil"></i>
                                    </a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <h4 th:if="${#lists.size(users) == 0}">No user found.</h4>
                </div>
            </main>
        </div>
        <div th:replace="_fragments :: page-footer-scripts"></div>
    </body>
</html>