using IWorkDay interface for team
All checks were successful
Tests / Run Go Tests (push) Successful in 42s
All checks were successful
Tests / Run Go Tests (push) Successful in 42s
This commit is contained in:
@@ -29,7 +29,7 @@ func PDFHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
//TODO: only accepted weeks
|
//TODO: only accepted weeks
|
||||||
|
|
||||||
weeks := models.GetWorkDays(user, startDate, endDate)
|
weeks := models.GetDays(user, startDate, endDate, false)
|
||||||
|
|
||||||
// log.Printf("Using Dates: %s - %s\n", startDate.String(), endDate.String())
|
// log.Printf("Using Dates: %s - %s\n", startDate.String(), endDate.String())
|
||||||
templates.PDFReportEmploye(user, weeks, startDate, endDate).Render(r.Context(), w)
|
templates.PDFReportEmploye(user, weeks, startDate, endDate).Render(r.Context(), w)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ func getBookings(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
tsTo = tsTo.AddDate(0, 0, 1) // so that today is inside
|
tsTo = tsTo.AddDate(0, 0, 1) // so that today is inside
|
||||||
|
|
||||||
days := models.GetDays(user, tsFrom, tsTo)
|
days := models.GetDays(user, tsFrom, tsTo, true)
|
||||||
sort.Slice(days, func(i, j int) bool {
|
sort.Slice(days, func(i, j int) bool {
|
||||||
return days[i].Date().After(days[j].Date())
|
return days[i].Date().After(days[j].Date())
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -87,6 +87,13 @@ func (a *Absence) RequiresAction() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *Absence) GetAllWorkTimesVirtual(u User) (work, pause, overtime time.Duration) {
|
||||||
|
if a.AbwesenheitTyp.WorkTime > 1 {
|
||||||
|
return u.ArbeitszeitProTag(), 0, 0
|
||||||
|
}
|
||||||
|
return 0, 0, 0
|
||||||
|
}
|
||||||
|
|
||||||
func (a *Absence) Insert() error {
|
func (a *Absence) Insert() error {
|
||||||
qStr, err := DB.Prepare(`INSERT INTO abwesenheit (card_uid, abwesenheit_typ, datum_from, datum_to) VALUES ($1, $2, $3, $4) RETURNING counter_id;`)
|
qStr, err := DB.Prepare(`INSERT INTO abwesenheit (card_uid, abwesenheit_typ, datum_from, datum_to) VALUES ($1, $2, $3, $4) RETURNING counter_id;`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"arbeitszeitmessung/helper"
|
"arbeitszeitmessung/helper"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"log"
|
"log"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -14,6 +15,7 @@ type IWorkDay interface {
|
|||||||
TimeWorkReal(User) time.Duration
|
TimeWorkReal(User) time.Duration
|
||||||
TimePauseReal(User) (work, pause time.Duration)
|
TimePauseReal(User) (work, pause time.Duration)
|
||||||
TimeOvertimeReal(User) time.Duration
|
TimeOvertimeReal(User) time.Duration
|
||||||
|
GetAllWorkTimesVirtual(User) (work, pause, overtime time.Duration)
|
||||||
ToString() string
|
ToString() string
|
||||||
IsWorkDay() bool
|
IsWorkDay() bool
|
||||||
IsKurzArbeit() bool
|
IsKurzArbeit() bool
|
||||||
@@ -33,7 +35,7 @@ type WorkDay struct {
|
|||||||
kurzArbeit bool
|
kurzArbeit bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetDays(user User, tsFrom, tsTo time.Time) []IWorkDay {
|
func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay {
|
||||||
var allDays map[string]IWorkDay = make(map[string]IWorkDay)
|
var allDays map[string]IWorkDay = make(map[string]IWorkDay)
|
||||||
var sortedDays []IWorkDay
|
var sortedDays []IWorkDay
|
||||||
for _, day := range GetWorkDays(user, tsFrom, tsTo) {
|
for _, day := range GetWorkDays(user, tsFrom, tsTo) {
|
||||||
@@ -60,6 +62,15 @@ func GetDays(user User, tsFrom, tsTo time.Time) []IWorkDay {
|
|||||||
for _, day := range allDays {
|
for _, day := range allDays {
|
||||||
sortedDays = append(sortedDays, day)
|
sortedDays = append(sortedDays, day)
|
||||||
}
|
}
|
||||||
|
if orderedForward {
|
||||||
|
sort.Slice(sortedDays, func(i, j int) bool {
|
||||||
|
return sortedDays[i].Date().After(sortedDays[j].Date())
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
sort.Slice(sortedDays, func(i, j int) bool {
|
||||||
|
return sortedDays[i].Date().Before(sortedDays[j].Date())
|
||||||
|
})
|
||||||
|
}
|
||||||
return sortedDays
|
return sortedDays
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"errors"
|
"errors"
|
||||||
"log"
|
"log"
|
||||||
"sort"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -46,10 +45,7 @@ func NewWorkWeek(user User, tsMonday time.Time, populate bool) WorkWeek {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *WorkWeek) PopulateWithDays(worktime time.Duration, overtime time.Duration) {
|
func (w *WorkWeek) PopulateWithDays(worktime time.Duration, overtime time.Duration) {
|
||||||
w.Days = GetDays(w.User, w.WeekStart, w.WeekStart.Add(6*24*time.Hour))
|
w.Days = GetDays(w.User, w.WeekStart, w.WeekStart.Add(6*24*time.Hour), false)
|
||||||
sort.Slice(w.Days, func(i, j int) bool {
|
|
||||||
return w.Days[i].Date().Before(w.Days[j].Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
for _, day := range w.Days {
|
for _, day := range w.Days {
|
||||||
w.Worktime += day.TimeWorkVirtual(w.User)
|
w.Worktime += day.TimeWorkVirtual(w.User)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
templ PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Time, tsEnd time.Time) {
|
templ PDFReportEmploye(e models.User, workDays []models.IWorkDay, tsStart time.Time, tsEnd time.Time) {
|
||||||
{{
|
{{
|
||||||
_, kw := tsStart.ISOWeek()
|
_, kw := tsStart.ISOWeek()
|
||||||
noBorder := ""
|
noBorder := ""
|
||||||
@@ -33,22 +33,32 @@ templ PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Ti
|
|||||||
noBorder = "border-b-0"
|
noBorder = "border-b-0"
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
<p class={ noBorder }>{ day.Day.Format("02.01.2006") }</p>
|
<p class={ noBorder }>{ day.Date().Format("02.01.2006") }</p>
|
||||||
<div class={ "grid grid-cols-subgrid col-span-3 " + noBorder }>
|
<div class={ "grid grid-cols-subgrid col-span-3 " + noBorder }>
|
||||||
for bookingI := 0; bookingI < len(day.Bookings); bookingI+= 2 {
|
if day.IsWorkDay() {
|
||||||
<p>{ day.Bookings[bookingI].Timestamp.Format("15:04") }</p>
|
{{
|
||||||
<p>{ day.Bookings[bookingI+1].Timestamp.Format("15:04") }</p>
|
workDay, _ := day.(*models.WorkDay)
|
||||||
<p>{ day.Bookings[bookingI].BookingType.Name } </p>
|
}}
|
||||||
|
for bookingI := 0; bookingI < len(workDay.Bookings); bookingI+= 2 {
|
||||||
|
<p>{ workDay.Bookings[bookingI].Timestamp.Format("15:04") }</p>
|
||||||
|
<p>{ workDay.Bookings[bookingI+1].Timestamp.Format("15:04") }</p>
|
||||||
|
<p>{ workDay.Bookings[bookingI].BookingType.Name } </p>
|
||||||
|
}
|
||||||
|
if workDay.IsKurzArbeit() {
|
||||||
|
<p class="col-span-full">Kurzarbeit</p>
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
{{
|
||||||
|
absentDay, _ := day.(*models.Absence)
|
||||||
|
}}
|
||||||
|
<p class="col-span-full">{ absentDay.AbwesenheitTyp.Name }</p>
|
||||||
}
|
}
|
||||||
// if (day.Absence != models.Absence{}) {
|
|
||||||
// <p class="col-span-full">{ day.Absence.AbwesenheitTyp.Name }</p>
|
|
||||||
// }
|
|
||||||
</div>
|
</div>
|
||||||
{{ work, pause, overtime := day.GetAllWorkTimesReal(e) }}
|
{{ work, pause, overtime := day.GetAllWorkTimesVirtual(e) }}
|
||||||
@ColorDuration(work, noBorder)
|
@ColorDuration(work, noBorder)
|
||||||
@ColorDuration(pause, noBorder)
|
@ColorDuration(pause, noBorder)
|
||||||
@ColorDuration(overtime, noBorder+" border-r-0")
|
@ColorDuration(overtime, noBorder+" border-r-0")
|
||||||
if day.Day.Weekday() == time.Friday {
|
if day.Date().Weekday() == time.Friday {
|
||||||
<p class="col-span-full bg-neutral-300">Wochenende</p>
|
<p class="col-span-full bg-neutral-300">Wochenende</p>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Time, tsEnd time.Time) templ.Component {
|
func PDFReportEmploye(e models.User, workDays []models.IWorkDay, tsStart time.Time, tsEnd time.Time) templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||||
@@ -113,9 +113,9 @@ func PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Tim
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var7 string
|
var templ_7745c5c3_Var7 string
|
||||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(day.Day.Format("02.01.2006"))
|
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(day.Date().Format("02.01.2006"))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 36, Col: 56}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 36, Col: 59}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -147,15 +147,18 @@ func PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Tim
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
for bookingI := 0; bookingI < len(day.Bookings); bookingI += 2 {
|
if day.IsWorkDay() {
|
||||||
|
|
||||||
|
workDay, _ := day.(*models.WorkDay)
|
||||||
|
for bookingI := 0; bookingI < len(workDay.Bookings); bookingI += 2 {
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<p>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<p>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var10 string
|
var templ_7745c5c3_Var10 string
|
||||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(day.Bookings[bookingI].Timestamp.Format("15:04"))
|
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(workDay.Bookings[bookingI].Timestamp.Format("15:04"))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 39, Col: 59}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 43, Col: 64}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -166,9 +169,9 @@ func PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Tim
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var11 string
|
var templ_7745c5c3_Var11 string
|
||||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(day.Bookings[bookingI+1].Timestamp.Format("15:04"))
|
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(workDay.Bookings[bookingI+1].Timestamp.Format("15:04"))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 40, Col: 61}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 44, Col: 66}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -179,9 +182,9 @@ func PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Tim
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var12 string
|
var templ_7745c5c3_Var12 string
|
||||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(day.Bookings[bookingI].BookingType.Name)
|
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(workDay.Bookings[bookingI].BookingType.Name)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 41, Col: 50}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 45, Col: 55}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -192,16 +195,47 @@ func PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Tim
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</div>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " ")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
work, pause, overtime := day.GetAllWorkTimesReal(e)
|
if workDay.IsKurzArbeit() {
|
||||||
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<p class=\"col-span-full\">Kurzarbeit</p>")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
absentDay, _ := day.(*models.Absence)
|
||||||
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<p class=\"col-span-full\">")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
var templ_7745c5c3_Var13 string
|
||||||
|
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(absentDay.AbwesenheitTyp.Name)
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 54, Col: 62}
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</p>")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</div>")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
work, pause, overtime := day.GetAllWorkTimesVirtual(e)
|
||||||
templ_7745c5c3_Err = ColorDuration(work, noBorder).Render(ctx, templ_7745c5c3_Buffer)
|
templ_7745c5c3_Err = ColorDuration(work, noBorder).Render(ctx, templ_7745c5c3_Buffer)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, " ")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, " ")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -209,7 +243,7 @@ func PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Tim
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, " ")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " ")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -217,18 +251,18 @@ func PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Tim
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, " ")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, " ")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
if day.Day.Weekday() == time.Friday {
|
if day.Date().Weekday() == time.Friday {
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<p class=\"col-span-full bg-neutral-300\">Wochenende</p>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<p class=\"col-span-full bg-neutral-300\">Wochenende</p>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</div></content>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</div></content>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -252,9 +286,9 @@ func ColorDuration(d time.Duration, classes string) templ.Component {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
ctx = templ.InitializeContext(ctx)
|
ctx = templ.InitializeContext(ctx)
|
||||||
templ_7745c5c3_Var13 := templ.GetChildren(ctx)
|
templ_7745c5c3_Var14 := templ.GetChildren(ctx)
|
||||||
if templ_7745c5c3_Var13 == nil {
|
if templ_7745c5c3_Var14 == nil {
|
||||||
templ_7745c5c3_Var13 = templ.NopComponent
|
templ_7745c5c3_Var14 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
@@ -262,38 +296,38 @@ func ColorDuration(d time.Duration, classes string) templ.Component {
|
|||||||
if d.Abs() < time.Minute {
|
if d.Abs() < time.Minute {
|
||||||
color = "text-neutral-300"
|
color = "text-neutral-300"
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var14 = []any{color + " " + classes}
|
var templ_7745c5c3_Var15 = []any{color + " " + classes}
|
||||||
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...)
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var15...)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<p class=\"")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<p class=\"")
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ_7745c5c3_Err
|
|
||||||
}
|
|
||||||
var templ_7745c5c3_Var15 string
|
|
||||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var14).String())
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 1, Col: 0}
|
|
||||||
}
|
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
|
||||||
if templ_7745c5c3_Err != nil {
|
|
||||||
return templ_7745c5c3_Err
|
|
||||||
}
|
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\">")
|
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
var templ_7745c5c3_Var16 string
|
var templ_7745c5c3_Var16 string
|
||||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(helper.FormatDurationFill(d, true))
|
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var15).String())
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 66, Col: 72}
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 1, Col: 0}
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</p>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "\">")
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
var templ_7745c5c3_Var17 string
|
||||||
|
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(helper.FormatDurationFill(d, true))
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pdf.templ`, Line: 76, Col: 72}
|
||||||
|
}
|
||||||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||||
|
if templ_7745c5c3_Err != nil {
|
||||||
|
return templ_7745c5c3_Err
|
||||||
|
}
|
||||||
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</p>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user