added feiertage to database + endpoint to insert every year
This commit is contained in:
@@ -9,9 +9,7 @@ import (
|
||||
)
|
||||
|
||||
templ TimePage(workDays []models.WorkDay, lastSub time.Time) {
|
||||
{{
|
||||
allDays := ctx.Value("days").([]models.IWorkDay)
|
||||
}}
|
||||
{{ allDays := ctx.Value("days").([]models.IWorkDay) }}
|
||||
@Base()
|
||||
@headerComponent()
|
||||
<div class="grid-main divide-y-1">
|
||||
@@ -129,26 +127,25 @@ templ defaultDayComponent(day models.IWorkDay) {
|
||||
<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">
|
||||
if day.IsWorkDay() {
|
||||
{{
|
||||
workDay, _ := day.(*models.WorkDay)
|
||||
}}
|
||||
@newAbsenceComponent()
|
||||
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)
|
||||
}
|
||||
@newBookingComponent(workDay)
|
||||
} else {
|
||||
{{
|
||||
absentDay, _ := day.(*models.Absence)
|
||||
}}
|
||||
@absenceComponent(absentDay, false)
|
||||
switch day.Type() {
|
||||
case models.DayTypeWorkday:
|
||||
{{ workDay, _ := day.(*models.WorkDay) }}
|
||||
@newAbsenceComponent()
|
||||
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)
|
||||
}
|
||||
@newBookingComponent(workDay)
|
||||
case models.DayTypeAbsence:
|
||||
{{ absentDay, _ := day.(*models.Absence) }}
|
||||
@absenceComponent(absentDay, false)
|
||||
default:
|
||||
<p>{ day.ToString() }</p>
|
||||
}
|
||||
<input type="hidden" name="action" value="change"/> <!-- default action value for ändern button -->
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user