manipulate slots

This commit is contained in:
Jottyfan
2023-11-18 19:29:35 +01:00
parent 0c18b2df56
commit 48525b7e20
20 changed files with 331 additions and 558 deletions

View File

@ -1,41 +0,0 @@
<!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" th:if="${bean}">
<div class="row g-2">
<div class="col-sm-2">Tag</div>
<div class="col-sm-10" th:text="${#temporals.format(bean.slotDay, 'yyyy-MM-dd')}"></div>
<div class="col-sm-2">Lehreinheiten</div>
<div class="col-sm-10">
<div class="row g-2" th:each="l : ${bean.lessons}">
<div class="col-sm-2">Dozent</div>
<div class="col-sm-10">
<div th:each="p : ${l.persons}" th:text="${p.forename} + ' ' + ${p.surname}"></div>
</div>
<div class="col-sm-2">Themen</div>
<div class="col-sm-10">
<div class="row g-2" th:each="x : ${l.subjects}">
<div class="col-sm-2">Thema</div>
<div class="col-sm-10" th:text="${x.theme}"></div>
<div class="col-sm-2">Unterthema</div>
<div class="col-sm-10" th:text="${x.subtheme}"></div>
<div class="col-sm-2">Buchseiten</div>
<div class="col-sm-10" th:text="${x.bookPages}"></div>
<div class="col-sm-2">Arbeitsblätter</div>
<div class="col-sm-10" th:text="${x.worksheets}"></div>
<div class="col-sm-2">Bibelvers</div>
<div class="col-sm-10" th:text="${x.bibleverse}"></div>
<div class="col-sm-2">Quelle</div>
<div class="col-sm-10" th:text="${x.source?.name}"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</th:block>
</body>
</html>

View File

@ -8,35 +8,44 @@
<tr>
<th>Tag</th>
<th>Kürzel</th>
<th>Quelle</th>
<th>Thema</th>
<th>Unterthema</th>
<th>Tag-Anmerkungen</th>
<th>Notiz</th>
<th></th>
</tr>
</thead>
<tbody>
<tr th:each="s : ${list}">
<td th:text="${#temporals.format(s.slotDay, 'yyyy-MM-dd')}"></td>
<td th:text="${s.abbreviation}"></td>
<td th:text="${s.sourceName}"></td>
<td><span th:text="${#temporals.format(s.slotDay, 'yyyy-MM-dd')}" th:if="${s.pkLesson}"></span> <a th:href="@{/slot/{id}(id=${s.pkSlot})}"
th:text="${#temporals.format(s.slotDay, 'yyyy-MM-dd')}" class="btn btn-outline-secondary" th:unless="${s.pkLesson}"></a></td>
<td><a th:href="@{/person?slotId={id}(id=${s.pkSlot})}" class="btn btn-outline-secondary"> <span th:text="${s.abbreviation}" th:if="${s.abbreviation}"></span> <i
class="bi bi-pencil" th:if="${s.abbreviation == null || s.abbreviation.isBlank()}"></i>
</a></td>
<td th:text="${s.theme}"></td>
<td th:text="${s.subtheme}"></td>
<td th:text="${s.slotNotes}"></td>
<td><a th:href="@{/item/{slot}(slot=${s.pkSlot})}" class="btn btn-outline-secondary"><i class="bi bi-pencil"></i></a></td>
<td><a th:href="@{/slot/{id}(id=${s.pkSlot})}" class="btn btn-outline-secondary"> <span th:text="${s.slotNotes}"></span> <i class="bi bi-pencil"
th:if="${s.slotNotes == null || s.slotNotes.isBlank()}"></i>
</a></td>
<td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="5"><a th:href="@{/slot}" class="btn btn-outline-success">einen neues Datum anlegen</a></td>
</tr>
</tfoot>
</table>
<script type="text/javascript">
<script th:inline="javascript">
/*<![CDATA[*/
$(document).ready(function() {
$("#table").DataTable({
"columnDefs" : [ {
"targets" : 0,
"type" : "date-eu"
} ],
"order" : [ [ 0, 'desc' ] ],
"language" : locale_de
});
});
/*]]>*/
</script>
</div>
</th:block>

View File

@ -0,0 +1,16 @@
<!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="alert alert-danger" th:if="${bean}">
Wollen Sie den Slot <span th:text="${#temporals.format(bean.slotDay, 'dd.MM.yyyy')}"></span> wirklich löschen?<br />
<a th:href="@{/slot/{id}/destroy(id=${bean.pkSlot})}" class="btn btn-outline-danger" th:if="${bean.pkSlot}">Ja, definitiv</a>
</div>
<div class="alert alert-warning" th:unless="${bean}">
Leider wurde das Datum bereits für einen Termin gebucht. Daher kann der Slot nicht gelöscht werden.
</div>
</div>
</th:block>
</body>
</html>

View File

@ -0,0 +1,30 @@
<!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">
<form th:action="@{/slot/save}" th:object="${bean}" method="post">
<input type="hidden" th:field="*{pkSlot}" />
<div class="row g-2">
<div class="col-sm-2">Tag</div>
<div class="col-sm-10">
<input type="date" th:field="*{slotDay}" th:class="${#fields.hasErrors('slotDay') ? 'form-control bg-danger' : 'form-control'}" />
<div th:each="err : ${#fields.errors('slotDay')}" th:text="${err}" class="alert alert-danger"></div>
</div>
<div class="col-sm-2">Notiz</div>
<div class="col-sm-10">
<textarea class="form-control" th:field="*{note}"></textarea>
</div>
<div class="col-sm-2"></div>
<div class="col-sm-10">
<button type="submit" class="btn btn-outline-primary">Speichern</button>
<a th:href="@{/slot/{id}/delete(id=${bean.pkSlot})}" class="btn btn-outline-danger" th:if="${bean.pkSlot}">Löschen</a>
</div>
</div>
</form>
</div>
</div>
</th:block>
</body>
</html>

View File

@ -23,7 +23,6 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent" style="margin-right: 20px">
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item"><a class="btn btn-outline-secondary" th:href="@{/}">Startseite</a></li>
<li class="nav-item"><a class="btn btn-outline-secondary" th:href="@{/sheet}">Übersicht</a></li>
</ul>
<ul layout:fragment="header"></ul>
<ul class="nav navbar-nav ms-auto">