diff --git a/.classpath b/.classpath index f3bdce0..607b789 100644 --- a/.classpath +++ b/.classpath @@ -12,6 +12,13 @@ + + + + + + + diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs index e479558..e889521 100644 --- a/.settings/org.eclipse.buildship.core.prefs +++ b/.settings/org.eclipse.buildship.core.prefs @@ -1,13 +1,2 @@ -arguments= -auto.sync=false -build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) connection.project.dir= eclipse.preferences.version=1 -gradle.user.home= -java.home= -jvm.arguments= -offline.mode=false -override.workspace.settings=false -show.console.view=false -show.executions.view=false diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index a2ed0c0..59fc2ab 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,7 +1,7 @@ - - + + diff --git a/build.gradle b/build.gradle index fd0dd89..35fe182 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ dependencies { implementation 'net.sf.biweekly:biweekly:0.6.6' implementation 'org.keycloak:keycloak-spring-boot-starter' - + // backward compatibility until the complete registration is converted to keycloak implementation 'org.jasypt:jasypt:1.9.3' @@ -64,6 +64,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5' implementation 'de.jottyfan:COJooq:2021.02' + implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.0.0' runtimeOnly 'org.springframework.boot:spring-boot-starter-tomcat' testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' diff --git a/src/main/java/de/jottyfan/camporganizer/module/common/IndexController.java b/src/main/java/de/jottyfan/camporganizer/module/common/IndexController.java index 3235d25..4110031 100644 --- a/src/main/java/de/jottyfan/camporganizer/module/common/IndexController.java +++ b/src/main/java/de/jottyfan/camporganizer/module/common/IndexController.java @@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; +import de.jottyfan.camporganizer.module.registration.KeycloakRepository; + /** * * @author jotty @@ -24,6 +26,9 @@ public class IndexController extends CommonController { @Autowired private HttpServletRequest request; + @Autowired + private KeycloakRepository keycloak; + @Autowired private IndexService service; @@ -39,6 +44,7 @@ public class IndexController extends CommonController { super.setupSession(model, request); model.addAttribute("mybookings", service.getBookingsOf(super.getCurrentUser(request))); model.addAttribute("bookingBean", new BookingBean()); + model.addAttribute("keycloakProfileUrl", keycloak.getUserClientUrl()); return "/dashboard"; } diff --git a/src/main/java/de/jottyfan/camporganizer/module/registration/KeycloakRepository.java b/src/main/java/de/jottyfan/camporganizer/module/registration/KeycloakRepository.java index 46ab108..a6e35f5 100644 --- a/src/main/java/de/jottyfan/camporganizer/module/registration/KeycloakRepository.java +++ b/src/main/java/de/jottyfan/camporganizer/module/registration/KeycloakRepository.java @@ -6,7 +6,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Repository; /** - * + * * @author henkej * */ @@ -16,23 +16,35 @@ public class KeycloakRepository { @Value("${keycloak.resource:biblecamp}") private String keycloakClientId; - + @Value("${keycloak.auth-server-url}") private String keycloakUrl; - + @Value("${keycloak.realm:ow}") private String keycloakRealm; - + + /** + * get the url of the user client + * + * @return the url of the user client + */ + public String getUserClientUrl() { + String url = keycloakUrl == null ? null + : (keycloakUrl.substring(0, keycloakUrl.length() - (keycloakUrl.endsWith("/") ? 1 : 0))); + return String.format("%s/realms/%s/account/", url, keycloakRealm); + } + /** * register the login in keycloak - * + * * @param login * @param password */ public void register(String login, String password) { // TODO: check for trailing and leading / String registrationUrl = String.format("%s/admin/realms/%s/users", keycloakUrl, keycloakRealm); - // see https://www.keycloak.org/docs-api/17.0/rest-api/index.html#_users_resource + // see + // https://www.keycloak.org/docs-api/17.0/rest-api/index.html#_users_resource // https://canada1.discourse-cdn.com/free1/uploads/keycloak/original/2X/3/379bbfe8857de117771149174a96e4216ebe9c76.png // TODO Auto-generated method stub LOGGER.error("not yet implemented registration of user {} in keycloak", login); diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 7025123..c309cff 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -96,6 +96,22 @@ div { /* 60 px is the current height of the headline; TODO: calculate it */ } +.acc_true { + background-image: linear-gradient(to bottom right, #cfc, #afa) !important; +} + +.acc_false { + background-image: linear-gradient(to bottom right, #fcc, #faa) !important; +} + +.acc_null { + background-image: linear-gradient(to bottom right, #fdb, #fca) !important; +} + +.right-dist { + margin-right: 28px; +} + .middlecenter { margin: auto; top: 40vh; diff --git a/src/main/resources/templates/business/booker.html b/src/main/resources/templates/business/booker.html index f1e5dcc..97b37ce 100644 --- a/src/main/resources/templates/business/booker.html +++ b/src/main/resources/templates/business/booker.html @@ -1,89 +1,94 @@ - + Camp Organizer Business - -
- Hauptseite - Finanzübersicht - Buchungsübersicht -
- -
-
-
-
-
-
Angemeldete Person
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Name
Geschlecht
Freizeit
Rolle
Angemeldet
Bestätigt
Preis -
Kontostand -
+ + + + + + +
+
+
+
+
+
Angemeldete Person
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name
Geschlecht
Freizeit
Rolle
Angemeldet
Bestätigt
Preis +
Kontostand +
+
-
-
-
-
Einzahlung
-
- -
-
-
-
- -
-
- +
+
+
Einzahlung
+
+ + +
+
+
+ +
+
+ +
-
- + +
-
- + \ No newline at end of file diff --git a/src/main/resources/templates/business/bookings.html b/src/main/resources/templates/business/bookings.html index 1d1b7bc..b9a842d 100644 --- a/src/main/resources/templates/business/bookings.html +++ b/src/main/resources/templates/business/bookings.html @@ -1,84 +1,87 @@ - + Camp Organizer Business - -
- Hauptseite - Finanzübersicht -
- -
-
-
Angemeldete Personen
-
- - - - - - - - - - - - - - + + + + + +
+
+
Angemeldete Personen
+
+
NameGeschlechtFreizeitRolleKontostandAngemeldetBestätigt
+ - - - - - + + + + + + + + + + + + + + + + - - - - - -
-
- -
-
-
- -
-
- -
-
- +
NameGeschlechtFreizeitRolleKontostandAngemeldetBestätigt
+ + +
+
+
+ +
+
+ +
+
+ +
- - -
- + function setSearchField(x) { + $("#searchfield" + x).val($("#bookers").DataTable().search()); + } + /*]]>*/ + +
-
- + \ No newline at end of file diff --git a/src/main/resources/templates/business/business.html b/src/main/resources/templates/business/business.html index be154b1..3b2bfc3 100644 --- a/src/main/resources/templates/business/business.html +++ b/src/main/resources/templates/business/business.html @@ -1,49 +1,54 @@ - + Camp Organizer Business - -
- Hauptseite - Buchungsübersicht - Nutzerverwaltung -
- -
-
-
Finanzübersicht über alle Freizeiten
-
- - - - - - - - - - + + + + + + +
+
+
Finanzübersicht über alle Freizeiten
+
+
JahrFreizeitKontostand
+ - - - + + + - - -
JahrFreizeitKontostand
- + +
-
- + \ No newline at end of file diff --git a/src/main/resources/templates/business/camp.html b/src/main/resources/templates/business/camp.html index 3a4cb8e..b141487 100644 --- a/src/main/resources/templates/business/camp.html +++ b/src/main/resources/templates/business/camp.html @@ -1,104 +1,107 @@ - + Camp Organizer Business - -
- Hauptseite - Finanzübersicht -
- -
-
-
-
-
-
- von -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Freizeitname
Zeit -
Ort
Preis
bestätigt
abgelehnt
offen
Beiträge
+ + + + + +
+
+
+
+
+
+ von +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Freizeitname
Zeit -
Ort
Preis
bestätigt
abgelehnt
offen
Beiträge
+
-
-
-
-
Angemeldete Personen
-
- - - - - - - - - - - - - +
+
+
Angemeldete Personen
+
+
NameGeschlechtRolleKontostandAngemeldetBestätigt
+ - - - - - - + + + + + + - - -
NameGeschlechtRolleKontostandAngemeldetBestätigt
- + +
+
- -
- + \ No newline at end of file diff --git a/src/main/resources/templates/business/privileges.html b/src/main/resources/templates/business/privileges.html index 15db0a9..265b4a7 100644 --- a/src/main/resources/templates/business/privileges.html +++ b/src/main/resources/templates/business/privileges.html @@ -1,90 +1,92 @@ - + Camp Organizer Business - - -
- Hauptseite - Finanzübersicht -
- -
-
-
Nutzerverwaltung für die Abrechnung von Freizeiten
-
- - - - - - - - - - + + + + + +
+
+
Nutzerverwaltung für die Abrechnung von Freizeiten
+
+
FreizeitAbrechnung darf bearbeiten
+ - - - + + + + + + + + + + - - - -
  - - -
-
-
-
- -
-
- +
FreizeitAbrechnung darf bearbeiten
  + + + +
+
+
+ +
+
+ +
- - - -
- + + + + + + + + +
-
- + \ No newline at end of file diff --git a/src/main/resources/templates/confirmation/confirmation.html b/src/main/resources/templates/confirmation/confirmation.html index 677d515..6ad8473 100644 --- a/src/main/resources/templates/confirmation/confirmation.html +++ b/src/main/resources/templates/confirmation/confirmation.html @@ -1,16 +1,16 @@ - + Camp Organizer Confirmation - -
- Hauptseite -
- -
+ + + +

@@ -160,21 +160,19 @@

- Die Suche ist eine einfache Textsuche. Bestenfalls sollte nur ein Begriff zum Suchen verwendet werden, also z.B. nur der Vor- ODER der Nachname, nicht beides.
- Es werden nur wenige Felder in der Datenbank durchsucht: Vorname, Nachname, Freizeitname und Freizeitjahr.
- Die Suche wird nach dem Verlassen des Suchtext-Eingabefeldes aktiviert. + Die Suche ist eine einfache Textsuche. Bestenfalls sollte nur ein Begriff zum Suchen verwendet werden, also z.B. nur der Vor- ODER der Nachname, nicht beides.
Es werden nur wenige + Felder in der Datenbank durchsucht: Vorname, Nachname, Freizeitname und Freizeitjahr.
Die Suche wird nach dem Verlassen des Suchtext-Eingabefeldes aktiviert.
-
-
+ \ No newline at end of file diff --git a/src/main/resources/templates/confirmation/person.html b/src/main/resources/templates/confirmation/person.html index efbb123..4fd2f68 100644 --- a/src/main/resources/templates/confirmation/person.html +++ b/src/main/resources/templates/confirmation/person.html @@ -1,137 +1,138 @@ - + Camp Organizer Confirmation - -
- Hauptseite - Anmeldungen -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
-

-					
-
-
- -
-
- - - - - - + + + + + +
+
+ +
+ +
+
-
-
- -
- - Abbrechen +
+ +
+ +
-
- -
In der Datenbank wurde keine Person mit entsprechender ID gefunden.
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+

+						
+
+
+ +
+
+ +
+
+
+
+ +
+ + Abbrechen +
+
+ +
In der Datenbank wurde keine Person mit entsprechender ID gefunden.
+
-
- + \ No newline at end of file diff --git a/src/main/resources/templates/dashboard.html b/src/main/resources/templates/dashboard.html index 5bef3d0..7a087b7 100644 --- a/src/main/resources/templates/dashboard.html +++ b/src/main/resources/templates/dashboard.html @@ -1,140 +1,145 @@ - + Camp Organizer 2 - -
- Profil - Abrechnung - Bestätigung - Nextcloud -
- -
- -
-
-

- -

-
-
-
-
Freizeitdaten
-
-
-
-
Ort:
-
- + + + + + + + +
+ +
+
+

+ +

+
+
+
+
Freizeitdaten
+
+
+
+
Ort:
+
+ +
+
Zeit:
+
+ +
+
Preis:
+
+
Ferien:
+
-
Zeit:
-
- -
-
Preis:
-
-
Ferien:
-
-
-
-
Teilnehmerdaten
-
-
- -
-
-
Rolle:
- Mitarbeiter Teilnehmer Leiter Küchenteam - -
-
-
Geschlecht:
- - männlich - weiblich - - -
-
-
Vorname:
- -
-
-
Nachname:
- -
-
-
Straße:
- -
-
-
PLZ:
- -
-
-
Ort:
- -
-
-
Telefon:
- -
-
-
Geburtstag:
- -
-
-
E-Mail:
- -
-
-
Foto-Einverständnis:
- -
-
-
Kommentar:
- -
-
-
-
- +
+
Teilnehmerdaten
+
+ + +
+
+
Rolle:
+ Mitarbeiter Teilnehmer Leiter Küchenteam + +
+
+
Geschlecht:
+ männlich weiblich + +
+
+
Vorname:
+ +
+
+
Nachname:
+ +
+
+
Straße:
+ +
+
+
PLZ:
+ +
+
+
Ort:
+ +
+
+
Telefon:
+ +
+
+
Geburtstag:
+ +
+
+
E-Mail:
+ +
+
+
Foto-Einverständnis:
+ +
+
+
Kommentar:
+ +
+
+
+
+ +
-
- + +
+
+ angemeldet am von +
+
+ von +
+
Die Freizeit ist bereits vorbei.
-
- angemeldet am von -
-
- von -
-
Die Freizeit ist bereits vorbei.
-
- + \ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 7fa5ff3..fa2c081 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -1,16 +1,23 @@ - + Camp Organizer 2 - -
- - Unsere Freizeiten -
- + + + + +
- + -
-
- [[${currentUser}]] ausloggen - einloggen - +
-
Layout content
+ +
Layout content