basic registration feature
This commit is contained in:
61
src/main/resources/templates/camp/edit.html
Normal file
61
src/main/resources/templates/camp/edit.html
Normal file
@ -0,0 +1,61 @@
|
||||
<!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">Surname</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"></div>
|
||||
<div class="col-sm-9">
|
||||
<button type="submit" class="btn btn-outline-success">Korrigeren</button>
|
||||
<a th:href="@{/camp/registration}" class="btn btn-outline-secondary">Abbrechen</a>
|
||||
<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> <span th:text="${bean.surname}"></span> 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>
|
89
src/main/resources/templates/camp/registration.html
Normal file
89
src/main/resources/templates/camp/registration.html
Normal file
@ -0,0 +1,89 @@
|
||||
<!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</h2>
|
||||
</div>
|
||||
</div>
|
||||
<script th:inline="javascript">
|
||||
function toggleTo(opener, name) {
|
||||
$('.nav-opener').removeClass('active');
|
||||
$('.tabpanel').hide();
|
||||
$(opener).addClass('active');
|
||||
$(name).show();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var regsize = parseInt(/*[[${registrations.size()}]]*/"0");
|
||||
if (regsize < 1) {
|
||||
$("#open_new").addClass("active");
|
||||
$("#new").show();
|
||||
$("#open_found").removeClass("active");
|
||||
$("#found").hide();
|
||||
} else {
|
||||
$("#open_new").removeClass("active");
|
||||
$("#new").hide();
|
||||
$("#open_found").addClass("active");
|
||||
$("#found").show();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a id="open_new" class="nav-link active nav-opener" aria-current="page" href="#" onclick="toggleTo(this, '#new')">Neue Anmeldung</a></li>
|
||||
<li class="nav-item"><a id="open_found" class="nav-link nav-opener" href="#" onclick="toggleTo(this, '#found')">Bisherige Anmeldungen</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="new" class="tabpanel">
|
||||
<form th:action="@{/camp/registration/submit}" method="post" th:object="${bean}">
|
||||
<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">Surname</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"></div>
|
||||
<div class="col-sm-9">
|
||||
<button type="submit" class="btn btn-outline-success">Speichern</button>
|
||||
<a th:href="@{/camp/registration}" class="btn btn-outline-secondary">Abbrechen</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="found" class="tabpanel">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Vorname</th>
|
||||
<th>Nachname</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="r : ${registrations}">
|
||||
<td th:text="${r.forename}"></td>
|
||||
<td th:text="${r.surname}"></td>
|
||||
<td><a th:href="@{/camp/registration/edit/{id}(id=${r.pkRegistration})}" class="btn btn-outline-secondary"><i class="bi bi-pencil"></i></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</body>
|
||||
</html>
|
@ -25,14 +25,15 @@
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent" style="margin-right: 20px">
|
||||
<ul class="navbar-nav mb-2 mb-lg-0" th:if="${hasAnyRole}">
|
||||
<li class="nav-item"><a class="btn btn-outline-secondary" th:href="@{/next}" style="margin-left: 12px">Dienstplan</a></li>
|
||||
<li class="nav-item"><a class="btn btn-outline-secondary" th:href="@{/camp/registration}" style="margin-left: 12px">Anmeldung Gemeindefreizeit</a></li>
|
||||
<li class="nav-item"><a class="btn btn-outline-secondary" th:href="@{/next}" style="margin-left: 12px" th:if="${hasDateRole || hasBUrole}">Dienstplan</a></li>
|
||||
<li class="nav-item"><a class="btn btn-outline-secondary" th:href="@{/sheet}" style="margin-left: 12px" th:if="${hasBUrole}">Einteilung</a></li>
|
||||
<li class="nav-item"><a class="btn btn-outline-secondary" th:href="@{/subject/list}" style="margin-left: 12px" th:if="${hasBUrole}">Themen</a></li>
|
||||
<li class="nav-item"><a class="btn btn-outline-secondary" th:href="@{/download}" style="margin-left: 12px" th:if="${hasBUrole}">Download</a></li>
|
||||
</ul>
|
||||
<ul layout:fragment="header"></ul>
|
||||
<ul class="nav navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<li class="nav-item" th:if="${hasDateRole}">
|
||||
<a th:href="@{/ical}" class="btn btn-outline-secondary"><i class="bi bi-calendar-week"></i></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
|
Reference in New Issue
Block a user