separaded endpoints + cleaned page templates + added constants to time formatting
Some checks failed
Tests / Run Go Tests (push) Failing after 1m34s
Some checks failed
Tests / Run Go Tests (push) Failing after 1m34s
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package templates
|
||||
|
||||
import "arbeitszeitmessung/models"
|
||||
import "arbeitszeitmessung/helper"
|
||||
|
||||
templ Base() {
|
||||
<!DOCTYPE html>
|
||||
@@ -29,7 +28,7 @@ templ LoginPage(success bool, errorMsg string) {
|
||||
</div>
|
||||
}
|
||||
|
||||
templ UserPage(status int) {
|
||||
templ SettingsPage(status int) {
|
||||
{{
|
||||
user := ctx.Value("user").(models.User)
|
||||
}}
|
||||
@@ -89,13 +88,13 @@ templ TeamPage(weeks []models.WorkWeek, userWeek models.WorkWeek) {
|
||||
<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-2xl uppercase font-bold">Eigene Abrechnung</h2>
|
||||
<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-2xl uppercase font-bold">Abrechnung Mitarbeiter</h2>
|
||||
<h2 class="text-xl uppercase font-bold">Abrechnung Mitarbeiter</h2>
|
||||
</div>
|
||||
}
|
||||
for _, week := range weeks {
|
||||
@@ -104,39 +103,6 @@ templ TeamPage(weeks []models.WorkWeek, userWeek models.WorkWeek) {
|
||||
</div>
|
||||
}
|
||||
|
||||
templ TeamPresencePage(teamPresence map[models.User]bool) {
|
||||
@Base()
|
||||
@headerComponent()
|
||||
<div class="grid-main divide-y-1">
|
||||
<div class="grid-sub divide-x-1">
|
||||
<h2 class="grid-cell font-bold uppercase">Mitarbeiter</h2>
|
||||
</div>
|
||||
for user, present := range teamPresence {
|
||||
<div class="grid-sub">
|
||||
<div class="grid-cell flex flex-row gap-2 col-span-2 md:col-span-1">
|
||||
@timeGaugeComponent(helper.BoolToInt8(present)*100-1, false)
|
||||
<p>{ user.Vorname } { user.Name }</p>
|
||||
</div>
|
||||
<div class="grid-cell col-span-2">
|
||||
if present {
|
||||
<span class="text-neutral-500">Anwesend</span>
|
||||
} else {
|
||||
<span class="text-neutral-500">Abwesend</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
// <div class="grid-sub divide-x-1">
|
||||
// <h2 class="grid-cell font-bold uppercase">Nicht Anwesend</h2>
|
||||
// <div class="flex flex-col col-span-2 md:col-span-4">
|
||||
// for _, user := range teamPresence[false] {
|
||||
// @userPresenceComponent(user, false)
|
||||
// }
|
||||
// </div>
|
||||
// </div>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ LogoutButton() {
|
||||
<button onclick="logoutUser()" type="button" class="cursor-pointer">Abmelden</button>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user