working compound days + working public holidays
Some checks failed
Tests / Run Go Tests (push) Failing after 44s

This commit is contained in:
2025-12-24 01:38:16 +01:00
parent 3439fff841
commit 855cd6f34f
20 changed files with 1180 additions and 616 deletions

View File

@@ -1,6 +1,7 @@
package templates
import "arbeitszeitmessung/models"
import "arbeitszeitmessung/helper"
templ Base() {
<!DOCTYPE html>
@@ -29,9 +30,7 @@ templ LoginPage(success bool, errorMsg string) {
}
templ SettingsPage(status int) {
{{
user := ctx.Value("user").(models.User)
}}
{{ user := ctx.Value("user").(models.User) }}
@Base()
@headerComponent()
<div class="grid-main divide-y-1">
@@ -59,6 +58,8 @@ templ SettingsPage(status int) {
<div class="grid-cell col-span-3">
<p>Nutzername: <span class="text-neutral-500">{ user.Vorname } { user.Name }</span></p>
<p>Personalnummer: <span class="text-neutral-500">{ user.PersonalNummer }</span></p>
<p>Arbeitszeit pro Tag: <span class="text-neutral-500">{ helper.FormatDuration(user.ArbeitszeitProTag()) }</span></p>
<p>Arbeitszeit pro Woche: <span class="text-neutral-500">{ helper.FormatDuration(user.ArbeitszeitProWoche()) }</span></p>
</div>
<div></div>
</div>
@@ -82,27 +83,6 @@ templ statusCheckMark(status models.WeekStatus, target models.WeekStatus) {
}
}
templ TeamPage(weeks []models.WorkWeek, userWeek models.WorkWeek) {
@Base()
@headerComponent()
<div class="grid-main divide-y-1">
<div class="grid-sub lg:divide-x-1 max-md:divide-y-1 responsive @container">
<div class="grid-cell col-span-full bg-neutral-300 lg:border-0">
<h2 class="text-xl uppercase font-bold">Eigene Abrechnung</h2>
</div>
</div>
@workWeekComponent(userWeek, false)
if len(weeks) > 0 {
<div class="grid-cell col-span-full bg-neutral-300">
<h2 class="text-xl uppercase font-bold">Abrechnung Mitarbeiter</h2>
</div>
}
for _, week := range weeks {
@workWeekComponent(week, true)
}
</div>
}
templ LogoutButton() {
<button onclick="logoutUser()" type="button" class="cursor-pointer">Abmelden</button>
}