package templates
import (
"arbeitszeitmessung/helper"
"arbeitszeitmessung/models"
"fmt"
"net/url"
"strconv"
"time"
)
templ inputForm() {
{{
urlParams := ctx.Value("urlParams").(url.Values)
user := ctx.Value("user").(models.User)
}}
{ user.Vorname + " " + user.Name }
}
templ dayComponent(workDay models.WorkDay) {
{{
work, pause := workDay.GetWorkTimeString()
justify := ""
if len(workDay.Bookings) <= 1 {
justify = "justify-content: center"
}
}}
@timeGaugeComponent(workDay.GetWorkDayProgress(ctx.Value("user").(models.User)), workDay.Day.Equal(time.Now().Truncate(24*time.Hour)), workDay.RequiresAction())
{ workDay.Day.Format("Mon") }: { workDay.Day.Format("02.01.2006") }
if work!="" {
Arbeitszeit:
if (workDay.RequiresAction()) {
Bitte anpassen
} else {
{ work }
}
{ pause }
}
@lineComponent()
@changeButtonComponent("time-" + workDay.Day.Format("2006-01-02"))
}
templ changeButtonComponent(id string) {
}
templ timeGaugeComponent(progress uint8, today bool, warning bool) {
{{
var bgColor string
switch {
case (warning):
bgColor = "bg-red-600"
break
case (progress > 0 && progress < 90):
bgColor = "bg-orange-500"
break
case (90 <= 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 lineComponent() {
}
templ noBookingComponent(d models.WorkDay) {
//
Keine Buchung gefunden. Bitte Grund der Abwesenheit eingeben!
@newBookingComponent(d)
}
templ newBookingComponent(d models.WorkDay) {
}
templ bookingComponent(booking models.Booking) {
}
templ LegendComponent() {
Arbeitszeit unter regulär
}