added start_booking, see #14

This commit is contained in:
Jottyfan
2024-03-16 22:40:36 +01:00
parent ce819f80de
commit 03eb781a98
8 changed files with 101 additions and 43 deletions

View File

@ -105,8 +105,8 @@
</div>
</div>
<div class="row mb-2">
<label for="inputProfile" class="col-sm-2 col-form-label">Verantwortlicher</label>
<div class="col-sm-10">
<label for="inputProfile" class="col-sm-2 col-form-label mb-2">Verantwortlicher</label>
<div class="col-sm-4 mb-2">
<span class="error" th:each="error : ${#fields.errors('fkProfile')}">[[${error}]]<br /></span> <select id="inputProfile" th:field="*{fkProfile}"
th:class="${'form-select ' + (#fields.hasErrors('fkProfile') ? 'inputerror' : '')}">
<option value="">--- bitte wählen ---</option>
@ -118,33 +118,26 @@
});
</script>
</div>
</div>
<div class="row mb-2">
<label for="inputBedsFemale" class="col-sm-2 col-form-label">Anzahl Betten für Mädchen</label>
<div class="col-sm-10">
<span class="error" th:each="error : ${#fields.errors('bedsFemale')}">[[${error}]]<br /></span>
<input type="number" class="form-control" th:field="*{bedsFemale}" />
<label for="startBooking" class="col-sm-2 col-form-label mb-2">Buchungsbeginn</label>
<div class="col-sm-4 mb-2">
<span class="error" th:each="error : ${#fields.errors('startBooking')}">[[${error}]]<br /></span> <input id="startBooking" type="date" th:field="*{startBooking}"
th:class="${'form-control ' + (#fields.hasErrors('startBooking') ? 'inputerror' : '')}" />
</div>
<label for="inputBedsFemale" class="col-sm-2 col-form-label mb-2">Anzahl Betten für Mädchen</label>
<div class="col-sm-4 mb-2">
<span class="error" th:each="error : ${#fields.errors('bedsFemale')}">[[${error}]]<br /></span> <input type="number" class="form-control" th:field="*{bedsFemale}" />
</div>
</div>
<div class="row mb-2">
<label for="inputBedsMale" class="col-sm-2 col-form-label">Anzahl Betten für Jungen</label>
<div class="col-sm-10">
<span class="error" th:each="error : ${#fields.errors('bedsMale')}">[[${error}]]<br /></span>
<input type="number" class="form-control" th:field="*{bedsMale}" />
<div class="col-sm-4">
<span class="error" th:each="error : ${#fields.errors('bedsMale')}">[[${error}]]<br /></span> <input type="number" class="form-control" th:field="*{bedsMale}" />
</div>
</div>
<div class="row mb-2">
<label for="inputBlockedBedsFemale" class="col-sm-2 col-form-label">Reservierte Betten für Mädchen</label>
<div class="col-sm-10">
<span class="error" th:each="error : ${#fields.errors('blockedBedsFemale')}">[[${error}]]<br /></span>
<input type="number" class="form-control" th:field="*{blockedBedsFemale}" />
<div class="col-sm-4">
<span class="error" th:each="error : ${#fields.errors('blockedBedsFemale')}">[[${error}]]<br /></span> <input type="number" class="form-control" th:field="*{blockedBedsFemale}" />
</div>
</div>
<div class="row mb-2">
<label for="inputBlockedBedsMale" class="col-sm-2 col-form-label">Reservierte Betten für Jungen</label>
<div class="col-sm-10">
<span class="error" th:each="error : ${#fields.errors('blockedBedsMale')}">[[${error}]]<br /></span>
<input type="number" class="form-control" th:field="*{blockedBedsMale}" />
<div class="col-sm-4">
<span class="error" th:each="error : ${#fields.errors('blockedBedsMale')}">[[${error}]]<br /></span> <input type="number" class="form-control" th:field="*{blockedBedsMale}" />
</div>
</div>
<div class="row mb-2">

View File

@ -37,7 +37,7 @@
</div>
</div>
</div>
<div class="row g-5" th:if="${c.bedsFemale + c.bedsMale > 0}">
<div class="row g-5" th:if="${c.bedsFemale + c.bedsMale > 0 and c.bookingHasStarted}">
<div class="col-2"><img th:src="@{/images/Icon_Bett.svg}" width="48px" height="48px" /></div>
<div class="col-10 d-flex align-items-center" th:text="${'es sind nur noch ' + (c.bedsFemale - c.blockedBedsFemale - c.usedBedsFemale) + ' Mädchen- und ' + (c.bedsMale - c.blockedBedsMale - c.usedBedsMale) + ' Jungs- von ' + (c.bedsFemale + c.bedsMale) + ' Betten frei'}"></div>
<div class="col-12 alert alert-info alert-dismissible fade show" role="alert">
@ -45,8 +45,13 @@
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Schließen"></button>
</div>
</div>
<div class="row g-5" th:unless="${c.bookingHasStarted}">
<div class="col-12 alert alert-info" role="alert">
Die Anmeldung wird erst am <span th:text="${#temporals.format(c.startBooking, 'dd.MM.yyyy')}"></span> freigeschaltet.
</div>
</div>
</div>
<div style="text-align: center; margin-top: 48px">
<div style="text-align: center; margin-top: 48px" th:if="${c.bookingHasStarted}">
<a class="btn btn-linda buttonfont" th:href="@{/registration/{id}(id=${c.pk})}">jetzt anmelden</a>
</div>
</div>

View File

@ -9,7 +9,10 @@
<div class="mainpage">
<h1 class="centered cabin">Anmeldung</h1>
<h3 class="centered cabin" th:text="'zur ' + ${camp.name} + ' ' + ${camp.year}"></h3>
<div class="card centered-card lindaborders" style="max-width: 48rem">
<div class="alert alert-warning" style="margin: auto; max-width: 450px" th:unless="${camp.bookingHasStarted}">
Die Anmeldung wird erst am <span th:text="${#temporals.format(camp.startBooking, 'dd.MM.yyyy')}"></span> freigeschaltet.
</div>
<div class="card centered-card lindaborders" style="max-width: 48rem" th:if="${camp.bookingHasStarted}">
<div class="card-body">
<h1 class="centered cabin">Teilnehmeranmeldung</h1>
<form th:action="@{/registration/register}" th:object="${bean}" method="post">
@ -143,8 +146,8 @@
$("#phone").val(j.phone);
$("#email").val(j.email);
$("#sex").val(j.sex);
$("#birthDate").val(j.birthDate);
}
$("#birthDate").val(j.birthDate);
}
</script>
</div>
</div>