From bc7cd88c2fd081f341ef12ebfdb2ec0d2adf5f26 Mon Sep 17 00:00:00 2001 From: Jottyfan Date: Sun, 19 Mar 2023 21:54:53 +0100 Subject: [PATCH] make menu of registered roles more convenient, due to #36 --- build.gradle | 2 +- .../module/admin/AdminController.java | 17 ++------ .../resources/templates/admin/document.html | 11 ----- .../templates/admin/document_edit.html | 14 ------- .../resources/templates/admin/location.html | 11 ----- .../templates/admin/location_edit.html | 14 ------- src/main/resources/templates/admin/mail.html | 8 ---- src/main/resources/templates/admin/main.html | 31 -------------- .../resources/templates/business/booker.html | 11 ----- .../templates/business/bookings.html | 8 ---- .../templates/business/business.html | 11 ----- .../resources/templates/business/camp.html | 8 ---- .../templates/business/privileges.html | 8 ---- .../templates/confirmation/confirmation.html | 8 ---- .../templates/confirmation/person.html | 8 ---- src/main/resources/templates/template.html | 40 ++++++++++++++++++- 16 files changed, 43 insertions(+), 167 deletions(-) delete mode 100644 src/main/resources/templates/admin/main.html diff --git a/build.gradle b/build.gradle index 7532e2e..baae4ea 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'war' apply plugin: 'application' group = 'de.jottyfan.camporganizer' -version = '0.3.5' +version = '0.3.6' sourceCompatibility = 17 mainClassName = "de.jottyfan.camporganizer.Main" diff --git a/src/main/java/de/jottyfan/camporganizer/module/admin/AdminController.java b/src/main/java/de/jottyfan/camporganizer/module/admin/AdminController.java index 61f611e..f3f7f8d 100644 --- a/src/main/java/de/jottyfan/camporganizer/module/admin/AdminController.java +++ b/src/main/java/de/jottyfan/camporganizer/module/admin/AdminController.java @@ -35,17 +35,6 @@ public class AdminController extends CommonController { @Value("${spring.mail.username}") private String from; - @GetMapping("/admin") - public String getMain(Model model, HttpServletRequest request) { - super.setupSession(model, request); - return "/admin/main"; - } - - @GetMapping("/admin/main") - public String getMainDirectly() { - return "redirect:/admin/main"; - } - @GetMapping("/admin/mail") public String getMail(Model model, HttpServletRequest request) { super.setupSession(model, request); @@ -66,7 +55,7 @@ public class AdminController extends CommonController { return "/admin/mail"; } service.sendMail(bean); - return "redirect:/admin"; + return "redirect:/admin/mail"; } @GetMapping("/admin/document") @@ -138,8 +127,10 @@ public class AdminController extends CommonController { final BindingResult bindingResult, Model model, HttpServletRequest request) { super.setupSession(model, request); if (bindingResult.hasErrors()) { - for (ObjectError error : bindingResult.getAllErrors()) + for (ObjectError error : bindingResult.getAllErrors()) { LOGGER.error("error {}: {}", error.getCode(), error.getDefaultMessage()); + } + model.addAttribute("documents", service.getLocationDocuments()); return "/admin/location_edit"; } service.upsertLocation(bean); diff --git a/src/main/resources/templates/admin/document.html b/src/main/resources/templates/admin/document.html index 4dd6be4..233669e 100644 --- a/src/main/resources/templates/admin/document.html +++ b/src/main/resources/templates/admin/document.html @@ -1,17 +1,6 @@ - - - - -
diff --git a/src/main/resources/templates/admin/document_edit.html b/src/main/resources/templates/admin/document_edit.html index 9ac32fa..b827d33 100644 --- a/src/main/resources/templates/admin/document_edit.html +++ b/src/main/resources/templates/admin/document_edit.html @@ -1,20 +1,6 @@ - - - - - -
diff --git a/src/main/resources/templates/admin/location.html b/src/main/resources/templates/admin/location.html index 158f947..91a6539 100644 --- a/src/main/resources/templates/admin/location.html +++ b/src/main/resources/templates/admin/location.html @@ -1,17 +1,6 @@ - - - - -
diff --git a/src/main/resources/templates/admin/location_edit.html b/src/main/resources/templates/admin/location_edit.html index 3112494..3222296 100644 --- a/src/main/resources/templates/admin/location_edit.html +++ b/src/main/resources/templates/admin/location_edit.html @@ -1,20 +1,6 @@ - - - - - -
diff --git a/src/main/resources/templates/admin/mail.html b/src/main/resources/templates/admin/mail.html index 43c4e19..8dc1fb9 100644 --- a/src/main/resources/templates/admin/mail.html +++ b/src/main/resources/templates/admin/mail.html @@ -5,14 +5,6 @@ - - - -
diff --git a/src/main/resources/templates/admin/main.html b/src/main/resources/templates/admin/main.html deleted file mode 100644 index faad95d..0000000 --- a/src/main/resources/templates/admin/main.html +++ /dev/null @@ -1,31 +0,0 @@ - - - -Camp Organizer Confirmation - - - - - - - - - - - -
- TODO: implement; list number of camps, registrations and documents or such -
-
- - \ No newline at end of file diff --git a/src/main/resources/templates/business/booker.html b/src/main/resources/templates/business/booker.html index daa0542..7d3afae 100644 --- a/src/main/resources/templates/business/booker.html +++ b/src/main/resources/templates/business/booker.html @@ -5,17 +5,6 @@ - - - - -
diff --git a/src/main/resources/templates/business/bookings.html b/src/main/resources/templates/business/bookings.html index 55319e5..c69dd28 100644 --- a/src/main/resources/templates/business/bookings.html +++ b/src/main/resources/templates/business/bookings.html @@ -5,14 +5,6 @@ - - - -
diff --git a/src/main/resources/templates/business/business.html b/src/main/resources/templates/business/business.html index a32c281..8b4d8c1 100644 --- a/src/main/resources/templates/business/business.html +++ b/src/main/resources/templates/business/business.html @@ -5,17 +5,6 @@ - - - - -
diff --git a/src/main/resources/templates/business/camp.html b/src/main/resources/templates/business/camp.html index 6e7663b..9355840 100644 --- a/src/main/resources/templates/business/camp.html +++ b/src/main/resources/templates/business/camp.html @@ -5,14 +5,6 @@ - - - -
diff --git a/src/main/resources/templates/business/privileges.html b/src/main/resources/templates/business/privileges.html index 219591a..8e3976b 100644 --- a/src/main/resources/templates/business/privileges.html +++ b/src/main/resources/templates/business/privileges.html @@ -5,14 +5,6 @@ - - - -
diff --git a/src/main/resources/templates/confirmation/confirmation.html b/src/main/resources/templates/confirmation/confirmation.html index 5da56ee..8b12341 100644 --- a/src/main/resources/templates/confirmation/confirmation.html +++ b/src/main/resources/templates/confirmation/confirmation.html @@ -5,14 +5,6 @@ - - - -
diff --git a/src/main/resources/templates/confirmation/person.html b/src/main/resources/templates/confirmation/person.html index 09ced65..06d3996 100644 --- a/src/main/resources/templates/confirmation/person.html +++ b/src/main/resources/templates/confirmation/person.html @@ -5,14 +5,6 @@ - - - -
diff --git a/src/main/resources/templates/template.html b/src/main/resources/templates/template.html index 18d20cc..dfc7fff 100644 --- a/src/main/resources/templates/template.html +++ b/src/main/resources/templates/template.html @@ -86,10 +86,46 @@ +