small changes

This commit is contained in:
Jottyfan 2022-10-09 09:55:12 +02:00
parent 92cb571ca3
commit 3b33368374
4 changed files with 12 additions and 9 deletions

View File

@ -18,7 +18,7 @@ apply plugin: 'war'
apply plugin: 'application' apply plugin: 'application'
group = 'de.jottyfan.camporganizer' group = 'de.jottyfan.camporganizer'
version = '0.0.1' version = '0.0.2'
sourceCompatibility = 17 sourceCompatibility = 17
mainClassName = "de.jottyfan.camporganizer.Main" mainClassName = "de.jottyfan.camporganizer.Main"

View File

@ -38,6 +38,7 @@ public class BookingsController {
String username = indexService.getCurrentUser(request); String username = indexService.getCurrentUser(request);
model.addAttribute("currentUser", username); model.addAttribute("currentUser", username);
model.addAttribute("bookers", bookingsService.getBookers(username)); model.addAttribute("bookers", bookingsService.getBookers(username));
model.addAttribute("addBean", new AddPaymentBean());
return "business/bookings"; return "business/bookings";
} }
@ -57,6 +58,6 @@ public class BookingsController {
public String addBooking(Model model, @ModelAttribute AddPaymentBean bean, @PathVariable Integer id) { public String addBooking(Model model, @ModelAttribute AddPaymentBean bean, @PathVariable Integer id) {
Double payment = bean.getPayment(); Double payment = bean.getPayment();
bookingsService.addPayment(id, payment); bookingsService.addPayment(id, payment);
return getBooking(model, id); return getBookings(model);
} }
} }

View File

@ -7,9 +7,9 @@
</head> </head>
<body> <body>
<header> <header>
<a th:href="@{/}" class="btn btn-secondary btn-icon-silent" title="zur Hauptseite"><i class="fas fa-home"></i></a> <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"
<a th:href="@{/business/}" class="btn btn-secondary btn-icon-silent" title="zur Finanzübersicht"><i class="far fa-money-bill-alt"></i></a> 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
<a th:href="@{/business/bookings}" class="btn btn-secondary btn-icon-silent" title="aktualisieren"><i class="fas fa-sync"></i></a> class="fas fa-sync"></i></a>
</header> </header>
<content> <content>
<div class="mainpage"> <div class="mainpage">
@ -31,12 +31,14 @@
<tbody> <tbody>
<th:block th:each="b : ${bookers}"> <th:block th:each="b : ${bookers}">
<tr> <tr>
<td th:text="${b.name}"></td> <td><a class="btn btn-icon-silent" th:href="@{/business/bookings/{id}(id=${b.pk})}" title="bearbeiten" th:text="${b.name}"></a></td>
<td th:text="${b.sex}"></td> <td th:text="${b.sex}"></td>
<td th:text="${b.camp}"></td> <td th:text="${b.camp}"></td>
<td th:text="${b.role}"></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})}" <td><span th:text="${#strings.replace(#numbers.formatCurrency(b.paid), '¤', '€')}"></span>
title="bearbeiten"><i class="fas fa-edit"></i></a></td> <form action="#" th:action="@{'/business/bookings/payment/' + ${b.pk}}" th:object="${addBean}" method="post">
<input type="number" step="0.01" th:field="*{payment}"> <input type="submit" style="padding: 4px" value="einzahlen">
</form></td>
<td th:text="${#temporals.format(b.bookingDate, 'dd.MM.yyyy')}"></td> <td th:text="${#temporals.format(b.bookingDate, 'dd.MM.yyyy')}"></td>
<td th:text="${b.accept == null ? '' : (b.accept ? 'Ja' : 'abgelehnt')}"></td> <td th:text="${b.accept == null ? '' : (b.accept ? 'Ja' : 'abgelehnt')}"></td>
</tr> </tr>

View File

@ -76,7 +76,7 @@
<tbody> <tbody>
<th:block th:each="b : ${bookers}"> <th:block th:each="b : ${bookers}">
<tr> <tr>
<td th:text="${b.name}"></td> <td><a class="btn btn-icon-silent" th:href="@{/business/bookings/{id}(id=${b.pk})}" title="bearbeiten" th:text="${b.name}"></a></td>
<td th:text="${b.sex}"></td> <td th:text="${b.sex}"></td>
<td th:text="${b.role}"></td> <td th:text="${b.role}"></td>
<td th:text="${#strings.replace(#numbers.formatCurrency(b.paid), '¤', '€')}"></td> <td th:text="${#strings.replace(#numbers.formatCurrency(b.paid), '¤', '€')}"></td>