Files
BiCO/src/main/resources/templates/camp/edit.html
2024-12-13 19:17:27 +01:00

113 lines
5.9 KiB
HTML

<!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 class="borderdist">
<div class="container">
<div class="row g-2">
<div class="col-sm-12">
<h2>Anmeldung zur Gemeindefreizeit 2025 bearbeiten</h2>
</div>
</div>
<div class="alert alert-danger" th:unless="${bean}">Sie haben keine Berechtigung, die Anmeldung mit dieser URL zu ändern.</div>
<form th:action="@{/camp/registration/correct}" method="post" th:object="${bean}" th:if="${bean}">
<input type="hidden" th:field="*{pkRegistration}" />
<div class="row g-3">
<div class="col-sm-3">Vorname</div>
<div class="col-sm-9">
<span th:if="${#fields.hasErrors('forename')}" th:errors="*{forename}" class="text-danger"></span> <input type="text" th:field="*{forename}" class="form-control" />
</div>
<div class="col-sm-3">Nachname</div>
<div class="col-sm-9">
<span th:if="${#fields.hasErrors('surname')}" th:errors="*{surname}" class="text-danger"></span> <input type="text" th:field="*{surname}" class="form-control" />
</div>
<div class="col-sm-3">Geschlecht</div>
<div class="col-sm-9">
<span th:if="${#fields.hasErrors('sex')}" th:errors="*{sex}" class="text-danger"></span> <select th:field="*{sex}" class="form-select">
<option value="">--- bitte wählen ---</option>
<option th:each="s : ${sexes}" th:value="${s}" th:text="${s}"></option>
</select>
</div>
<div class="col-sm-3">Alter</div>
<div class="col-sm-9">
<span th:if="${#fields.hasErrors('fkAge')}" th:errors="*{fkAge}" class="text-danger"></span>
<select th:field="*{fkAge}" class="form-select">
<option th:each="a : ${ages}" th:value="${a.pkAge}" th:label="${a.name} + ', ' + ${a.price} + ' € / Tag'"></option>
</select>
</div>
<div class="col-sm-3">Welche Tage</div>
<div class="col-sm-9">
<input id="day0" type="checkbox" name="active" th:field="*{day0}" class="form-check-input" />
<label class="form-check-label" for="day0">Donnerstag</label>
<input id="day1" type="checkbox" name="active" th:field="*{day1}" class="form-check-input" />
<label class="form-check-label" for="day1">Freitag</label>
<input id="day2" type="checkbox" name="active" th:field="*{day2}" class="form-check-input" />
<label class="form-check-label" for="day2">Sonnabend</label>
<input id="day3" type="checkbox" name="active" th:field="*{day3}" class="form-check-input" />
<label class="form-check-label" for="day3">Sonntag</label>
<input id="day4" type="checkbox" name="active" th:field="*{day4}" class="form-check-input" />
<label class="form-check-label" for="day4">Montag</label>
</div>
<div class="col-sm-3">Barrierefrei</div>
<div class="col-sm-9">
<span th:if="${#fields.hasErrors('barrierFree')}" th:errors="*{barrierFree}" class="text-danger"></span>
<select th:field="*{barrierFree}" class="form-select">
<option value="false">Nein</option>
<option value="true">Ja</option>
</select>
</div>
<div class="col-sm-3">Spezielle Ernährung (Allergien, Unverträglichkeiten)</div>
<div class="col-sm-9">
<textarea th:field="*{nutrition}" class="form-control"></textarea>
</div>
<div class="col-sm-3">Biete Plätze zum Mitfahren</div>
<div class="col-sm-9">
<input th:field="*{driverProvidePlaces}" type="number" min="0" max="8" class="form-control" />
</div>
<div class="col-sm-3">Benötige eine Mitfahrgelegenheit</div>
<div class="col-sm-9">
<input id="wantPlaceInCar" type="checkbox" name="active" th:field="*{wantPlaceInCar}" class="form-check-input" />
<label class="form-check-label" for="wantPlaceInCar">Ja, brauche ich</label>
</div>
<div class="col-sm-3">Besonderheiten / Krankheiten</div>
<div class="col-sm-9">
<textarea th:field="*{diseases}" class="form-control"></textarea>
</div>
<div class="col-sm-3">Finanzierungsunterstützung</div>
<div class="col-sm-9">
<input id="requirePayment" type="checkbox" name="active" th:field="*{requirePayment}" class="form-check-input" />
<label class="form-check-label" for="requirePayment">Ja, brauche ich</label>
</div>
<div class="col-sm-3"></div>
<div class="col-sm-9">
<button type="submit" class="btn btn-outline-success">Korrigeren</button>
&nbsp; <a th:href="@{/camp/registration}" class="btn btn-outline-secondary">Abbrechen</a> &nbsp;
<button type="button" class="btn btn-outline-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">Stornieren</button>
<div class="modal fade" id="deleteModal" tabindex="-1" aria-labelledby="deleteModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="deleteModalLabel">Löschen einer Anmeldung</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Soll die Anmeldung von <span th:text="${bean.forename}"></span>&nbsp;<span th:text="${bean.surname}"></span>&nbsp;wirklich gelöscht werden?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Abbrechen</button>
<a th:href="@{/camp/registration/delete/{id}(id=${bean.pkRegistration})}" class="btn btn-outline-danger">Endgültig löschen</a>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</th:block>
</body>
</html>