feat: updated docs and added description to files
This commit is contained in:
@@ -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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user