feat: updated docs and added description to files
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package templates
|
||||
|
||||
// this file has all the templates for the team/report page
|
||||
|
||||
import (
|
||||
"arbeitszeitmessung/helper"
|
||||
"arbeitszeitmessung/models"
|
||||
@@ -8,8 +10,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
templ TeamPage(weeks []models.WorkWeek, userWeek models.WorkWeek) {
|
||||
@Base()
|
||||
templ ReportPage(weeks []models.WorkWeek, userWeek models.WorkWeek) {
|
||||
@BasePage()
|
||||
@headerComponent()
|
||||
<div class="grid-main divide-y-1 @container">
|
||||
<div class="grid-sub lg:divide-x-1 max-md:divide-y-1 responsive">
|
||||
@@ -144,3 +146,39 @@ templ weekDayTypeSwitcher(day models.IWorkDay) {
|
||||
<div>{ day.ToString() }</div>
|
||||
}
|
||||
}
|
||||
|
||||
templ weekPicker(weekStart time.Time) {
|
||||
{{ year, kw := weekStart.ISOWeek() }}
|
||||
<form method="get" class="flex flex-row gap-4 items-center justify-around">
|
||||
<input type="date" class="hidden" name="submission_date" value={ weekStart.Format(time.DateOnly) }/>
|
||||
<button onclick={ templ.JSFuncCall("navigateWeek", templ.JSExpression("this"), templ.JSExpression("event"), "-1") } class="btn">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="chevron-left size-4 mx-auto" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"></path>
|
||||
</svg>
|
||||
</button>
|
||||
<p class="whitespace-nowrap">KW { fmt.Sprintf("%02d, %d", kw, year) }</p>
|
||||
<button disabled?={ time.Since(weekStart) < 24*7*time.Hour } onclick={ templ.JSFuncCall("navigateWeek", templ.JSExpression("this"), templ.JSExpression("event"), "1") } class="btn disabled:pointer-events-none disabled:opacity-50">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="chevron-right size-4 mx-auto" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
}
|
||||
|
||||
templ workDayWeekComponent(workDay *models.WorkDay) {
|
||||
if !workDay.RequiresAction() {
|
||||
<div class="flex flex-row gap-2 items-center">
|
||||
<span class="icon-[material-symbols-light--schedule-outline] flex-shrink-0"></span>
|
||||
switch {
|
||||
case !workDay.TimeFrom.Equal(workDay.TimeTo):
|
||||
<span>{ workDay.TimeFrom.Format("15:04") }</span>
|
||||
<span>-</span>
|
||||
<span>{ workDay.TimeTo.Format("15:04") }</span>
|
||||
default:
|
||||
<p>Keine Anwesenheit</p>
|
||||
}
|
||||
</div>
|
||||
} else {
|
||||
<p class="text-red-600">Bitte anpassen</p>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user