From e6e625306dbbb2f1da85f9777de4b06d73b90b11 Mon Sep 17 00:00:00 2001 From: Jottyfan Date: Thu, 26 Jan 2023 20:39:26 +0100 Subject: [PATCH] https://gitlab.com/jottyfan/camporganizer2/-/issues/38 --- build.gradle | 2 +- .../registration/RegistrationController.java | 7 +++++ .../registration/RegistrationGateway.java | 26 ++++++++++++++++--- .../registration/RegistrationService.java | 4 +++ .../resources/static/css/style_static.css | 5 ++-- src/main/resources/static/freizeiten.html | 4 +-- src/main/resources/static/index.html | 5 ++-- src/main/resources/static/welcome.html | 2 +- src/main/resources/templates/camplist.html | 2 +- src/main/resources/templates/dashboard.html | 6 +++-- 10 files changed, 47 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 03d38e1..ebf876f 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'war' apply plugin: 'application' group = 'de.jottyfan.camporganizer' -version = '0.2.7' +version = '0.2.8' sourceCompatibility = 17 mainClassName = "de.jottyfan.camporganizer.Main" diff --git a/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationController.java b/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationController.java index 3ac70cd..553b12b 100644 --- a/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationController.java +++ b/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationController.java @@ -69,4 +69,11 @@ public class RegistrationController extends CommonController { service.removeBooking(id); return "redirect:/dashboard"; } + + @GetMapping("/registration/toggleconsent/{id}") + public String toggleConsent(@PathVariable Integer id, final Model model) { + super.setupSession(model, request); + service.toggleConsent(id); + return "redirect:/dashboard"; + } } diff --git a/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationGateway.java b/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationGateway.java index 7d1e5d0..389c584 100644 --- a/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationGateway.java +++ b/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationGateway.java @@ -177,7 +177,7 @@ public class RegistrationGateway { // register the person for camp participation InsertValuesStep13 sql2 = DSL .using(t) - // @formatter:off + // @formatter:off .insertInto(T_PERSON, T_PERSON.FORENAME, T_PERSON.SURNAME, @@ -295,7 +295,8 @@ public class RegistrationGateway { rssMessage.append(" hat die Buchung von "); rssMessage.append(forename).append(" ").append(surname); rssMessage.append(" an "); - rssMessage.append(campname).append(" ").append(arrive == null ? "" : arrive.format(DateTimeFormatter.ofPattern("YYYY"))); + rssMessage.append(campname).append(" ") + .append(arrive == null ? "" : arrive.format(DateTimeFormatter.ofPattern("YYYY"))); rssMessage.append(" storniert."); DeleteConditionStep sql1 = DSL.using(t).deleteFrom(T_PERSONDOCUMENT) @@ -345,8 +346,7 @@ public class RegistrationGateway { /** * remove login * - * @param bean - * containing username of dataset to be removed + * @param bean containing username of dataset to be removed * @throws DataAccessExceptionF */ public void removeLogin(ProfileBean bean) throws DataAccessException { @@ -392,4 +392,22 @@ public class RegistrationGateway { sql3.execute(); }); } + + /** + * toggle the consent for photo + * + * @param id the ID of the person + */ + public void toggleConsent(Integer id) { + Boolean consent = jooq.selectFrom(T_PERSON).where(T_PERSON.PK.eq(id)).fetchOne().getConsentCatalogPhoto(); + consent = consent == null ? true : !consent; + UpdateConditionStep sql = jooq + // @formatter:off + .update(T_PERSON) + .set(T_PERSON.CONSENT_CATALOG_PHOTO, consent) + .where(T_PERSON.PK.eq(id)); + // @formatter:on + LOGGER.debug("{}", sql.toString()); + sql.execute(); + } } diff --git a/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationService.java b/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationService.java index 1546dc2..3823601 100644 --- a/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationService.java +++ b/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationService.java @@ -78,4 +78,8 @@ public class RegistrationService { public Boolean removeBooking(Integer id) { return gateway.removeBooking(id) > 0; } + + public void toggleConsent(Integer id) { + gateway.toggleConsent(id); + } } diff --git a/src/main/resources/static/css/style_static.css b/src/main/resources/static/css/style_static.css index ed21f50..5653521 100644 --- a/src/main/resources/static/css/style_static.css +++ b/src/main/resources/static/css/style_static.css @@ -65,7 +65,7 @@ .lightmode-textcolor:hover { color: rgb(222, 221, 218) !important; -} +} .text-light { text-decoration: none; @@ -76,7 +76,7 @@ } .leftimage { - margin-right: 32px; + margin-right: 32px; } .rightimage { @@ -122,6 +122,7 @@ html { body { font-family: Monserrat, sans-serif; + background-image: url('../images/background.jpg'); } a { diff --git a/src/main/resources/static/freizeiten.html b/src/main/resources/static/freizeiten.html index 9c6633b..0d9b051 100644 --- a/src/main/resources/static/freizeiten.html +++ b/src/main/resources/static/freizeiten.html @@ -24,7 +24,7 @@ Preise, Termine und weitere Infos findest du in unserem Buchungsportal.

- Jetzt Freizeiten entdecken + Jetzt Freizeiten entdecken

Kinderfreizeiten in Olfen

Jede Menge Kinder in deinem Alter, viele coole Spiele, Sommerrodeln und spannende biblische Geschichten…

@@ -133,6 +133,6 @@ Preise, Termine und weitere Infos findest du in unserem Buchungsportal.

- Jetzt Freizeiten entdecken + Jetzt Freizeiten entdecken

\ No newline at end of file diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 9e3c058..8a22d89 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -16,7 +16,7 @@ diff --git a/src/main/resources/static/welcome.html b/src/main/resources/static/welcome.html index cebf238..74c79ca 100644 --- a/src/main/resources/static/welcome.html +++ b/src/main/resources/static/welcome.html @@ -10,6 +10,6 @@

Erfahre hier, welche Freizeiten wir anbieten und was da so abgeht.

Preise, Termine und weitere Infos findest du in unserem Buchungsportal.

- Jetzt Freizeiten entdecken + Jetzt Freizeiten entdecken

diff --git a/src/main/resources/templates/camplist.html b/src/main/resources/templates/camplist.html index 8387954..b65c67b 100644 --- a/src/main/resources/templates/camplist.html +++ b/src/main/resources/templates/camplist.html @@ -11,7 +11,7 @@ diff --git a/src/main/resources/templates/dashboard.html b/src/main/resources/templates/dashboard.html index 66d2003..d537be8 100644 --- a/src/main/resources/templates/dashboard.html +++ b/src/main/resources/templates/dashboard.html @@ -181,8 +181,10 @@
-
Foto-Einverständnis:
- +
Foto-Einverständnis:  + + +
Kommentar: