added env switch for empty day rendering + switched from 255 to 254 for auto logout

This commit is contained in:
2025-04-10 09:16:20 +02:00
parent 19251eefed
commit 71e65e9b17
8 changed files with 116 additions and 1172 deletions

View File

@@ -1,6 +1,7 @@
package templates
import (
"arbeitszeitmessung/helper"
"arbeitszeitmessung/models"
"fmt"
"net/url"
@@ -63,13 +64,15 @@ templ dayComponent(workDay models.WorkDay) {
<div class="time-component flex flex-row md:col-span-3 gap-2 w-full grid-cell">
@lineComponent()
<form id={ "time-" + workDay.Day.Format("2006-01-02") } class="flex flex-col gap-2 group w-full justify-between" style={ justify } method="post">
if len(workDay.Bookings) <= 1 && workDay.Bookings[len(workDay.Bookings)-1].CounterId == 0 {
if len(workDay.Bookings) <= 1 && workDay.Bookings[len(workDay.Bookings)-1].CounterId == 0 && helper.GetEnv("GO_ENV", "production") == "debug" {
@noBookingComponent(workDay)
} else {
for _, booking := range workDay.Bookings {
@bookingComponent(booking)
}
@newBookingComponent(workDay)
if helper.GetEnv("GO_ENV", "production") == "debug" {
@newBookingComponent(workDay)
}
}
</form>
</div>