package templates // this files includes the largest templates from the time page, // because this page is so complex the smaller components are in // the timeComponents.templ file import ( "arbeitszeitmessung/helper" "arbeitszeitmessung/models" "net/url" "strconv" "time" ) templ TimePage(workDays []models.WorkDay, lastSub time.Time) { {{ allDays := ctx.Value("days").([]models.IWorkDay) }} @BasePage() @headerComponent()
{ user.Vorname + " " + user.Name }
Überstunden
{ user.Overtime }
{ day.Date().Format("02.01.2006") }
if day.IsWorkDay() { {{ work, pause, overtime := day.GetTimes(user, models.WorktimeBaseDay, true) work = day.GetWorktime(user, models.WorktimeBaseDay, false) }} if day.RequiresAction() {Bitte anpassen
} else { if work > 0 {Arbeitszeit:
{ helper.FormatDuration(work) }
} if pause > 0 {{ helper.FormatDuration(pause) }
} if !day.IsEmpty() && overtime != 0 {{ helper.FormatDuration(overtime) }
} } }{ day.ToString() }
} }