fixed bug in navigation
This commit is contained in:
@@ -8,7 +8,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = 'de.jottyfan.camporganizer'
|
group = 'de.jottyfan.camporganizer'
|
||||||
version = '0.9.8'
|
version = '0.9.9'
|
||||||
|
|
||||||
description = """CampOrganizer2"""
|
description = """CampOrganizer2"""
|
||||||
|
|
||||||
@@ -27,6 +27,10 @@ repositories {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
options.compilerArgs.add("-parameters")
|
||||||
|
}
|
||||||
|
|
||||||
war {
|
war {
|
||||||
doFirst {
|
doFirst {
|
||||||
manifest {
|
manifest {
|
||||||
|
@@ -33,11 +33,12 @@ public class BookingsController extends CommonController {
|
|||||||
|
|
||||||
@GetMapping("/business/bookings/{year}")
|
@GetMapping("/business/bookings/{year}")
|
||||||
@RolesAllowed({"business_booking"})
|
@RolesAllowed({"business_booking"})
|
||||||
public String getBookings(Model model, @Nullable @PathVariable("year") Integer year) {
|
public String getBookings(Model model, @Nullable @PathVariable("year") Integer year, @RequestParam(name = "search", defaultValue = "") String search) {
|
||||||
model.addAttribute("bookers", bookingsService.getBookers(getCurrentUser(), year));
|
model.addAttribute("bookers", bookingsService.getBookers(getCurrentUser(), year));
|
||||||
model.addAttribute("addBean", new AddPaymentBean());
|
model.addAttribute("addBean", new AddPaymentBean());
|
||||||
model.addAttribute("year", LocalDate.now().getYear());
|
model.addAttribute("year", year == null ? LocalDate.now().getYear() : year);
|
||||||
model.addAttribute("years", bookingsService.getAllCampYears());
|
model.addAttribute("years", bookingsService.getAllCampYears());
|
||||||
|
model.addAttribute("search", search);
|
||||||
return "business/bookings";
|
return "business/bookings";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,12 +48,12 @@ public class BookingsController extends CommonController {
|
|||||||
BookerBean bean = bookingsService.getBooker(id, getCurrentUser());
|
BookerBean bean = bookingsService.getBooker(id, getCurrentUser());
|
||||||
model.addAttribute("booker", bean);
|
model.addAttribute("booker", bean);
|
||||||
model.addAttribute("addBean", new AddPaymentBean());
|
model.addAttribute("addBean", new AddPaymentBean());
|
||||||
return bean == null ? getBookings(model, LocalDate.now().getYear()) : "business/booker";
|
return bean == null ? getBookings(model, LocalDate.now().getYear(), null) : "business/booker";
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/business/bookings/payment/{id}")
|
@PostMapping("/business/bookings/payment/{id}")
|
||||||
@RolesAllowed({"business_booking"})
|
@RolesAllowed({"business_booking"})
|
||||||
public String addPayment(Model model, @ModelAttribute("bean") AddPaymentBean bean, @PathVariable("id") Integer id) {
|
public String addPayment(Model model, @ModelAttribute("bean") AddPaymentBean bean, @PathVariable(name = "id") Integer id) {
|
||||||
Double payment = bean.getPayment();
|
Double payment = bean.getPayment();
|
||||||
bookingsService.addPayment(id, payment);
|
bookingsService.addPayment(id, payment);
|
||||||
return getBooking(model, id);
|
return getBooking(model, id);
|
||||||
@@ -60,11 +61,11 @@ public class BookingsController extends CommonController {
|
|||||||
|
|
||||||
@PostMapping("/business/bookings/listpayment/{id}/{year}")
|
@PostMapping("/business/bookings/listpayment/{id}/{year}")
|
||||||
@RolesAllowed({"business_booking"})
|
@RolesAllowed({"business_booking"})
|
||||||
public String addListPayment(Model model, @ModelAttribute("bean") AddPaymentBean bean, @PathVariable("id") Integer id, @PathVariable("year") Integer year, @RequestParam(defaultValue = "") String search) {
|
public String addListPayment(Model model, @ModelAttribute("bean") AddPaymentBean bean, @PathVariable(name = "id") Integer id, @PathVariable(name = "year") Integer year, @RequestParam(name = "search", defaultValue = "") String search) {
|
||||||
Double payment = bean.getPayment();
|
Double payment = bean.getPayment();
|
||||||
bookingsService.addPayment(id, payment);
|
bookingsService.addPayment(id, payment);
|
||||||
LOGGER.debug("search is {}", search);
|
LOGGER.debug("search is {}", search);
|
||||||
model.addAttribute("search", search);
|
model.addAttribute("search", search);
|
||||||
return getBookings(model, year);
|
return "redirect:/business/bookings/" + year + "?search=" + search;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
<td class="middled" th:text="${b.camp}"></td>
|
<td class="middled" th:text="${b.camp}"></td>
|
||||||
<td class="middled" th:text="${b.role}"></td>
|
<td class="middled" th:text="${b.role}"></td>
|
||||||
<td class="middled">
|
<td class="middled">
|
||||||
<form action="#" th:action="@{'/business/bookings/listpayment/{id}/{year}(id=${b.pk},year=${year})'}" th:object="${addBean}" method="post">
|
<form action="#" th:action="@{/business/bookings/listpayment/{id}/{year}(id=${b.pk},year=${year})}" th:object="${addBean}" method="post">
|
||||||
<input th:id="'searchfield' + ${b.pk}" type="hidden" th:name="search" />
|
<input th:id="'searchfield' + ${b.pk}" type="hidden" th:name="search" />
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
Reference in New Issue
Block a user