<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Administration</title>
<meta name='description' content='Authentication app'>
<meta name='keywords' content='rkvac, smart-card authentication'>
<meta name='author' content='Bronislav Strava'>
<meta name='robots' content='all'>
<link href='/img/favicon2.png' rel='shortcut icon' type='image/png'>
<!--	<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet"
	href="https://use.fontawesome.com/releases/v5.4.1/css/all.css"
	integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz"
	crossorigin="anonymous">
-->
	<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" type="text/css">
	<link rel="stylesheet" th:href="@{/css/fontawesome/css/all.css}" type="text/css">
</head>
<body>

	<div class="container my-2">
		<div class="card">
			<div class="card-header">
				<ul class="nav nav-tabs card-header-tabs">
					<li class="nav-item">
						<a class="nav-link active" aria-current="true" href="/admin/list">Credentials</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="/admin/parameters">Parameters</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="/admin/logs">Logs</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="/admin/settings">Settings</a>
					</li>
					<li class="nav-item">
						<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Administration</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="/admin/download-log"><i class="fas fa-arrow-circle-down" style="color:black"></i></a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="/logout"><i class="fas fa-sign-out-alt" style="color:black"></i></a>
					</li>
				</ul>
			</div>
			<div class="card-body">
				<div th:switch="${students}">
					<div class="col-md-10">
						<h2 th:case="null">No Attributes yet!</h2>
						<div th:case="*">
							<table class="table table-stripedtable-responsive-md">
								<thead>
									<tr>
										<th>Name</th>
										<th>Attributes</th>
										<th>Active Positions</th>
										<th>Edit</th>
										<th>Delete</th>
										<th>Status</th>
										<th></th>
									</tr>
								</thead>
								<tbody>
									<tr th:each="cred : ${students}">
										<td th:text="${cred.name}"></td>
										<td th:text="${cred.getElements()}"></td>
										<td th:text="${cred.getActivePositions()}"></td>
										<td><a th:href="@{/admin/edit/{id}(id=${cred.id})}"
											class="btn btn-primary"><i class="fas fa-user-edit ml-2"></i></a></td>
										<td><a
											th:href="@{/admin/delete/{id}(id=${cred.id})}"
											class="btn btn-primary"><i class="fas fa-user-times ml-2"></i></a></td>
										<td th:text="${cred.getStatus()}"></td>
										<td><a
												th:href="@{/admin/active/{id}(id=${cred.id})}"
												class="btn btn-success"><i class="fas fa-power-off"></i></a></td>
									</tr>
								</tbody>
							</table>

						</div>
						<div class="row">
							<div class="col-md-10">
								<a href="/admin/signup" class="btn btn-primary"><i
										class="fas fa-user-plus ml-2">Add Credentials</i></a>
								<a href="/admin/list/download-database" class="btn btn-secondary"><i class="fas fa-cloud-download-alt">Save Databse</i></a>

								<!--
								<a href="/admin/load" class="btn btn-secondary"><i class="fas fa-cloud-upload-alt">Load Database</i></a>

									<a href="/admin" class="btn btn-secondary"><i class="bi bi-arrow-left-circle">Administration</i></a>
                                        <form form-method="post" action="/logout">
                                            <button type="submit" class="btn btn-danger"><i class="fas fa-sign-out-alt">Sign Out</i></button>
                                        </form>
                                -->
							</div>

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

	</div>
</body>
</html>