Files
arbeitszeitmessung/Backend/templates/presencePage.templ
Tom Tröger ba034f1c33
Some checks failed
Tests / Run Go Tests (push) Failing after 1m35s
Arbeitszeitmessung Deploy / Build Webserver (push) Successful in 2m48s
feat: updated docs and added description to files
2026-01-29 18:28:28 +01:00

43 lines
1.3 KiB
Plaintext

package templates
// this file has all the templates for the /team/presence page
import "arbeitszeitmessung/models"
import "arbeitszeitmessung/helper"
templ TeamPresencePage(teamPresence map[models.User]bool) {
@BasePage()
@headerComponent()
<div class="grid-main divide-y-1">
<div class="grid-sub divide-x-1 bg-neutral-300">
<h2 class="grid-cell font-bold uppercase text-xl">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>
}
templ userPresenceComponent(user models.User, present bool) {
<div class="grid-cell group flex flex-row gap-2">
if present {
<div class="h-8 bg-accent rounded-md group-hover:text-black md:text-transparent text-center p-1">Anwesend</div>
} else {
<div class="h-8 bg-red-600 rounded-md group-hover:text-white md:text-transparent text-center p-1">Abwesend</div>
}
<p>{ user.Vorname } { user.Name }</p>
</div>
}