separaded endpoints + cleaned page templates + added constants to time formatting
Some checks failed
Tests / Run Go Tests (push) Failing after 1m34s

This commit is contained in:
2025-10-27 22:53:07 +01:00
parent e1f0f85401
commit a634b7a69e
26 changed files with 654 additions and 639 deletions

View File

@@ -77,8 +77,8 @@ templ absenceComponent(a *models.Absence, isKurzarbeit bool) {
}
}}
<div class={ "flex flex-row items-center gap-2", editBox }>
<input type="hidden" name="date_from" value={ a.DateFrom.Format("2006-01-02") }/>
<input type="hidden" name="date_to" value={ a.DateTo.Format("2006-01-02") }/>
<input type="hidden" name="date_from" value={ a.DateFrom.Format(time.DateOnly) }/>
<input type="hidden" name="date_to" value={ a.DateTo.Format(time.DateOnly) }/>
<input type="hidden" name="aw_type" value={ a.AbwesenheitTyp.Id }/>
<input type="hidden" name="aw_id" value={ a.CounterId }/>
<p class="whitespace-nowrap group-[.edit]:ml-2">
@@ -89,7 +89,7 @@ templ absenceComponent(a *models.Absence, isKurzarbeit bool) {
</p>
<div class="w-full"></div>
if isKurzarbeit {
<button type="button" onclick={ templ.JSFuncCall("editWorkday", templ.JSExpression("this"), templ.JSExpression("event"), "time-"+a.Date().Format("2006-01-02"), false) } class="hidden btn border-0 rounded-none grow-0 w-auto group-[.edit]:inline">Bearbeiten</button>
<button type="button" onclick={ templ.JSFuncCall("editWorkday", templ.JSExpression("this"), templ.JSExpression("event"), "time-"+a.Date().Format(time.DateOnly), false) } class="hidden btn border-0 rounded-none grow-0 w-auto group-[.edit]:inline">Bearbeiten</button>
}
</div>
}
@@ -97,7 +97,7 @@ templ absenceComponent(a *models.Absence, isKurzarbeit bool) {
templ newBookingComponent(d *models.WorkDay) {
<div class="new-booking-component hidden group-[.edit]:flex flex-row gap-2 items-center edit-box border-dashed">
<input name="timestamp" type="time" value={ time.Now().Format("15:04") } class="text-neutral-700 group-[.edit]:inline hidden bg-neutral-100 text-sm px-3 py-2 cursor-pointer"/>
<input name="date" type="hidden" value={ d.Day.Format("2006-01-02") }/>
<input name="date" type="hidden" value={ d.Day.Format(time.DateOnly) }/>
<div class="relative">
<select class="cursor-pointer appearance-none" name="check_in_out">
<option value="0" disabled>Kommen/Gehen</option>