package templates import ( "arbeitszeitmessung/models" "time" "fmt" "net/url" ) templ inputForm(){ {{ urlParams := ctx.Value("urlParams").(url.Values) }}

Tom Tröger

Überstunden

4h 32min

// @lineComponent()
} templ bookingComponent(booking models.Booking) {

{booking.Timestamp.Local().Format("15:04")} {booking.GetBookingType()}

} templ lineComponent(){
} templ dayComponent(workDay models.WorkDay, last bool){ {{ last_border := "" if(last) { last_border = "border-b-0" } }}
@timeGaugeComponent(workDay.GetWorkDayProgress(), workDay.Day.Equal(time.Now().Truncate(24 * time.Hour)), workDay.RequiresAction())

{workDay.Day.Format("Mon")}: {workDay.Day.Format("02.01.2006")}

Arbeitszeit

if (workDay.RequiresAction()) {

Bitte anpassen

}else{

{workDay.GetWorkTimeString()}

}
@lineComponent()
for _, booking := range workDay.Bookings { @bookingComponent(booking) }
} templ allBookings(bookings []models.WorkDay) { for index, bookingGroup := range bookings { @dayComponent(bookingGroup, index == len(bookings) -1) } } templ timeGaugeComponent(progress uint8, today bool, warning bool){ {{ var bgColor string switch { case (warning): bgColor = "bg-red-600" break case (progress > 0 && progress < 80): bgColor = "bg-orange-500" break case (80 < progress && progress <=110): bgColor = "bg-accent" break case(progress > 110): 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 OverviewPage(bookings []models.WorkDay){ @Style()
@inputForm() @allBookings(bookings)
@LegendComponent() }