<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <div th:replace="fragments/head :: headFragment">
        <title id="pageTitle">Users</title>
    </div>
    <script src="https://code.jquery.com/jquery-2.1.4.min.js" th:if="false"></script>
    <script src="http://blackpeppersoftware.github.io/thymeleaf-fragment.js/thymeleaf-fragment.js"
        data-template-prefix="../" defer="defer" th:if="false"></script>

    <th:block th:include="fragments/admin :: headFragment"></th:block>

    <style>
        /* .sidebar {
            height: 100%;
        } */
    </style>
</head>
<!-- TODO
	Make user admin / remove user from admin
	Change E2E passphrase
	Delete Messages
-->

<!-- <div th:include="fragments/admin :: admin-sidebar"></div> -->

<body id="page-top">

    <!-- Page Wrapper -->
    <div id="wrapper">


        <div th:include="fragments/admin :: sidebar-fragment"></div>

        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column" style="background-color: #333;">

            <!-- Main Content -->
            <div id="content">

                <div th:include="fragments/admin :: topbar-fragment"></div>

                <!-- Begin Page Content -->
                <div class="container-fluid">

                    <!-- Page Heading -->

                    <!-- Content Row -->
                    <div class="row">

                        <div class="col">

                            <!-- Approach -->
                            <div class="card bg-dark border border-dark text-white shadow mb-4">
                                <div class="card-header bg-secondary border border-secondary py-3">
                                    <h6 class="m-0 font-weight-bold text-white">Users</h6>
                                </div>
                                <div class="card-body">
                                    <div class="table-responsive">
                                        <table data-toggle="table" class="table table-bordered text-white" width="100%"
                                            cellspacing="0" id="usersTable">
                                            <thead>
                                                <tr>
                                                    <th>User ID</th>
                                                    <th>User Name</th>
                                                    <th>Role</th>
                                                    <th>Registration Date</th>
                                                    <!-- <th>Action</th> -->
                                                </tr>
                                            </thead>
                                            <tbody id="usersTableBody">

                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                        </div>

                    </div>
                    <!-- /.container-fluid -->

                </div>
                <!-- End of Main Content -->

                <div th:include="fragments/admin :: footer"></div>

            </div>
            <!-- End of Content Wrapper -->

        </div>
        <!-- End of Page Wrapper -->

        <th:block th:include="fragments/admin :: modal"></th:block>
        <div th:if="false">
            <th:block th:include="admin :: modal"></th:block>
        </div>

        <template id="users-table-template">
            <tr>
                <td>{{id}}</td>
                <td>{{userName}}</td>
                <td>{{role}}</td>
                <td>{{joinDate}}</td>
                <td><button class="btn btn-info"><i class="fas fa-ellipsis-h"></i></button></td>
            </tr>
        </template>

</body>

</html>