<!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">
<head>
<title>Camp Organizer Confirmation</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	<th:block layout:fragment="content">
		<div sec:authorize="hasRole('admin')">
			<form th:action="@{/admin/mail/send}" th:object="${bean}" method="post">
				<div class="card" style="max-width: 1024px; margin-left: auto; margin-right: auto">
					<div class="card-header">
						<span>eine Test-E-Mail verschicken</span>
					</div>
					<div class="card-body">
						<div class="container">
							<div class="row">
								<div class="col-sm-12 col-md-3">Absender</div>
								<div class="col-sm-12 col-md-9">
									<span th:text="${bean.from}"></span> <input type="hidden" th:field="*{from}" />
								</div>
								<span class="error" th:each="error : ${#fields.errors('from')}">[[${error}]]<br /></span>
								<div class="col-sm-12 col-md-3">Empfänger</div>
								<div class="col-sm-12 col-md-9">
									<span th:text="${bean.tos}"></span> <input type="hidden" th:field="*{tos}" />
								</div>
								<span class="error" th:each="error : ${#fields.errors('tos')}">[[${error}]]<br /></span>
								<div class="col-sm-12 col-md-3">Betreff</div>
								<div class="col-sm-12 col-md-9">
									<input type="text" th:field="*{subject}" th:class="${'form-control ' + (#fields.hasErrors('subject') ? 'inputerror' : '')}" />
								</div>
								<span class="error" th:each="error : ${#fields.errors('subject')}">[[${error}]]<br /></span>
								<div class="col-sm-12 col-md-3">Nachricht</div>
								<div class="col-sm-12 col-md-9">
									<textarea th:field="*{message}" th:class="${'form-control ' + (#fields.hasErrors('message') ? 'inputerror' : '')}" rows="5"></textarea>
								</div>
								<span class="error" th:each="error : ${#fields.errors('message')}">[[${error}]]<br /></span>
							</div>
						</div>
					</div>
					<div class="card-footer">
						<input type="submit" value="absenden" class="btn btn-outline-success from-control" />
					</div>
				</div>
			</form>
		</div>
	</th:block>
</body>
</html>