Jottyfan
2022-12-11 21:56:31 +01:00
parent f2a743a27f
commit 2ecd3dbc38
8 changed files with 123 additions and 21 deletions

View File

@ -9,15 +9,6 @@
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item"><a th:href="@{${keycloakProfileUrl}}" class="btn btn-secondary btn-icon-silent" target="_blank">Profil</a></li>
</ul>
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle btn btn-secondary btn-icon-silent" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Buchen</a>
<ul class="dropdown-menu">
<li th:each="c : ${camps}"><a class="dropdown-item" th:href="@{/registration/{id}(id=${c.pk})}"><span th:text="${c.name}"></span>&nbsp;<span
th:text="${#numbers.formatInteger(c.year, 0)}" th:if="${c.year}"></span></a></li>
</ul>
</li>
</ul>
<ul class="navbar-nav mb-2 mb-lg-0" sec:authorize="hasRole('business')">
<li class="nav-item"><a th:href="@{/business}" class="btn btn-secondary btn-icon-silent">Abrechnung</a></li>
</ul>
@ -30,12 +21,54 @@
</th:block>
<th:block layout:fragment="content">
<div class="mainpage">
<!-- list of camps -->
<div class="container">
<div class="row">
<div class="col">
<div style="text-align: center" class="menufont">Hier kannst du dich zu den Freizeiten anmelden:</div>
</div>
</div>
<br />
<div class="row">
<div class="col-sm-12 col-md-6 col-lg-3" th:each="c : ${camps}">
<div class="card" style="background-color: rgba(255, 255, 255, 0.5)">
<div class="card-body">
<div class="menufont" th:text="${c.locationName}" style="padding: 8px"></div>
<div>
<h1 th:text="${c.name}" class="menufont"></h1>
</div>
<br />
<div>
<span style="margin: 24px">ICON</span> <span class="menufont" th:text="${c.minAge} + ' - ' + ${c.maxAge} + ' Jahre'"></span>
</div>
<br />
<div>
<span style="margin: 24px">ICON</span> <span class="menufont" th:text="${#temporals.format(c.arrive, 'dd.MM.')} + ' - ' + ${#temporals.format(c.depart, 'dd.MM.yyyy')}"
th:if="${c.arrive != null && c.depart != null}"></span>
</div>
<br />
<div>
<span style="margin: 24px">ICON</span> <span class="menufont" th:text="${c.price}"></span>
</div>
<br />
<div>
<a class="btn btn-outline-primary form-control menufont" th:href="@{/registration/{id}(id=${c.pk})}">Jetzt anmelden</a>
</div>
</div>
</div>
</div>
</div>
</div>
<br />
<!-- registrations -->
<script type="text/javascript">
function mark(e) {
$(e).css("background", "orange");
}
</script>
<div class="alert alert-primary" th:if="${mybookings.size() < 1}">Es wurden noch keine Anmeldungen für eine Freizeit hinterlegt.</div>
<div class="alert alert-primary menufont" th:if="${mybookings.size() < 1}">Es wurden noch keine Anmeldungen für eine Freizeit hinterlegt.</div>
<div th:if="${mybookings.size() > 0}" class="menufont">Deine bisherigen Anmeldungen:</div>
<div class="accordion" id="acc" th:if="${mybookings.size() > 0}">
<div class="accordion-item" th:each="b : ${mybookings}">
<h2 class="accordion-header" th:id="'acc-head-' + ${b.pk}" th:if="${b.pk}">

View File

@ -0,0 +1,31 @@
<!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 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<th:block layout:fragment="header">
<ul class="navbar-nav mb-2 mb-lg-0" th:if="${not #strings.isEmpty(currentUser)}">
<li class="nav-item"><a th:href="@{${keycloakProfileUrl}}" class="btn btn-secondary btn-icon-silent" target="_blank">Profil</a></li>
</ul>
<ul class="navbar-nav mb-2 mb-lg-0" sec:authorize="hasRole('business')">
<li class="nav-item"><a th:href="@{/business}" class="btn btn-secondary btn-icon-silent">Abrechnung</a></li>
</ul>
<ul class="navbar-nav mb-2 mb-lg-0" sec:authorize="hasRole('registrator')">
<li class="nav-item"><a th:href="@{/confirmation}" class="btn btn-secondary btn-icon-silent">Bestätigung</a></li>
</ul>
<ul class="navbar-nav mb-2 mb-lg-0" th:if="${not #strings.isEmpty(currentUser)}">
<li class="nav-item"><a href="https://www.onkelwernerfreizeiten.de/cloud" class="btn btn-secondary btn-icon-silent" target="_blank">Nextcloud</a></li>
</ul>
</th:block>
<th:block layout:fragment="content">
<div class="mainpage">
<div class="alert alert-error">
Die Freizeit ist bereits vorbei. Du kannst dich nur zu Freizeiten anmelden, die noch nicht beendet worden sind.
</div>
<div><a th:href="@{/}" class="btn btn-outline-secondary">zur Hauptseite</a></div>
</div>
</th:block>
</body>
</html>

View File

@ -17,6 +17,7 @@
<div class="card centered-card" style="max-width: 48rem">
<div class="card-body">
<form th:action="@{/registration/register}" th:object="${bean}" method="post">
<span class="error" th:each="error : ${#fields.errors('fkCamp')}">[[${error}]]<br /></span>
<input type="hidden" th:field="*{fkCamp}" />
<div class="container">
<div class="row">