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

<head>
    <div th:replace="fragments/head :: headFragment">
        <title id="pageTitle">Admin Home</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>
    <script th:src="@{js/admin.js}" src="../../static/js/admin.js" defer="defer"></script>
    <link th:href="@{/css/master.css}" href="../../static/css/master.css" rel="stylesheet" th:if="false">
    <link th:href="@{/css/colors.css}" href="../../static/css/colors.css" rel="stylesheet" th:if="false">
</head>
<!-- TODO
	Make user admin / remove user from admin
	Change E2E passphrase
	Delete Messages
-->

<body>
    <div th:include="fragments/navbar :: navbarFragment"></div>

    <header>
        <div class="container bg-primary">
            <div class="row">
                <div class="col-sm py-5">
                    <h1 class="display-4 text-center">Admin Page</h1>
                    <p class="alert-danger px-2">Warning: these settings can be dangerous..</p>
                </div>
            </div>
            <div class="row">
                <div class="col-sm col-md-4">
                    <h4>Make User an Admin</h4>
                    <form id="addUserToAdminForm">
                        <div class="form-group">
                            <label for="addUserToDropDown">Select User:</label>
                            <select class="form-control custom-select" size="4" id="addUserToAdminDropDown">
						
								<option  th:each="userName : ${userNames}" 
										th:value="${userName}" 
										th:text="#{${userName}}">
									Wireframe
								</option>
					
							</select>


                        </div>
                        <div class="form-group">
                            <button class="btn btn-danger form-control">Make admin</button>
                        </div>
                    </form>
                </div>
                <div class="col-sm col-md-4">
                    <h4>Change passphrases</h4>
                    <form id="changePassphraseForm">
                        <div class="form-group">
                            <label for="changePassphraseDropDown">Select User:</label>
                            <select class="form-control" id="changePassphraseDropDown">
							
									<option  th:each="userName : ${userNames}" 
											th:value="${userName}" 
											th:text="#{${userName}}">
										Wireframe
									</option>
						
							</select>

                        </div>
                        <div class="form-group">
                            <label for="passphraseOld">Passphrase Old</label>
                            <input type="password" id="passphraseOld" class="form-control">
                        </div>
                        <div class="form-group">
                            <label for="passphraseNew">Passphrase New</label>
                            <input type="password" id="passphraseNew" class="form-control">
                        </div>
                        <div class="form-group">
                            <button class="btn btn-danger form-control">Change Passphrase</button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="row">
                <!-- <div class="col-sm"></div> -->

                <div class="col-sm d-lg-block">
                    <div class="d-flex justify-content-center">
                        <div class="py-5">
                            <h4 class="p-2 text-center">Logout</h4>
                            <form action="#" th:action="@{/logout}" method="POST">
                                <!-- <input type="submit" value="logout"> -->
                                <!-- <input type="hidden" th:name="${_csrf.parameterName}"
												th:value="${_csrf.token}" /> -->
                                <div class="form-group">
                                    <button class="btn btn-secondary form-control">Logout</button>
                                </div>
                            </form>

                        </div>
                    </div>
                </div>

            </div>
        </div>
    </header>

</body>

</html>