minor fixes in pdf generator + new booking input select
Some checks failed
Tests / Run Go Tests (push) Failing after 3m30s
Arbeitszeitmessung Deploy / Build Webserver (push) Successful in 4m33s
Arbeitszeitmessung Deploy / Build Document Creator (push) Successful in 4m32s

This commit is contained in:
2026-01-04 23:30:09 +01:00
parent 2b17eb6854
commit 7c45ef6112
4 changed files with 113 additions and 53 deletions

View File

@@ -127,10 +127,14 @@ templ defaultDayComponent(day models.IWorkDay) {
</div>
<div class="all-booking-component grid-cell flex flex-row md:col-span-3 col-span-2 gap-2 w-full">
@lineComponent()
<form id={ "time-" + day.Date().Format(time.DateOnly) } class={ "flex flex-col gap-2 w-full", justify } method="post">
@newAbsenceComponent()
@timeDayTypeSwitch(day, true)
@newBookingComponent(day)
<form id={ "time-" + day.Date().Format(time.DateOnly) } class={ "bookings flex flex-col gap-2 w-full", justify } method="post">
if (day.GetDayProgress(user) < 100 || day.IsWorkDay()) {
@newAbsenceComponent()
@timeDayTypeSwitch(day, true)
@newBookingComponent(day)
} else {
@timeDayTypeSwitch(day, true)
}
<input type="hidden" name="action" value="change"/> <!-- default action value for ändern button -->
</form>
</div>
@@ -160,12 +164,14 @@ templ timeDayTypeSwitch(day models.IWorkDay, fromCompound bool) {
templ workdayComponent(workDay *models.WorkDay) {
if len(workDay.Bookings) < 1 {
<p class="text group-[.edit]:hidden">Keine Buchung gefunden. Bitte Arbeitsstunden oder Grund der Abwesenheit eingeben!</p>
}
if workDay.IsKurzArbeit() && len(workDay.Bookings) > 0 {
@absenceComponent(workDay.GetKurzArbeit(), true)
}
for _, booking := range workDay.Bookings {
@bookingComponent(booking)
} else {
if workDay.IsKurzArbeit() && len(workDay.Bookings) > 0 {
@absenceComponent(workDay.GetKurzArbeit(), true)
}
for _, booking := range workDay.Bookings {
@bookingComponent(booking)
}
<input type="hidden" name="select_kommen" value={ len(workDay.Bookings) > 0 && workDay.Bookings[len(workDay.Bookings)-1].CheckInOut%2 == 0 }/>
}
}