// templates are used for the templ templates // these will render the html page with data from the webserver package templates import ( "arbeitszeitmessung/models" "fmt" ) // this file includes the basic components, which are used in many other components and pages templ headerComponent() { // {{ user := ctx.Value("user").(models.User) }}
Zeitverwaltung Abrechnung if true { Monatsabrechnung Anwesenheit } Einstellungen
} templ statusCheckMark(status models.WeekStatus, target models.WeekStatus) { if status >= target {
} else {
} } templ lineComponent() {
} templ timeGaugeComponent(progress int8, today bool) { {{ var bgColor string switch { case (0 > progress): bgColor = "bg-red-600" break case (progress > 0 && progress < 95): bgColor = "bg-orange-500" break case (95 <= progress && progress <= 105): bgColor = "bg-accent" break case (progress > 105): bgColor = "bg-purple-600" break default: bgColor = "bg-neutral-400" break } }} if today {
} else {
} } templ legendComponent() {
Fehler
Arbeitszeit unter regulär
Arbeitszeit vollständig
Überstunden
Keine Buchungen
} templ CheckboxComponent(pNr int, label string) { {{ id := fmt.Sprintf("pdf-%d", pNr) }}
}