feat: updated docs and added description to files
Some checks failed
Tests / Run Go Tests (push) Failing after 1m35s
Arbeitszeitmessung Deploy / Build Webserver (push) Successful in 2m48s

This commit is contained in:
2026-01-29 18:28:28 +01:00
parent 41c34c42cf
commit ba034f1c33
52 changed files with 458 additions and 3413 deletions

View File

@@ -1,5 +1,9 @@
package templates
// this files includes the largest templates from the time page,
// because this page is so complex the smaller components are in
// the timeComponents.templ file
import (
"arbeitszeitmessung/helper"
"arbeitszeitmessung/models"
@@ -10,7 +14,7 @@ import (
templ TimePage(workDays []models.WorkDay, lastSub time.Time) {
{{ allDays := ctx.Value("days").([]models.IWorkDay) }}
@Base()
@BasePage()
@headerComponent()
<div class="grid-main divide-y-1">
@inputForm()
@@ -21,7 +25,7 @@ templ TimePage(workDays []models.WorkDay, lastSub time.Time) {
}
}
</div>
@LegendComponent()
@legendComponent()
}
templ inputForm() {
@@ -160,21 +164,3 @@ templ timeDayTypeSwitch(day models.IWorkDay, fromCompound bool) {
<p>{ day.ToString() }</p>
}
}
templ workdayComponent(workDay *models.WorkDay) {
if len(workDay.Bookings) < 1 {
<p class="text group-[.edit]:hidden">Keine Buchung gefunden. Bitte Arbeitsstunden oder Grund der Abwesenheit eingeben!</p>
} else {
if workDay.IsKurzArbeit() && len(workDay.Bookings) > 0 {
@absenceComponent(workDay.GetKurzArbeit(), true)
}
for _, booking := range workDay.Bookings {
@bookingComponent(booking)
}
<input type="hidden" name="select_kommen" value={ len(workDay.Bookings) > 0 && workDay.Bookings[len(workDay.Bookings)-1].CheckInOut%2 == 0 }/>
}
}
templ holidayComponent(d models.IWorkDay) {
<p>{ d.ToString() }</p>
}