integrated the business module

This commit is contained in:
Jottyfan
2022-10-08 15:36:13 +02:00
parent 8e8fc13efa
commit 6b6b37f3ea
42 changed files with 2468 additions and 91 deletions

View File

@ -77,7 +77,7 @@ body {
background: transparent;
border: 2px solid transparent;
padding: 8px;
color: silver;
color: gray;
}
.btn-icon-silent:hover {

View File

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html th:replace="~{template :: layout(~{::title}, ~{::libs}, ~{::header}, ~{::content})}" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
<title>Camp Organizer Business</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<libs> </libs>
</head>
<body>
<header>
<a th:href="@{/}" class="btn btn-secondary btn-icon-silent" title="zur Hauptseite"><i class="fas fa-home"></i></a>
<a th:href="@{/business/}" class="btn btn-secondary btn-icon-silent" title="zur Finanzübersicht"><i class="far fa-money-bill-alt"></i></a>
<a th:href="@{/business/bookings}" class="btn btn-secondary btn-icon-silent" title="Buchungsübersicht" sec:authorize="hasRole('business_booking')"><i class="fas fa-users"></i></a>
<a th:href="@{'/business/bookings/' + ${booker.pk}}" class="btn btn-secondary btn-icon-silent" title="aktualisieren"><i class="fas fa-sync"></i></a>
</header>
<content>
<div class="mainpage">
<div class="container" style="max-width: 100%">
<div class="row">
<div class="col">
<div class="card" style="width: 480px" sec:authorize="hasRole('business_booking')">
<div class="card-header">Angemeldete Person</div>
<div class="card-body">
<table class="table">
<tbody>
<tr>
<th>Name</th>
<td th:text="${booker.name}"></td>
</tr>
<tr>
<th>Geschlecht</th>
<td th:text="${booker.sex}"></td>
</tr>
<tr>
<th>Freizeit</th>
<td th:text="${booker.camp}"></td>
</tr>
<tr>
<th>Rolle</th>
<td th:text="${booker.role}"></td>
</tr>
<tr>
<th>Angemeldet</th>
<td th:text="${#temporals.format(booker.bookingDate, 'dd.MM.yyyy')}"></td>
</tr>
<tr>
<th>Bestätigt</th>
<td th:text="${booker.accept == null ? '' : (booker.accept ? 'Ja' : 'abgelehnt')}"></td>
</tr>
<tr>
<th>Preis</th>
<td th:text="${booker.price}" />
</tr>
<tr>
<th>Kontostand</th>
<td><span th:text="${#strings.replace(#numbers.formatCurrency(booker.paid), '¤', '€')}" th:if="${booker.paid != null}"></span>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col">
<div class="card" style="width: 480px" sec:authorize="hasRole('business_booking')">
<div class="card-header">Einzahlung</div>
<div class="card-body">
<form action="#" th:action="@{'/business/bookings/payment/' + ${booker.pk}}" th:object="${addBean}" method="post">
<input type="number" step="0.01" th:field="*{payment}"> <input type="submit" style="padding: 4px" value="einzahlen">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</content>
</body>
</html>

View File

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html th:replace="~{template :: layout(~{::title}, ~{::libs}, ~{::header}, ~{::content})}" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
<title>Camp Organizer Business</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<libs> </libs>
</head>
<body>
<header>
<a th:href="@{/}" class="btn btn-secondary btn-icon-silent" title="zur Hauptseite"><i class="fas fa-home"></i></a>
<a th:href="@{/business/}" class="btn btn-secondary btn-icon-silent" title="zur Finanzübersicht"><i class="far fa-money-bill-alt"></i></a>
<a th:href="@{/business/bookings}" class="btn btn-secondary btn-icon-silent" title="aktualisieren"><i class="fas fa-sync"></i></a>
</header>
<content>
<div class="mainpage">
<div class="card" sec:authorize="hasRole('business_booking')">
<div class="card-header">Angemeldete Personen</div>
<div class="card-body">
<table id="bookers" class="table">
<thead>
<tr>
<th>Name</th>
<th>Geschlecht</th>
<th>Freizeit</th>
<th>Rolle</th>
<th>Kontostand</th>
<th>Angemeldet</th>
<th>Bestätigt</th>
</tr>
</thead>
<tbody>
<th:block th:each="b : ${bookers}">
<tr>
<td th:text="${b.name}"></td>
<td th:text="${b.sex}"></td>
<td th:text="${b.camp}"></td>
<td th:text="${b.role}"></td>
<td><span th:text="${#strings.replace(#numbers.formatCurrency(b.paid), '¤', '€')}"></span> <a class="btn btn-icon-silent" th:href="@{/business/bookings/{id}(id=${b.pk})}"
title="bearbeiten"><i class="fas fa-edit"></i></a></td>
<td th:text="${#temporals.format(b.bookingDate, 'dd.MM.yyyy')}"></td>
<td th:text="${b.accept == null ? '' : (b.accept ? 'Ja' : 'abgelehnt')}"></td>
</tr>
</th:block>
</tbody>
</table>
<script>
$(document).ready(function() {
$("#bookers").DataTable({
language : locale_de
});
});
</script>
</div>
</div>
</div>
</content>
</body>
</html>

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html th:replace="~{template :: layout(~{::title}, ~{::libs}, ~{::header}, ~{::content})}" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
<title>Camp Organizer Business</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<libs></libs>
</head>
<body>
<header>
<a th:href="@{/}" class="btn btn-secondary btn-icon-silent" title="zur Hauptseite"><i class="fas fa-home"></i></a>
<a th:href="@{/business}" class="btn btn-secondary btn-icon-silent" title="aktualisieren"><i class="fas fa-sync"></i></a>
<a th:href="@{/business/bookings}" class="btn btn-secondary btn-icon-silent" title="zur Buchungsübersicht" sec:authorize="hasRole('business_booking')"><i class="fas fa-users"></i></a>
<a th:href="@{/business/privileges}" class="btn btn-secondary btn-icon-silent" title="Nutzerverwaltung" sec:authorize="hasRole('admin')"><i class="fas fa-user-lock"></i></a>
</header>
<content>
<div class="mainpage">
<div class="card" style="width: 500px">
<div class="card-header">Finanzübersicht über alle Freizeiten</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th scope="col">Jahr</th>
<th scope="col">Freizeit</th>
<th scope="col">Kontostand</th>
</tr>
</thead>
<tbody>
<th:block th:each="b : ${campBudgets}" sec:authorize="hasRole('business')">
<tr>
<td th:text="${#numbers.formatDecimal(b.campYear, 1, 0)}"></td>
<td><a th:href="@{/business/camp/{id}(id=${b.campId})}" th:text="${b.campName}" class="tablelink" title="Freizeitübersicht laden"></a></td>
<td th:text="${#strings.replace(#numbers.formatCurrency(b.budget), '¤', '€')}"></td>
</tr>
</th:block>
</tbody>
</table>
</div>
</div>
</div>
</content>
</body>
</html>

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html th:replace="~{template :: layout(~{::title}, ~{::libs}, ~{::header}, ~{::content})}" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
<title>Camp Organizer Business</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<libs> </libs>
</head>
<body>
<header>
<a th:href="@{/}" class="btn btn-secondary btn-icon-silent" title="zur Hauptseite"><i class="fas fa-home"></i></a>
<a th:href="@{/business/}" class="btn btn-secondary btn-icon-silent" title="zur Finanzübersicht"><i class="far fa-money-bill-alt"></i></a>
<a th:href="@{/business/camp/{id}(id=${campId})}" class="btn btn-secondary btn-icon-silent" title="aktualisieren"><i class="fas fa-sync"></i></a>
</header>
<content>
<div class="mainpage">
<div class="container" style="max-width: 100%">
<div class="row">
<div class="col">
<div class="card" style="width: 480px" th:if="${camp != null}">
<div class="card-header">
<span th:text="${camp.name}"></span> von <span th:text="${#numbers.formatInteger(camp.year, 0)}"></span>
</div>
<div class="card-body">
<table class="table">
<tbody>
<tr>
<td>Freizeitname</td>
<th th:text="${camp.name}"></th>
</tr>
<tr>
<td>Zeit</td>
<th><span th:text="${#temporals.format(camp.arrive, 'dd.MM.')}"></span> - <span th:text="${#temporals.format(camp.depart, 'dd.MM.yyyy')}"></span></th>
<tr>
<td>Ort</td>
<th th:text="${camp.locationName}"></th>
</tr>
<tr>
<td>Preis</td>
<th><pre th:utext="${camp.price}"></pre></th>
</tr>
<tr>
<td>bestätigt</td>
<th th:text="${booking.approved}"></th>
</tr>
<tr>
<td>abgelehnt</td>
<th th:text="${booking.rejected}"></th>
</tr>
<tr>
<td>offen</td>
<th th:text="${booking.open}"></th>
</tr>
<tr>
<td>Beiträge</td>
<th th:text="${#strings.replace(#numbers.formatCurrency(booking.paid), '¤', '€')}"></th>
</tbody>
</table>
</div>
</div>
</div>
<div class="col" sec:authorize="hasRole('business_booking')">
<div class="card">
<div class="card-header">Angemeldete Personen</div>
<div class="card-body">
<table id="bookers" class="table">
<thead>
<tr>
<th>Name</th>
<th>Geschlecht</th>
<th>Rolle</th>
<th>Kontostand</th>
<th>Angemeldet</th>
<th>Bestätigt</th>
</tr>
</thead>
<tbody>
<th:block th:each="b : ${bookers}">
<tr>
<td th:text="${b.name}"></td>
<td th:text="${b.sex}"></td>
<td th:text="${b.role}"></td>
<td th:text="${#strings.replace(#numbers.formatCurrency(b.paid), '¤', '€')}"></td>
<td th:text="${#temporals.format(b.bookingDate, 'dd.MM.yyyy')}"></td>
<td th:text="${b.accept == null ? '' : (b.accept ? 'Ja' : 'abgelehnt')}"></td>
</tr>
</th:block>
</tbody>
</table>
<script>
$(document).ready(function() {
$("#bookers").DataTable({
language: locale_de
});
});
</script>
</div>
</div>
</div>
</div>
</div>
<div class="alert alert-danger" role="alert" th:if="${camp == null}">Es wurde keine Freizeit gefunden, die über diese ID angesprochen werden kann.</div>
</div>
</content>
</body>
</html>

View File

@ -0,0 +1,80 @@
<!DOCTYPE html>
<html th:replace="~{template :: layout(~{::title}, ~{::libs}, ~{::header}, ~{::content})}" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
<title>Camp Organizer Business</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<libs>
</libs>
</head>
<body>
<header>
<a th:href="@{/}" class="btn btn-secondary btn-icon-silent" title="zur Hauptseite"><i class="fas fa-home"></i></a>
<a th:href="@{/business/}" class="btn btn-secondary btn-icon-silent" title="zur Finanzübersicht"><i class="far fa-money-bill-alt"></i></a>
<a th:href="@{/business/privileges}" class="btn btn-secondary btn-icon-silent" title="aktualisieren"><i class="fas fa-sync"></i></a>
</header>
<content>
<div class="mainpage">
<div class="card">
<div class="card-header">Nutzerverwaltung für die Abrechnung von Freizeiten</div>
<div class="card-body">
<table id="privs">
<thead>
<tr>
<th scope="col">Freizeit</th>
<th scope="col">Abrechnung darf bearbeiten</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<th:block th:each="e : ${privileges.entrySet()}" sec:authorize="hasRole('admin')">
<tr>
<td><span th:text="${e.value.name}"></span>&nbsp;<span th:text="${#numbers.formatDecimal(e.value.year, 1, 0)}"></span></td>
<td><th:block th:each="p : ${e.value.profiles}">
<div class="dropdown" style="display: inline" th:if="${p.pk != null}">
<button class="btn dropdown-toggle" style="border: 1px solid silver" type="button" th:id="'btn_' + ${e.key} + '_' + ${p.pk}" data-bs-toggle="dropdown" aria-expanded="false">
<span th:text="${p.forename} + ' ' + ${p.surname}"></span>
</button>
<ul class="dropdown-menu" style="background-image: linear-gradient(to bottom right, #defac0, #9ef542) !important;" th:aria-labelledby="'btn_' + ${e.key} + '_' + ${p.pk}">
<li><div style="padding: 8px">
Login: <span th:text="${p.username}"></span>
</div></li>
<li><div style="padding: 8px">
Ablaufdatum: <span th:text="${#temporals.format(p.duedate, 'dd.MM.yyyy')}"></span>
</div></li>
<li><hr class="dropdown-divider" th:if="${p.username != currentUser}"></li>
<li><a class="dropdown-item" th:if="${p.username != currentUser}" th:href="@{/business/privileges/delete?fkCamp={c}&fkProfile={r}(c=${e.key},r=${p.pk})}">Recht entziehen</a></li>
</ul>
</div>
</th:block></td>
<td>
<form action="#" th:action="@{/business/privileges/add?fkCamp={cid}(cid=${e.key})}" th:object="${bean}" method="post">
<span class="btn-group"> <select th:id="${e.value.pk}" class="form-control select2-single" th:field="*{fkProfile}">
<option value="">Auswählen</option>
<th:block th:each="u : ${profiles}">
<option th:if="${u != null}" th:value="${u.pk}" th:text="${u.dropdown()}" />
</th:block>
</select> <input type="submit" style="padding: 4px" value="Recht erteilen">
</span>
<script>
var id = "[[${e.value.pk}]]";
$("#" + id).select2();
</script>
</form>
</td>
</tr>
</th:block>
</tbody>
</table>
<script>
$(document).ready(function() {
$("#privs").DataTable({
language: locale_de
});
});
</script>
</div>
</div>
</div>
</content>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html th:replace="~{template :: layout(~{::title}, ~{::libs}, ~{::header}, ~{::content})}" xmlns:th="http://www.thymeleaf.org" 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" />
<libs></libs>
</head>
<body>
<header>
<a th:href="@{/}" class="btn btn-secondary btn-icon-silent" title="aktualisieren"><i class="fas fa-sync"></i></a>
<a th:href="@{/business}" class="btn btn-secondary btn-icon-silent" title="Abrechnungen"><i class="far fa-money-bill-alt"></i></a>
<span>Das Buchungsportal dess Onkel Werner Freizeiten e.V.</span>
</header>
<content>
<div class="mainpage">
</div>
</content>
</body>
</html>

View File

@ -23,7 +23,7 @@
<b th:inline="text">[[${currentUser}]]</b> aus Version <span th:text="${@manifestBean.getVersion()}"></span> <a th:href="@{/logout}">ausloggen</a>
</span>
<span th:if="${#strings.isEmpty(currentUser)}">
<a th:href="@{/user}">einloggen</a>
<a th:href="@{/dashboard}">einloggen</a>
</span>
</div>
<span th:replace="${header}">Layout header</span>

View File

@ -1,61 +0,0 @@
<!DOCTYPE html>
<html th:replace="~{template :: layout(~{::title}, ~{::libs}, ~{::header}, ~{::content})}" xmlns:th="http://www.thymeleaf.org" 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" />
<libs></libs>
</head>
<body>
<header>
<a th:href="@{/}" class="btn btn-secondary btn-icon-silent" title="aktualisieren"><i class="fas fa-sync"></i></a>
<span>Das Buchungsportal dess Onkel Werner Freizeiten e.V.</span>
</header>
<content>
<div class="mainpage">
<script type="text/javascript">
var mytoggle = new MyToggle();
</script>
<h1>Unsere Freizeiten</h1>
<div class="card bottomdist16" th:each="c : ${camps}">
<div class="card-header mytoggle_btn" th:onclick="mytoggle.toggle('campdiv_[[${c.pk}]]')">
<span th:text="${c.name}"></span>&nbsp;<span th:text="${#numbers.formatInteger(c.year, 0)}" th:if="${c.year != null}"></span>
</div>
<div th:id="'campdiv_' + ${c.pk}" class="card-body mytoggle_collapsed">
<div class="container">
<div class="row">
<div class="col-sm-3">Ort</div>
<div class="col-sm-9">
<a th:href="${c.url}" th:text="${c.locationName}" target="_blank"></a>
</div>
</div>
<div class="row">
<div class="col-sm-3">Jungen und Mädchen</div>
<div class="col-sm-9" th:text="${c.minAge} + ' - ' + ${c.maxAge}"></div>
</div>
<div class="row">
<div class="col-sm-3">Zeit</div>
<div class="col-sm-9">
<span 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>
</div>
<div class="row">
<div class="col-sm-3">Preis</div>
<div class="col-sm-9" th:text="${c.price}"></div>
</div>
<div class="row">
<div class="col-sm-3">Ferien</div>
<div class="col-sm-9" th:text="${c.countries}"></div>
</div>
<div class="row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
<button class="btn btn-primary">jetzt anmelden</button>
</div>
</div>
</div>
</div>
</div>
</div>
</content>
</body>
</html>