From 3726b9172c46b97954dfec57441e2194a6ef1bf8 Mon Sep 17 00:00:00 2001 From: Jottyfan Date: Sun, 14 Dec 2025 17:39:19 +0100 Subject: [PATCH] added support for youth group --- build.gradle | 25 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../bico/modules/CommonController.java | 16 +- .../camp/AdminRegistrationController.java | 51 --- .../camp/AdminRegistrationService.java | 33 -- .../modules/camp/RegistrationController.java | 77 ----- .../modules/camp/RegistrationRepository.java | 222 ------------ .../modules/camp/RegistrationService.java | 72 ---- .../modules/camp/model/RegistrationBean.java | 320 ------------------ .../modules/download/DownloadRepository.java | 4 +- .../bico/modules/ical/IcalRepository.java | 4 +- .../bico/modules/ical/IcalService.java | 7 +- .../bico/modules/lesson/LessonController.java | 2 +- .../bico/modules/lesson/LessonRepository.java | 12 +- .../bico/modules/lesson/LessonService.java | 4 +- .../bico/modules/next/NextRepository.java | 14 +- .../bico/modules/next/model/NextBean.java | 44 ++- .../modules/profile/ProfileRepository.java | 4 +- .../bico/modules/sheet/SheetRepository.java | 6 +- .../bico/modules/sheet/SheetService.java | 2 +- .../bico/modules/slot/SlotController.java | 13 + .../bico/modules/slot/SlotRepository.java | 15 +- .../bico/modules/slot/model/SlotBean.java | 17 + .../modules/subject/SubjectController.java | 2 +- .../modules/subject/SubjectRepository.java | 14 +- .../bico/modules/subject/SubjectService.java | 6 +- .../modules/subject/model/SubjectBean.java | 2 +- .../bico/modules/theme/ThemeController.java | 2 +- .../bico/modules/theme/ThemeRepository.java | 14 +- .../bico/modules/theme/ThemeService.java | 2 +- src/main/resources/static/css/style.css | 50 ++- src/main/resources/templates/next.html | 12 +- src/main/resources/templates/sheet.html | 6 +- src/main/resources/templates/slot/item.html | 6 + src/main/resources/templates/template.html | 16 +- 35 files changed, 228 insertions(+), 870 deletions(-) delete mode 100644 src/main/java/de/jottyfan/bico/modules/camp/AdminRegistrationController.java delete mode 100644 src/main/java/de/jottyfan/bico/modules/camp/AdminRegistrationService.java delete mode 100644 src/main/java/de/jottyfan/bico/modules/camp/RegistrationController.java delete mode 100644 src/main/java/de/jottyfan/bico/modules/camp/RegistrationRepository.java delete mode 100644 src/main/java/de/jottyfan/bico/modules/camp/RegistrationService.java delete mode 100644 src/main/java/de/jottyfan/bico/modules/camp/model/RegistrationBean.java diff --git a/build.gradle b/build.gradle index ec41e86..6a1acd3 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } group = 'de.jottyfan.bico' -version = '0.2.7' +version = '0.2.8' description = """BibleClassOrganizer""" @@ -16,13 +16,10 @@ java { toolchain { languageVersion = JavaLanguageVersion.of(21) } + sourceCompatibility = 21 + targetCompatibility = 21 } -sourceCompatibility = 21 -targetCompatibility = 21 - -mainClassName = "de.jottyfan.bico.Main" - repositories { mavenCentral() maven { @@ -47,9 +44,9 @@ war { } dependencies { - implementation 'de.jottyfan:bicolib:8' + implementation 'de.jottyfan:bicolib:9' - implementation 'org.mnode.ical4j:ical4j:4.0.4' + implementation 'org.mnode.ical4j:ical4j:4.2.2' implementation 'org.springframework.boot:spring-boot-starter-jooq' implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' @@ -60,13 +57,13 @@ dependencies { implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:latest.release' implementation 'org.springframework.security:spring-security-oauth2-client' - implementation 'org.webjars:bootstrap:5.3.3' - implementation 'org.webjars.npm:bootstrap-icons:1.11.3' + implementation 'org.webjars:bootstrap:5.3.8' + implementation 'org.webjars.npm:bootstrap-icons:1.13.1' implementation 'org.webjars:jquery:3.7.1' - implementation 'org.webjars.npm:datatables.net:2.1.7' - implementation 'org.webjars.npm:datatables.net-buttons:3.1.1' - implementation 'org.webjars.npm:datatables.net-responsive:3.0.1' - implementation 'org.webjars.npm:datatables.net-bs5:2.1.7' + implementation 'org.webjars.npm:datatables.net:2.3.5' + implementation 'org.webjars.npm:datatables.net-buttons:3.2.5' + implementation 'org.webjars.npm:datatables.net-responsive:3.0.6' + implementation 'org.webjars.npm:datatables.net-bs5:2.3.5' implementation 'org.springframework.boot:spring-boot-devtools' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..23449a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/de/jottyfan/bico/modules/CommonController.java b/src/main/java/de/jottyfan/bico/modules/CommonController.java index 843cf14..82e47a2 100644 --- a/src/main/java/de/jottyfan/bico/modules/CommonController.java +++ b/src/main/java/de/jottyfan/bico/modules/CommonController.java @@ -19,7 +19,7 @@ import de.jottyfan.bico.modules.profile.ProfileService; * */ public abstract class CommonController { - private static final List admins = List.of("andre.sieber", "tobias.kuehne", "jotty", "kerstin.meisel"); + private static final List admins = List.of("jotty"); @Autowired private ProfileService profileService; @@ -32,6 +32,20 @@ public abstract class CommonController { return principal == null ? false : admins.contains(principal.getName()); } + @ModelAttribute("currentUserName") + public String getUserFullname(Principal principal) { + OAuth2AuthenticationToken token = (OAuth2AuthenticationToken) principal; + if (token != null) { + OAuth2User user = token.getPrincipal(); + String nextcloudUsername = user.getName(); + String name = nextcloudUsername.replace(".", " ").replace("oe", "ö").replace("ae", "ä").replace("ue", "ü"); + return name; + } else { + Main.LOGGER.warn("Token is null, so no username can be found. Returned empty string instead."); + return ""; + } + } + @ModelAttribute("hasBUrole") public Boolean hasBURole(Principal principal) { OAuth2AuthenticationToken token = (OAuth2AuthenticationToken) principal; diff --git a/src/main/java/de/jottyfan/bico/modules/camp/AdminRegistrationController.java b/src/main/java/de/jottyfan/bico/modules/camp/AdminRegistrationController.java deleted file mode 100644 index ca9f0ee..0000000 --- a/src/main/java/de/jottyfan/bico/modules/camp/AdminRegistrationController.java +++ /dev/null @@ -1,51 +0,0 @@ -package de.jottyfan.bico.modules.camp; - -import java.io.IOException; -import java.security.Principal; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import de.jottyfan.bico.modules.CommonController; -import jakarta.servlet.http.HttpServletResponse; - -/** - * - * @author jotty - * - */ -@Configuration -@Controller -public class AdminRegistrationController extends CommonController { - - @Autowired - private AdminRegistrationService service; - - @GetMapping("/camp/registration/admin") - public String getList(Model model, Principal principal) { - if (isCampAdmin(principal)) { - model.addAttribute("list", service.getAllRegistrations()); - model.addAttribute("ages", service.getAges()); - } - return "/camp/list"; - } - - @GetMapping("/camp/registration/admin/download") - @ResponseBody - public String download(HttpServletResponse response, Principal principal) throws IOException { - if (isCampAdmin(principal)) { - response.setHeader("Content-Disposition", String.format("attachment; filename=Gemeindefreizeit-Anmeldungen-%s.csv", - LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME))); - response.setContentType("text/csv; charset=utf-8"); - return service.getDownload(); - } else { - return "forbidden"; - } - } -} diff --git a/src/main/java/de/jottyfan/bico/modules/camp/AdminRegistrationService.java b/src/main/java/de/jottyfan/bico/modules/camp/AdminRegistrationService.java deleted file mode 100644 index 3ed7a69..0000000 --- a/src/main/java/de/jottyfan/bico/modules/camp/AdminRegistrationService.java +++ /dev/null @@ -1,33 +0,0 @@ -package de.jottyfan.bico.modules.camp; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import de.jottyfan.bico.db.camp.tables.records.TAgeRecord; -import de.jottyfan.bico.modules.camp.model.RegistrationBean; - -/** - * - * @author jotty - * - */ -@Service -public class AdminRegistrationService { - - @Autowired - private RegistrationRepository repository; - - public List getAllRegistrations() { - return repository.getAllRegistrations(); - } - - public List getAges() { - return repository.getAges(); - } - - public String getDownload() { - return repository.getDownload(); - } -} diff --git a/src/main/java/de/jottyfan/bico/modules/camp/RegistrationController.java b/src/main/java/de/jottyfan/bico/modules/camp/RegistrationController.java deleted file mode 100644 index 2389194..0000000 --- a/src/main/java/de/jottyfan/bico/modules/camp/RegistrationController.java +++ /dev/null @@ -1,77 +0,0 @@ -package de.jottyfan.bico.modules.camp; - -import java.security.Principal; -import java.util.ArrayList; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; - -import de.jottyfan.bico.db.camp.enums.EnumSex; -import de.jottyfan.bico.modules.CommonController; -import de.jottyfan.bico.modules.camp.model.RegistrationBean; -import jakarta.validation.Valid; - -/** - * - * @author jotty - * - */ -@Controller -public class RegistrationController extends CommonController { - - @Autowired - private RegistrationService service; - - @GetMapping("/camp/registration") - public String loadForm(Model model, Principal principal) { - model.addAttribute("registrations", service.getRegistrations(principal)); - model.addAttribute("bean", RegistrationBean.withAllDays()); - model.addAttribute("sexes", EnumSex.values()); - model.addAttribute("ages", service.getAges()); - return "/camp/registration"; - } - - @PostMapping("/camp/registration/submit") - public String submitAddForm(@Valid @ModelAttribute("bean") RegistrationBean bean, BindingResult bindingResult, - Model model, Principal principal) { - if (bindingResult.hasErrors()) { - model.addAttribute("registrations", new ArrayList()); // hack to make "Neue Anmeldung" appear - model.addAttribute("sexes", EnumSex.values()); - model.addAttribute("ages", service.getAges()); - return "/camp/registration"; - } - service.save(bean, principal); - return "redirect:/camp/registration"; - } - - @GetMapping("/camp/registration/edit/{id}") - public String loadEditForm(@PathVariable("id") Integer id, Model model, Principal principal) { - model.addAttribute("bean", service.getBeanOfPrincipal(id, principal)); - model.addAttribute("sexes", EnumSex.values()); - model.addAttribute("ages", service.getAges()); - return "/camp/edit"; - } - - @GetMapping("/camp/registration/delete/{id}") - public String delete(@PathVariable("id") Integer id, Model model, Principal principal) { - service.delete(id, principal); - return "redirect:/camp/registration"; - } - - @PostMapping("/camp/registration/correct") - public String submitEditForm(@Valid @ModelAttribute("bean") RegistrationBean bean, BindingResult bindingResult, - Model model, Principal principal) { - if (bindingResult.hasErrors()) { - model.addAttribute("sexes", EnumSex.values()); - return "/camp/registration"; - } - service.save(bean, principal); - return "redirect:/camp/registration"; - } -} diff --git a/src/main/java/de/jottyfan/bico/modules/camp/RegistrationRepository.java b/src/main/java/de/jottyfan/bico/modules/camp/RegistrationRepository.java deleted file mode 100644 index ee80d8b..0000000 --- a/src/main/java/de/jottyfan/bico/modules/camp/RegistrationRepository.java +++ /dev/null @@ -1,222 +0,0 @@ -package de.jottyfan.bico.modules.camp; - -import static de.jottyfan.bico.db.camp.Tables.T_AGE; -import static de.jottyfan.bico.db.camp.Tables.T_REGISTRATION; - -import java.time.LocalDateTime; -import java.util.List; - -import org.jooq.DSLContext; -import org.jooq.DeleteConditionStep; -import org.jooq.InsertValuesStep20; -import org.jooq.Record19; -import org.jooq.SelectConditionStep; -import org.jooq.SelectOnConditionStep; -import org.jooq.SelectSeekStep1; -import org.jooq.UpdateConditionStep; -import org.jooq.impl.DSL; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - -import de.jottyfan.bico.Main; -import de.jottyfan.bico.db.camp.enums.EnumCamp; -import de.jottyfan.bico.db.camp.enums.EnumSex; -import de.jottyfan.bico.db.camp.tables.records.TAgeRecord; -import de.jottyfan.bico.db.camp.tables.records.TRegistrationRecord; -import de.jottyfan.bico.modules.camp.model.RegistrationBean; -import jakarta.validation.Valid; - -/** - * - * @author jotty - * - */ -@Repository -public class RegistrationRepository { - @Autowired - private DSLContext jooq; - - /** - * save the validated bean - * - * @param bean the bean - * @param registrator the principal name - */ - public void save(@Valid RegistrationBean bean, String registrator) { - jooq.transaction(t -> { - if (bean.getPkRegistration() == null) { - InsertValuesStep20 sql = DSL.using(t) - // @formatter:off - .insertInto(T_REGISTRATION, - T_REGISTRATION.CAMP, - T_REGISTRATION.REGISTRATOR, - T_REGISTRATION.FORENAME, - T_REGISTRATION.SURNAME, - T_REGISTRATION.SEX, - T_REGISTRATION.BARRIER_FREE, - T_REGISTRATION.NUTRITION, - T_REGISTRATION.DRIVER_PROVIDE_PLACES, - T_REGISTRATION.WANT_PLACE_IN_CAR, - T_REGISTRATION.DISEASES, - T_REGISTRATION.REQUIRE_PAYMENT, - T_REGISTRATION.FK_AGE, - T_REGISTRATION.DAY0, - T_REGISTRATION.DAY1, - T_REGISTRATION.DAY2, - T_REGISTRATION.DAY3, - T_REGISTRATION.DAY4, - T_REGISTRATION.TOWELS, - T_REGISTRATION.BED_LINEN, - T_REGISTRATION.COT) - .values(EnumCamp.Gemeindefreizeit_2025, registrator, bean.getForename(), bean.getSurname(), EnumSex.lookupLiteral(bean.getSex()), - bean.getBarrierFree(), bean.getNutrition(), bean.getDriverProvidePlaces(), bean.getWantPlaceInCar(), bean.getDiseases(), bean.getRequirePayment(), - bean.getFkAge(), bean.getDay0(), bean.getDay1(), bean.getDay2(), bean.getDay3(), bean.getDay4(), bean.getTowels(), bean.getBedLinen(), bean.getCot()); - // @formatter:on - Main.LOGGER.trace(sql); - sql.execute(); - } else { - UpdateConditionStep sql = DSL.using(t) - // @formatter:off - .update(T_REGISTRATION) - .set(T_REGISTRATION.FORENAME, bean.getForename()) - .set(T_REGISTRATION.SURNAME, bean.getSurname()) - .set(T_REGISTRATION.SEX, EnumSex.lookupLiteral(bean.getSex())) - .set(T_REGISTRATION.REGISTRATOR, registrator) - .set(T_REGISTRATION.BARRIER_FREE, bean.getBarrierFree()) - .set(T_REGISTRATION.NUTRITION, bean.getNutrition()) - .set(T_REGISTRATION.DRIVER_PROVIDE_PLACES, bean.getDriverProvidePlaces()) - .set(T_REGISTRATION.WANT_PLACE_IN_CAR, bean.getWantPlaceInCar()) - .set(T_REGISTRATION.DISEASES, bean.getDiseases()) - .set(T_REGISTRATION.REQUIRE_PAYMENT, bean.getRequirePayment()) - .set(T_REGISTRATION.FK_AGE, bean.getFkAge()) - .set(T_REGISTRATION.DAY0, bean.getDay0()) - .set(T_REGISTRATION.DAY1, bean.getDay1()) - .set(T_REGISTRATION.DAY2, bean.getDay2()) - .set(T_REGISTRATION.DAY3, bean.getDay3()) - .set(T_REGISTRATION.DAY4, bean.getDay4()) - .set(T_REGISTRATION.TOWELS, bean.getTowels()) - .set(T_REGISTRATION.BED_LINEN, bean.getBedLinen()) - .set(T_REGISTRATION.COT, bean.getCot()) - .where(T_REGISTRATION.PK_REGISTRATION.eq(bean.getPkRegistration())); - // @formatter:on - Main.LOGGER.trace(sql); - sql.execute(); - } - }); - } - - /** - * get all registrations (for admins only) - * - * @return the registrations - */ - public List getAllRegistrations() { - SelectSeekStep1 sql = jooq - // @formatter:off - .selectFrom(T_REGISTRATION) - .orderBy(T_REGISTRATION.CREATED); - // @formatter:on - Main.LOGGER.trace(sql); - return sql.fetchInto(RegistrationBean.class); - } - - /** - * get all registrations of name - * - * @param name the name - * @return the registrations - */ - public List getRegistrations(String name) { - SelectConditionStep sql = jooq - // @formatter:off - .selectFrom(T_REGISTRATION) - .where(T_REGISTRATION.REGISTRATOR.eq(name)); - // @formatter:on - Main.LOGGER.trace(sql); - return sql.fetchInto(RegistrationBean.class); - } - - /** - * get the registration of id if the creator is the name; null else - * - * @param id the id - * @param name the name - * @return the bean or null - */ - public RegistrationBean getBean(Integer id, String name) { - SelectConditionStep sql = jooq - // @formatter:off - .selectFrom(T_REGISTRATION) - .where(T_REGISTRATION.PK_REGISTRATION.eq(id)) - .and(T_REGISTRATION.REGISTRATOR.eq(name)); - // @formatter:on - Main.LOGGER.trace(sql); - return sql.fetchOneInto(RegistrationBean.class); - } - - /** - * delete the registration if the name is the creator - * - * @param id the id - * @param name the name - */ - public void delete(Integer id, String name) { - DeleteConditionStep sql = jooq - // @formatter:off - .deleteFrom(T_REGISTRATION) - .where(T_REGISTRATION.PK_REGISTRATION.eq(id)) - .and(T_REGISTRATION.REGISTRATOR.eq(name)); - // @formatter:on - Main.LOGGER.trace(sql); - sql.execute(); - } - - /** - * get all ages - * - * @return the ages - */ - public List getAges() { - SelectSeekStep1 sql = jooq - // @formatter:off - .selectFrom(T_AGE) - .orderBy(T_AGE.PK_AGE); - // @formatter:on - Main.LOGGER.trace(sql); - return sql.fetchInto(TAgeRecord.class); - } - - /** - * get CSV version of the list, only for admins - * - * @return the csv - */ - public String getDownload() { - SelectOnConditionStep> sql = jooq - // @formatter:off - .select(T_REGISTRATION.CREATED, - T_REGISTRATION.FORENAME, - T_REGISTRATION.SURNAME, - T_REGISTRATION.SEX, - T_AGE.NAME, - T_REGISTRATION.DAY0, - T_REGISTRATION.DAY1, - T_REGISTRATION.DAY2, - T_REGISTRATION.DAY3, - T_REGISTRATION.DAY4, - T_REGISTRATION.BARRIER_FREE, - T_REGISTRATION.TOWELS, - T_REGISTRATION.BED_LINEN, - T_REGISTRATION.COT, - T_REGISTRATION.REQUIRE_PAYMENT, - T_REGISTRATION.DISEASES, - T_REGISTRATION.NUTRITION, - T_REGISTRATION.DRIVER_PROVIDE_PLACES, - T_REGISTRATION.WANT_PLACE_IN_CAR) - .from(T_REGISTRATION) - .leftJoin(T_AGE).on(T_AGE.PK_AGE.eq(T_REGISTRATION.FK_AGE)); - // @formatter:on - Main.LOGGER.trace(sql); - return sql.fetch().formatCSV(true); - } -} diff --git a/src/main/java/de/jottyfan/bico/modules/camp/RegistrationService.java b/src/main/java/de/jottyfan/bico/modules/camp/RegistrationService.java deleted file mode 100644 index edbae16..0000000 --- a/src/main/java/de/jottyfan/bico/modules/camp/RegistrationService.java +++ /dev/null @@ -1,72 +0,0 @@ -package de.jottyfan.bico.modules.camp; - -import java.security.Principal; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import de.jottyfan.bico.db.camp.tables.records.TAgeRecord; -import de.jottyfan.bico.modules.camp.model.RegistrationBean; -import jakarta.validation.Valid; - -/** - * - * @author jotty - * - */ -@Service -public class RegistrationService { - - @Autowired - private RegistrationRepository repository; - - /** - * save the bean content - * - * @param bean the bean - */ - public void save(@Valid RegistrationBean bean, Principal principal) { - repository.save(bean, principal.getName()); - } - - /** - * get the registrations of principal - * - * @param principal the principal - * @return the registrations - */ - public List getRegistrations(Principal principal) { - return repository.getRegistrations(principal.getName()); - } - - /** - * get the registration if the principal was the creator - * - * @param id the ID of the registration - * @param principal the principal - * @return the bean or null if not found or allowed - */ - public RegistrationBean getBeanOfPrincipal(Integer id, Principal principal) { - return repository.getBean(id, principal.getName()); - } - - /** - * delete the registration if the principal was the creator - * - * @param id the ID of the registration - * @param principal the principal - */ - public void delete(Integer id, Principal principal) { - repository.delete(id, principal.getName()); - } - - /** - * get the ages - * - * @return the ages - */ - public List getAges() { - return repository.getAges(); - } -} diff --git a/src/main/java/de/jottyfan/bico/modules/camp/model/RegistrationBean.java b/src/main/java/de/jottyfan/bico/modules/camp/model/RegistrationBean.java deleted file mode 100644 index a7e8b97..0000000 --- a/src/main/java/de/jottyfan/bico/modules/camp/model/RegistrationBean.java +++ /dev/null @@ -1,320 +0,0 @@ -package de.jottyfan.bico.modules.camp.model; - -import java.io.Serializable; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; - -/** - * - * @author jotty - * - */ -public class RegistrationBean implements Serializable { - private static final long serialVersionUID = 1L; - - private Integer pkRegistration; - @NotBlank - private String forename; - @NotBlank - private String surname; - @NotBlank - private String sex; - @NotNull - private Boolean barrierFree; - - private Boolean day0; - private Boolean day1; - private Boolean day2; - private Boolean day3; - private Boolean day4; - - private Boolean towels; - private Boolean bedLinen; - private Boolean cot; - - private String nutrition; - private Integer driverProvidePlaces; - private Boolean wantPlaceInCar; - private String diseases; - private Boolean requirePayment; - - @NotNull - private Integer fkAge; - - public static final RegistrationBean withAllDays() { - RegistrationBean bean = new RegistrationBean(); - bean.setDay0(true); - bean.setDay1(true); - bean.setDay2(true); - bean.setDay3(true); - bean.setDay4(true); - return bean; - } - - /** - * @return the forename - */ - public String getForename() { - return forename; - } - - /** - * @param forename the forename to set - */ - public void setForename(String forename) { - this.forename = forename; - } - - /** - * @return the surname - */ - public String getSurname() { - return surname; - } - - /** - * @param surname the surname to set - */ - public void setSurname(String surname) { - this.surname = surname; - } - - /** - * @return the sex - */ - public String getSex() { - return sex; - } - - /** - * @param sex the sex to set - */ - public void setSex(String sex) { - this.sex = sex; - } - - /** - * @return the pkRegistration - */ - public Integer getPkRegistration() { - return pkRegistration; - } - - /** - * @param pkRegistration the pkRegistration to set - */ - public void setPkRegistration(Integer pkRegistration) { - this.pkRegistration = pkRegistration; - } - - /** - * @return the barrierFree - */ - public Boolean getBarrierFree() { - return barrierFree; - } - - /** - * @param barrierFree the barrierFree to set - */ - public void setBarrierFree(Boolean barrierFree) { - this.barrierFree = barrierFree; - } - - /** - * @return the nutrition - */ - public String getNutrition() { - return nutrition; - } - - /** - * @param nutrition the nutrition to set - */ - public void setNutrition(String nutrition) { - this.nutrition = nutrition; - } - - /** - * @return the diseases - */ - public String getDiseases() { - return diseases; - } - - /** - * @param diseases the diseases to set - */ - public void setDiseases(String diseases) { - this.diseases = diseases; - } - - /** - * @return the driverProvidePlaces - */ - public Integer getDriverProvidePlaces() { - return driverProvidePlaces; - } - - /** - * @param driverProvidePlaces the driverProvidePlaces to set - */ - public void setDriverProvidePlaces(Integer driverProvidePlaces) { - this.driverProvidePlaces = driverProvidePlaces; - } - - /** - * @return the wantPlaceInCar - */ - public Boolean getWantPlaceInCar() { - return wantPlaceInCar; - } - - /** - * @param wantPlaceInCar the wantPlaceInCar to set - */ - public void setWantPlaceInCar(Boolean wantPlaceInCar) { - this.wantPlaceInCar = wantPlaceInCar; - } - - /** - * @return the requirePayment - */ - public Boolean getRequirePayment() { - return requirePayment; - } - - /** - * @param requirePayment the requirePayment to set - */ - public void setRequirePayment(Boolean requirePayment) { - this.requirePayment = requirePayment; - } - - /** - * @return the fkAge - */ - public Integer getFkAge() { - return fkAge; - } - - /** - * @param fkAge the fkAge to set - */ - public void setFkAge(Integer fkAge) { - this.fkAge = fkAge; - } - - /** - * @return the day0 - */ - public Boolean getDay0() { - return day0; - } - - /** - * @param day0 the day0 to set - */ - public void setDay0(Boolean day0) { - this.day0 = day0; - } - - /** - * @return the day1 - */ - public Boolean getDay1() { - return day1; - } - - /** - * @param day1 the day1 to set - */ - public void setDay1(Boolean day1) { - this.day1 = day1; - } - - /** - * @return the day2 - */ - public Boolean getDay2() { - return day2; - } - - /** - * @param day2 the day2 to set - */ - public void setDay2(Boolean day2) { - this.day2 = day2; - } - - /** - * @return the day3 - */ - public Boolean getDay3() { - return day3; - } - - /** - * @param day3 the day3 to set - */ - public void setDay3(Boolean day3) { - this.day3 = day3; - } - - /** - * @return the day4 - */ - public Boolean getDay4() { - return day4; - } - - /** - * @param day4 the day4 to set - */ - public void setDay4(Boolean day4) { - this.day4 = day4; - } - - /** - * @return the towels - */ - public Boolean getTowels() { - return towels; - } - - /** - * @param towels the towels to set - */ - public void setTowels(Boolean towels) { - this.towels = towels; - } - - /** - * @return the bedLinen - */ - public Boolean getBedLinen() { - return bedLinen; - } - - /** - * @param bedLinen the bedLinen to set - */ - public void setBedLinen(Boolean bedLinen) { - this.bedLinen = bedLinen; - } - - /** - * @return the cot - */ - public Boolean getCot() { - return cot; - } - - /** - * @param cot the cot to set - */ - public void setCot(Boolean cot) { - this.cot = cot; - } -} diff --git a/src/main/java/de/jottyfan/bico/modules/download/DownloadRepository.java b/src/main/java/de/jottyfan/bico/modules/download/DownloadRepository.java index dada2a9..7d019a9 100644 --- a/src/main/java/de/jottyfan/bico/modules/download/DownloadRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/download/DownloadRepository.java @@ -1,6 +1,6 @@ package de.jottyfan.bico.modules.download; -import static de.jottyfan.bico.db.public_.Tables.V_CALENDAR; +import static de.jottyfan.bico.db.Tables.V_CALENDAR; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,7 +9,7 @@ import org.jooq.SelectWhereStep; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import de.jottyfan.bico.db.public_.tables.records.VCalendarRecord; +import de.jottyfan.bico.db.tables.records.VCalendarRecord; /** * diff --git a/src/main/java/de/jottyfan/bico/modules/ical/IcalRepository.java b/src/main/java/de/jottyfan/bico/modules/ical/IcalRepository.java index f065ce2..b03b13c 100644 --- a/src/main/java/de/jottyfan/bico/modules/ical/IcalRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/ical/IcalRepository.java @@ -1,6 +1,6 @@ package de.jottyfan.bico.modules.ical; -import static de.jottyfan.bico.db.public_.Tables.V_CALENDAR; +import static de.jottyfan.bico.db.Tables.V_CALENDAR; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -9,7 +9,7 @@ import org.jooq.SelectWhereStep; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import de.jottyfan.bico.db.public_.tables.records.VCalendarRecord; +import de.jottyfan.bico.db.tables.records.VCalendarRecord; /** * diff --git a/src/main/java/de/jottyfan/bico/modules/ical/IcalService.java b/src/main/java/de/jottyfan/bico/modules/ical/IcalService.java index 507d802..bd56436 100644 --- a/src/main/java/de/jottyfan/bico/modules/ical/IcalService.java +++ b/src/main/java/de/jottyfan/bico/modules/ical/IcalService.java @@ -8,7 +8,7 @@ import java.time.LocalTime; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import de.jottyfan.bico.db.public_.tables.records.VCalendarRecord; +import de.jottyfan.bico.db.tables.records.VCalendarRecord; import net.fortuna.ical4j.data.CalendarOutputter; import net.fortuna.ical4j.model.Calendar; import net.fortuna.ical4j.model.component.VEvent; @@ -29,7 +29,10 @@ public class IcalService { Calendar calendar = new Calendar(); CalendarOutputter out = new CalendarOutputter(); for (VCalendarRecord record : repository.getAllDates()) { - String summary = record.getFullname(); + String groupname = ""; + groupname = record.getBibleclass() ? "Bibelunterricht" : groupname; + groupname = record.getYouthgroup() ? "Jungschar" : groupname; + String summary = String.format("%s %s", record.getFullname(), groupname).trim(); LocalDateTime startEvent = LocalDateTime.of(record.getSlotDay(), LocalTime.of(10, 30)); LocalDateTime endEvent = LocalDateTime.of(record.getSlotDay(), LocalTime.of(12, 0)); VEvent event = new VEvent(startEvent, endEvent, summary); diff --git a/src/main/java/de/jottyfan/bico/modules/lesson/LessonController.java b/src/main/java/de/jottyfan/bico/modules/lesson/LessonController.java index e264537..6d9bdd7 100644 --- a/src/main/java/de/jottyfan/bico/modules/lesson/LessonController.java +++ b/src/main/java/de/jottyfan/bico/modules/lesson/LessonController.java @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; -import de.jottyfan.bico.db.public_.tables.records.TLessonRecord; +import de.jottyfan.bico.db.tables.records.TLessonRecord; import de.jottyfan.bico.modules.CommonController; /** * diff --git a/src/main/java/de/jottyfan/bico/modules/lesson/LessonRepository.java b/src/main/java/de/jottyfan/bico/modules/lesson/LessonRepository.java index a39ebee..2c6232c 100644 --- a/src/main/java/de/jottyfan/bico/modules/lesson/LessonRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/lesson/LessonRepository.java @@ -1,8 +1,8 @@ package de.jottyfan.bico.modules.lesson; -import static de.jottyfan.bico.db.public_.Tables.T_LESSON; -import static de.jottyfan.bico.db.public_.Tables.T_PERSON; -import static de.jottyfan.bico.db.public_.Tables.T_SLOT; +import static de.jottyfan.bico.db.Tables.T_LESSON; +import static de.jottyfan.bico.db.Tables.T_PERSON; +import static de.jottyfan.bico.db.Tables.T_SLOT; import java.time.LocalDate; import java.util.List; @@ -19,8 +19,8 @@ import org.jooq.UpdateConditionStep; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import de.jottyfan.bico.db.public_.tables.records.TLessonRecord; -import de.jottyfan.bico.db.public_.tables.records.TPersonRecord; +import de.jottyfan.bico.db.tables.records.TLessonRecord; +import de.jottyfan.bico.db.tables.records.TPersonRecord; /** * @@ -50,7 +50,7 @@ public class LessonRepository { .values(slotId) .returning(T_LESSON.PK_LESSON); // @formatter:on - LOGGER.trace(sql); + LOGGER.info(sql); Integer pkLesson = sql2.fetchOne(T_LESSON.PK_LESSON); r = new TLessonRecord(); r.setPkLesson(pkLesson); diff --git a/src/main/java/de/jottyfan/bico/modules/lesson/LessonService.java b/src/main/java/de/jottyfan/bico/modules/lesson/LessonService.java index 12fdb43..96995ad 100644 --- a/src/main/java/de/jottyfan/bico/modules/lesson/LessonService.java +++ b/src/main/java/de/jottyfan/bico/modules/lesson/LessonService.java @@ -6,8 +6,8 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import de.jottyfan.bico.db.public_.tables.records.TLessonRecord; -import de.jottyfan.bico.db.public_.tables.records.TPersonRecord; +import de.jottyfan.bico.db.tables.records.TLessonRecord; +import de.jottyfan.bico.db.tables.records.TPersonRecord; /** * diff --git a/src/main/java/de/jottyfan/bico/modules/next/NextRepository.java b/src/main/java/de/jottyfan/bico/modules/next/NextRepository.java index 4ebfe35..b79dc20 100644 --- a/src/main/java/de/jottyfan/bico/modules/next/NextRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/next/NextRepository.java @@ -1,6 +1,6 @@ package de.jottyfan.bico.modules.next; -import static de.jottyfan.bico.db.public_.Tables.V_CALENDAR; +import static de.jottyfan.bico.db.Tables.V_CALENDAR; import java.time.LocalDate; import java.util.ArrayList; @@ -10,7 +10,7 @@ import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jooq.DSLContext; -import org.jooq.Record2; +import org.jooq.Record4; import org.jooq.SelectSeekStep1; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; @@ -36,19 +36,19 @@ public class NextRepository { * @return the next dates as beans in a list; an empty list at least */ public List getNext(LocalDate date) { - SelectSeekStep1, LocalDate> sql = jooq + SelectSeekStep1, LocalDate> sql = jooq // @formatter:off - .selectDistinct(V_CALENDAR.FULLNAME, V_CALENDAR.SLOT_DAY) + .selectDistinct(V_CALENDAR.FULLNAME, V_CALENDAR.SLOT_DAY, V_CALENDAR.BIBLECLASS, V_CALENDAR.YOUTHGROUP) .from(V_CALENDAR) .where(V_CALENDAR.SLOT_DAY.ge(date)) .orderBy(V_CALENDAR.SLOT_DAY.asc()); // @formatter:on LOGGER.trace(sql); - Iterator> i = sql.fetch().iterator(); + Iterator> i = sql.fetch().iterator(); List list = new ArrayList<>(); while (i.hasNext()) { - Record2 r = i.next(); - list.add(NextBean.of(r.get(V_CALENDAR.FULLNAME), r.get(V_CALENDAR.SLOT_DAY))); + Record4 r = i.next(); + list.add(NextBean.of(r.get(V_CALENDAR.FULLNAME), r.get(V_CALENDAR.SLOT_DAY), r.get(V_CALENDAR.BIBLECLASS), r.get(V_CALENDAR.YOUTHGROUP))); } return list; } diff --git a/src/main/java/de/jottyfan/bico/modules/next/model/NextBean.java b/src/main/java/de/jottyfan/bico/modules/next/model/NextBean.java index da2243d..8cda73a 100644 --- a/src/main/java/de/jottyfan/bico/modules/next/model/NextBean.java +++ b/src/main/java/de/jottyfan/bico/modules/next/model/NextBean.java @@ -4,23 +4,27 @@ import java.io.Serializable; import java.time.LocalDate; /** - * + * * @author jotty - * + * */ public class NextBean implements Serializable { private static final long serialVersionUID = 1L; private String fullname; private LocalDate day; - + private Boolean isBibleclass; + private Boolean isYouthgroup; + private NextBean() { } - - public final static NextBean of(String fullname, LocalDate day) { + + public final static NextBean of(String fullname, LocalDate day, Boolean isBibleclass, Boolean isYouthgroup) { NextBean bean = new NextBean(); bean.setDay(day); bean.setFullname(fullname); + bean.setIsBibleclass(isBibleclass); + bean.setIsYouthgroup(isYouthgroup); return bean; } @@ -50,5 +54,33 @@ public class NextBean implements Serializable { */ private void setDay(LocalDate day) { this.day = day; - } + } + + /** + * @return the isBibleclass + */ + public Boolean getIsBibleclass() { + return isBibleclass; + } + + /** + * @param isBibleclass the isBibleclass to set + */ + public void setIsBibleclass(Boolean isBibleclass) { + this.isBibleclass = isBibleclass; + } + + /** + * @return the isYouthgroup + */ + public Boolean getIsYouthgroup() { + return isYouthgroup; + } + + /** + * @param isYouthgroup the isYouthgroup to set + */ + public void setIsYouthgroup(Boolean isYouthgroup) { + this.isYouthgroup = isYouthgroup; + } } diff --git a/src/main/java/de/jottyfan/bico/modules/profile/ProfileRepository.java b/src/main/java/de/jottyfan/bico/modules/profile/ProfileRepository.java index d30ea7f..9dc2174 100644 --- a/src/main/java/de/jottyfan/bico/modules/profile/ProfileRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/profile/ProfileRepository.java @@ -1,6 +1,6 @@ package de.jottyfan.bico.modules.profile; -import static de.jottyfan.bico.db.public_.Tables.T_PROFILE; +import static de.jottyfan.bico.db.Tables.T_PROFILE; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -10,7 +10,7 @@ import org.jooq.SelectConditionStep; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import de.jottyfan.bico.db.public_.tables.records.TProfileRecord; +import de.jottyfan.bico.db.tables.records.TProfileRecord; import de.jottyfan.bico.modules.profile.model.ProfileBean; /** diff --git a/src/main/java/de/jottyfan/bico/modules/sheet/SheetRepository.java b/src/main/java/de/jottyfan/bico/modules/sheet/SheetRepository.java index 3ec2d34..d98f4f0 100644 --- a/src/main/java/de/jottyfan/bico/modules/sheet/SheetRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/sheet/SheetRepository.java @@ -1,6 +1,6 @@ package de.jottyfan.bico.modules.sheet; -import static de.jottyfan.bico.db.public_.Tables.V_CALENDAR; +import static de.jottyfan.bico.db.Tables.V_CALENDAR; import java.util.List; @@ -11,7 +11,7 @@ import org.jooq.SelectWhereStep; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import de.jottyfan.bico.db.public_.tables.records.VCalendarRecord; +import de.jottyfan.bico.db.tables.records.VCalendarRecord; /** * @@ -27,7 +27,7 @@ public class SheetRepository { private DSLContext jooq; public List getList() { - SelectWhereStep sql = jooq.selectFrom(V_CALENDAR); + SelectWhereStep sql = jooq.selectFrom(V_CALENDAR); LOGGER.trace(sql); return sql.fetch().stream().toList(); } diff --git a/src/main/java/de/jottyfan/bico/modules/sheet/SheetService.java b/src/main/java/de/jottyfan/bico/modules/sheet/SheetService.java index 5d25fd1..be06ed0 100644 --- a/src/main/java/de/jottyfan/bico/modules/sheet/SheetService.java +++ b/src/main/java/de/jottyfan/bico/modules/sheet/SheetService.java @@ -5,7 +5,7 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import de.jottyfan.bico.db.public_.tables.records.VCalendarRecord; +import de.jottyfan.bico.db.tables.records.VCalendarRecord; /** * diff --git a/src/main/java/de/jottyfan/bico/modules/slot/SlotController.java b/src/main/java/de/jottyfan/bico/modules/slot/SlotController.java index c5f6bda..3625996 100644 --- a/src/main/java/de/jottyfan/bico/modules/slot/SlotController.java +++ b/src/main/java/de/jottyfan/bico/modules/slot/SlotController.java @@ -1,5 +1,8 @@ package de.jottyfan.bico.modules.slot; +import java.util.HashMap; +import java.util.Map; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -9,6 +12,7 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import de.jottyfan.bico.db.enums.EnumGroupname; import de.jottyfan.bico.modules.CommonController; import de.jottyfan.bico.modules.slot.model.SlotBean; import jakarta.validation.Valid; @@ -33,6 +37,7 @@ public class SlotController extends CommonController { public String load(@PathVariable("id") Integer id, Model model) { model.addAttribute("bean", id == null ? new SlotBean() : service.loadSlot(id)); model.addAttribute("hasLesson", service.slotHasLesson(id)); + model.addAttribute("groupnames", EnumGroupname.values()); return "/slot/item"; } @@ -56,4 +61,12 @@ public class SlotController extends CommonController { service.saveSlot(bean); return "redirect:/sheet"; } + + @ModelAttribute("groupnamemap") + public Map getTranslations() { + Map map = new HashMap<>(); + map.put("bibleclass", "Bibelunterricht"); + map.put("youthgroup", "Jungschar"); + return map; + } } diff --git a/src/main/java/de/jottyfan/bico/modules/slot/SlotRepository.java b/src/main/java/de/jottyfan/bico/modules/slot/SlotRepository.java index f6c01fd..2d4558c 100644 --- a/src/main/java/de/jottyfan/bico/modules/slot/SlotRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/slot/SlotRepository.java @@ -1,7 +1,7 @@ package de.jottyfan.bico.modules.slot; -import static de.jottyfan.bico.db.public_.Tables.T_LESSON; -import static de.jottyfan.bico.db.public_.Tables.T_SLOT; +import static de.jottyfan.bico.db.Tables.T_LESSON; +import static de.jottyfan.bico.db.Tables.T_SLOT; import java.util.Iterator; @@ -15,8 +15,8 @@ import org.jooq.UpdateConditionStep; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import de.jottyfan.bico.db.public_.tables.records.TLessonRecord; -import de.jottyfan.bico.db.public_.tables.records.TSlotRecord; +import de.jottyfan.bico.db.tables.records.TLessonRecord; +import de.jottyfan.bico.db.tables.records.TSlotRecord; import de.jottyfan.bico.modules.slot.model.SlotBean; /** @@ -52,6 +52,7 @@ public class SlotRepository { bean.setPkSlot(r.getPkSlot()); bean.setSlotDay(r.getSlotDay()); bean.setNote(r.getNote()); + bean.setGroupname(r.getGroupname()); } return bean; } @@ -67,8 +68,9 @@ public class SlotRepository { // @formatter:off .insertInto(T_SLOT, T_SLOT.SLOT_DAY, + T_SLOT.GROUPNAME, T_SLOT.NOTE) - .values(slot.getSlotDay(), slot.getNote()) + .values(slot.getSlotDay(), slot.getGroupname(), slot.getNote()) .returning(T_SLOT.PK_SLOT); // @formatter:on LOGGER.trace(sql); @@ -86,6 +88,7 @@ public class SlotRepository { .update(T_SLOT) .set(T_SLOT.SLOT_DAY, slot.getSlotDay()) .set(T_SLOT.NOTE, slot.getNote()) + .set(T_SLOT.GROUPNAME, slot.getGroupname()) .where(T_SLOT.PK_SLOT.eq(slot.getPkSlot())); // @formatter:on LOGGER.trace(sql); @@ -139,7 +142,7 @@ public class SlotRepository { .selectFrom(T_LESSON) .where(T_LESSON.FK_SLOT.eq(slotId)); // @formatter:on - LOGGER.info(sql); + LOGGER.trace(sql); return sql.fetch().size() > 0; } } diff --git a/src/main/java/de/jottyfan/bico/modules/slot/model/SlotBean.java b/src/main/java/de/jottyfan/bico/modules/slot/model/SlotBean.java index ce9ff27..49c3622 100644 --- a/src/main/java/de/jottyfan/bico/modules/slot/model/SlotBean.java +++ b/src/main/java/de/jottyfan/bico/modules/slot/model/SlotBean.java @@ -5,6 +5,7 @@ import java.time.LocalDate; import org.springframework.format.annotation.DateTimeFormat; +import de.jottyfan.bico.db.enums.EnumGroupname; import jakarta.validation.constraints.NotNull; /** @@ -25,6 +26,8 @@ public class SlotBean implements Serializable { private String note; + private EnumGroupname groupname; + public SlotBean withNote(String note) { this.note = note; return this; @@ -71,4 +74,18 @@ public class SlotBean implements Serializable { public void setNote(String note) { this.note = note; } + + /** + * @return the groupname + */ + public EnumGroupname getGroupname() { + return groupname; + } + + /** + * @param groupname the groupname to set + */ + public void setGroupname(EnumGroupname groupname) { + this.groupname = groupname; + } } diff --git a/src/main/java/de/jottyfan/bico/modules/subject/SubjectController.java b/src/main/java/de/jottyfan/bico/modules/subject/SubjectController.java index c6aa4d8..0049a72 100644 --- a/src/main/java/de/jottyfan/bico/modules/subject/SubjectController.java +++ b/src/main/java/de/jottyfan/bico/modules/subject/SubjectController.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import de.jottyfan.bico.db.public_.tables.records.TSubjectRecord; +import de.jottyfan.bico.db.tables.records.TSubjectRecord; import de.jottyfan.bico.modules.CommonController; /** diff --git a/src/main/java/de/jottyfan/bico/modules/subject/SubjectRepository.java b/src/main/java/de/jottyfan/bico/modules/subject/SubjectRepository.java index 62c94f4..7aebf16 100644 --- a/src/main/java/de/jottyfan/bico/modules/subject/SubjectRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/subject/SubjectRepository.java @@ -1,9 +1,9 @@ package de.jottyfan.bico.modules.subject; -import static de.jottyfan.bico.db.public_.Tables.T_LESSON_SUBJECT; -import static de.jottyfan.bico.db.public_.Tables.T_SOURCE; -import static de.jottyfan.bico.db.public_.Tables.T_SUBJECT; -import static de.jottyfan.bico.db.public_.Tables.V_LESSON; +import static de.jottyfan.bico.db.Tables.T_LESSON_SUBJECT; +import static de.jottyfan.bico.db.Tables.T_SOURCE; +import static de.jottyfan.bico.db.Tables.T_SUBJECT; +import static de.jottyfan.bico.db.Tables.V_LESSON; import java.util.List; @@ -19,9 +19,9 @@ import org.jooq.UpdateConditionStep; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import de.jottyfan.bico.db.public_.tables.records.TSourceRecord; -import de.jottyfan.bico.db.public_.tables.records.TSubjectRecord; -import de.jottyfan.bico.db.public_.tables.records.VLessonRecord; +import de.jottyfan.bico.db.tables.records.TSourceRecord; +import de.jottyfan.bico.db.tables.records.TSubjectRecord; +import de.jottyfan.bico.db.tables.records.VLessonRecord; /** * diff --git a/src/main/java/de/jottyfan/bico/modules/subject/SubjectService.java b/src/main/java/de/jottyfan/bico/modules/subject/SubjectService.java index 158f765..6843de6 100644 --- a/src/main/java/de/jottyfan/bico/modules/subject/SubjectService.java +++ b/src/main/java/de/jottyfan/bico/modules/subject/SubjectService.java @@ -5,9 +5,9 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import de.jottyfan.bico.db.public_.tables.records.TSourceRecord; -import de.jottyfan.bico.db.public_.tables.records.TSubjectRecord; -import de.jottyfan.bico.db.public_.tables.records.VLessonRecord; +import de.jottyfan.bico.db.tables.records.TSourceRecord; +import de.jottyfan.bico.db.tables.records.TSubjectRecord; +import de.jottyfan.bico.db.tables.records.VLessonRecord; /** * diff --git a/src/main/java/de/jottyfan/bico/modules/subject/model/SubjectBean.java b/src/main/java/de/jottyfan/bico/modules/subject/model/SubjectBean.java index 4546717..5aac4e4 100644 --- a/src/main/java/de/jottyfan/bico/modules/subject/model/SubjectBean.java +++ b/src/main/java/de/jottyfan/bico/modules/subject/model/SubjectBean.java @@ -2,7 +2,7 @@ package de.jottyfan.bico.modules.subject.model; import java.io.Serializable; -import de.jottyfan.bico.db.public_.tables.records.TSubjectRecord; +import de.jottyfan.bico.db.tables.records.TSubjectRecord; /** * diff --git a/src/main/java/de/jottyfan/bico/modules/theme/ThemeController.java b/src/main/java/de/jottyfan/bico/modules/theme/ThemeController.java index 35d7771..2e2b2bf 100644 --- a/src/main/java/de/jottyfan/bico/modules/theme/ThemeController.java +++ b/src/main/java/de/jottyfan/bico/modules/theme/ThemeController.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; -import de.jottyfan.bico.db.public_.tables.records.TLessonRecord; +import de.jottyfan.bico.db.tables.records.TLessonRecord; import de.jottyfan.bico.modules.CommonController; import jakarta.servlet.http.HttpServletRequest; diff --git a/src/main/java/de/jottyfan/bico/modules/theme/ThemeRepository.java b/src/main/java/de/jottyfan/bico/modules/theme/ThemeRepository.java index 41d4fc9..fdbb6b0 100644 --- a/src/main/java/de/jottyfan/bico/modules/theme/ThemeRepository.java +++ b/src/main/java/de/jottyfan/bico/modules/theme/ThemeRepository.java @@ -1,10 +1,10 @@ package de.jottyfan.bico.modules.theme; -import static de.jottyfan.bico.db.public_.Tables.T_LESSON; -import static de.jottyfan.bico.db.public_.Tables.T_LESSON_SUBJECT; -import static de.jottyfan.bico.db.public_.Tables.T_SLOT; -import static de.jottyfan.bico.db.public_.Tables.T_SOURCE; -import static de.jottyfan.bico.db.public_.Tables.T_SUBJECT; +import static de.jottyfan.bico.db.Tables.T_LESSON; +import static de.jottyfan.bico.db.Tables.T_LESSON_SUBJECT; +import static de.jottyfan.bico.db.Tables.T_SLOT; +import static de.jottyfan.bico.db.Tables.T_SOURCE; +import static de.jottyfan.bico.db.Tables.T_SUBJECT; import java.time.LocalDate; import java.util.ArrayList; @@ -25,8 +25,8 @@ import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import de.jottyfan.bico.db.public_.tables.records.TLessonRecord; -import de.jottyfan.bico.db.public_.tables.records.TLessonSubjectRecord; +import de.jottyfan.bico.db.tables.records.TLessonRecord; +import de.jottyfan.bico.db.tables.records.TLessonSubjectRecord; import de.jottyfan.bico.modules.theme.model.KeyValueBean; import de.jottyfan.bico.modules.theme.model.ThemeBean; diff --git a/src/main/java/de/jottyfan/bico/modules/theme/ThemeService.java b/src/main/java/de/jottyfan/bico/modules/theme/ThemeService.java index 6edf110..69f169a 100644 --- a/src/main/java/de/jottyfan/bico/modules/theme/ThemeService.java +++ b/src/main/java/de/jottyfan/bico/modules/theme/ThemeService.java @@ -6,7 +6,7 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import de.jottyfan.bico.db.public_.tables.records.TLessonRecord; +import de.jottyfan.bico.db.tables.records.TLessonRecord; import de.jottyfan.bico.modules.theme.model.KeyValueBean; import de.jottyfan.bico.modules.theme.model.ThemeBean; diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 5ebd39f..6d37480 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -65,4 +65,52 @@ body { .full-size { width: 100% !important; max-width: inherit !important; -} \ No newline at end of file +} + +.tag { + transform: rotate(270deg); + -webkit-transform: rotate(270deg); /* Safari, Chrome */ + -moz-transform: rotate(270deg); /* Firefox */ + -ms-transform: rotate(270deg); /* IE 9 */ + -o-transform: rotate(270deg); /* Opera */ + font-size: small; + position: absolute; + left: -16px; + top: 24px; + border-bottom: 1px dashed silver; +} + +.tagbu { + background: linear-gradient(to bottom, yellow, white); +} + +[data-bs-theme=dark] .tagbu { + background: none; + color: yellow; +} + +.tagju { + background: linear-gradient(to bottom, lime, white); +} + +[data-bs-theme=dark] .tagju { + background: none; + color: lime; +} + +.tagfollow { + padding-left: 20px; +} + +.tagemphasize { + font-weight: bolder; + color: #ff4444; +} + +.smallbadge { + font-size: small; +} + +[data-bs-theme=dark] .smallbadge { + font-size: small; +} diff --git a/src/main/resources/templates/next.html b/src/main/resources/templates/next.html index 4728333..8c5682a 100644 --- a/src/main/resources/templates/next.html +++ b/src/main/resources/templates/next.html @@ -4,20 +4,16 @@
-
Kommende Einteilung für den Bibelunterricht
-
-
+
Bibelunt.
+
Jungsch.
+
+
Es gibt noch keine neuen Termine oder Zusagen für Termine.
-
-
- Willkommen im Anmeldeportal für die Gemeindefreizeit. Durch das Anklicken des Buttons Anmeldung Gemeindefreizeit kannst du das Anmeldeformular öffnen. -
-
diff --git a/src/main/resources/templates/sheet.html b/src/main/resources/templates/sheet.html index 9b72417..5ced98a 100644 --- a/src/main/resources/templates/sheet.html +++ b/src/main/resources/templates/sheet.html @@ -14,7 +14,11 @@ - + +
+ Bibelunterricht + Jungschar + diff --git a/src/main/resources/templates/slot/item.html b/src/main/resources/templates/slot/item.html index a3bd614..49825a1 100644 --- a/src/main/resources/templates/slot/item.html +++ b/src/main/resources/templates/slot/item.html @@ -17,6 +17,12 @@
+
Gruppenname
+
+ +
Notiz
diff --git a/src/main/resources/templates/template.html b/src/main/resources/templates/template.html index 94255a8..ec1a633 100644 --- a/src/main/resources/templates/template.html +++ b/src/main/resources/templates/template.html @@ -4,17 +4,17 @@ Bible Class Organizer - - - + + + - + - + - - - + + +