<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" layout:decorate="~{template}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<body>
	<th:block layout:fragment="content">
		<div sec:authorize="hasRole('admin')">
			<form th:action="@{/admin/privileges/insert/{d}(d=${pagedest})}" th:object="${bean}" method="post" enctype="multipart/form-data">
				<div class="tablebox">
					<div class="container">
						<div class="row mb-2">
							<div class="col-sm-12">
								<div class="alert alter-danger" th:if="${error}" th:text="${error}"></div>
							</div>
						</div>
						<div class="row mb-2">
							<label for="inputPerson" class="col-sm-2 col-form-label">Person</label>
							<div class="col-sm-10">
								<span class="error" th:each="error : ${#fields.errors('fkProfile')}">[[${error}]]<br /></span> <select id="inputPerson" th:field="*{fkProfile}"
									th:class="${'form-select ' + (#fields.hasErrors('fkProfile') ? 'inputerror' : '')}">
									<option value="">--- bitte wählen ---</option>
									<option th:each="l : ${profiles}" th:value="${l.pk}" th:text="${l.fullname}"></option>
								</select>
							</div>
							<script type="text/javascript">
								$(document).ready(function() {
									$("#inputPerson").select2();
								});
							</script>
						</div>
						<div class="row mb-2">
							<label for="inputCamp" class="col-sm-2 col-form-label">Freizeit</label>
							<div class="col-sm-10">
								<span class="error" th:each="error : ${#fields.errors('fkCamp')}">[[${error}]]<br /></span> <select id="inputCamp" th:field="*{fkCamp}"
									th:class="${'form-select ' + (#fields.hasErrors('fkCamp') ? 'inputerror' : '')}">
									<option value="">--- bitte wählen ---</option>
									<option th:each="l : ${camps}" th:value="${l.pk}" th:text="${l.name + ' ' + #temporals.format(l.arrive, 'yyyy')}"></option>
								</select>
							</div>
							<script type="text/javascript">
								$(document).ready(function() {
									$("#inputCamp").select2();
								});
							</script>
						</div>
						<div class="row mb-2">
							<label for="inputModule" class="col-sm-2 col-form-label">Modul</label>
							<div class="col-sm-10">
								<span class="error" th:each="error : ${#fields.errors('module')}">[[${error}]]<br /></span> <select id="inputModule" th:field="*{module}"
									th:class="${'form-select ' + (#fields.hasErrors('module') ? 'inputerror' : '')}">
									<option value="">--- bitte wählen ---</option>
									<option th:each="l : ${modules}" th:value="${l}" th:text="${l}"></option>
								</select>
							</div>
						</div>
						<div class="row mb-2">
							<div class="col-sm-2"></div>
							<div class="col-sm-10">
								<input type="submit" class="btn btn-success" value="Ok" /> <a th:href="@{/admin/privileges/abortinsert/{d}(d=${pagedest})}" class="btn btn-outline-secondary">Abbrechen</a>
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</th:block>
</body>
</html>