working on printable PDF Forms
All checks were successful
Tests / Run Go Tests (push) Successful in 30s
All checks were successful
Tests / Run Go Tests (push) Successful in 30s
This commit is contained in:
46
Backend/templates/pdf.templ
Normal file
46
Backend/templates/pdf.templ
Normal file
@@ -0,0 +1,46 @@
|
||||
package templates
|
||||
|
||||
import (
|
||||
"arbeitszeitmessung/helper"
|
||||
"arbeitszeitmessung/models"
|
||||
"time"
|
||||
)
|
||||
|
||||
templ PDFReportEmploye(e models.User, workDays []models.WorkDay, tsStart time.Time, tsEnd time.Time) {
|
||||
{{
|
||||
_, kw := tsStart.ISOWeek()
|
||||
}}
|
||||
@Base()
|
||||
<content class="p-8 relative flex flex-col gap-4">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">Kim Mustermensch</h1>
|
||||
<p>Zeitraum: <span>{ tsStart.Format("02.01.2006") }</span> - <span>{ tsEnd.Format("02.01.2006") }</span></p>
|
||||
<p>Arbeitszeit: <span></span></p>
|
||||
<p>Überstunden: <span></span></p>
|
||||
</div>
|
||||
<div class="grid grid-rows-6 grid-cols-[auto_1fr_1fr_1fr_1fr_1fr] divide-x-1 divide-y-1">
|
||||
<p class="px-2 ">KW</p>
|
||||
<p class="px-2 text-center">Montag</p>
|
||||
<p class="px-2 text-center">Dienstag</p>
|
||||
<p class="px-2 text-center">Mittwoche</p>
|
||||
<p class="px-2 text-center">Donnerstag</p>
|
||||
<p class="px-2 text-center">Freitag</p>
|
||||
// <p class="px-2 text-center">Samstag</p>
|
||||
<p>{ kw }</p>
|
||||
for d := time.Monday; d < tsStart.Weekday(); d++ {
|
||||
<p></p>
|
||||
}
|
||||
for _, day := range workDays {
|
||||
if day.Day.Weekday() == time.Monday {
|
||||
<p>{ helper.GetKW(day.Day) } </p>
|
||||
}
|
||||
<div class="flex flex-col gap-2">
|
||||
<p>{ helper.GetFirst(day.GetWorkTimeString()) }</p>
|
||||
for i := 0; i < len(day.Bookings); i += 2 {
|
||||
<p>{ day.Bookings[i].Timestamp.Format("15:04") } - { day.Bookings[i+1].Timestamp.Format("15:04") }</p>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</content>
|
||||
}
|
||||
Reference in New Issue
Block a user