added public holidays + updated templ to v0.3.960
Some checks failed
Tests / Run Go Tests (push) Failing after 1m33s
Some checks failed
Tests / Run Go Tests (push) Failing after 1m33s
This commit is contained in:
@@ -143,9 +143,9 @@ func createReports(employes []models.User, startDate time.Time) []typstData {
|
|||||||
endDate := startDate.AddDate(0, 1, -1)
|
endDate := startDate.AddDate(0, 1, -1)
|
||||||
|
|
||||||
var employeData []typstData
|
var employeData []typstData
|
||||||
for _, employe := range employes {
|
for _, employee := range employes {
|
||||||
if data, err := createEmployeReport(employe, startDate, endDate); err != nil {
|
if data, err := createEmployeReport(employee, startDate, endDate); err != nil {
|
||||||
slog.Warn("Error when creating employeReport", slog.Any("user", employe), slog.Any("error", err))
|
slog.Warn("Error when creating employeReport", slog.Any("user", employee), slog.Any("error", err))
|
||||||
} else {
|
} else {
|
||||||
employeData = append(employeData, data)
|
employeData = append(employeData, data)
|
||||||
}
|
}
|
||||||
@@ -154,7 +154,8 @@ func createReports(employes []models.User, startDate time.Time) []typstData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createEmployeReport(employee models.User, startDate, endDate time.Time) (typstData, error) {
|
func createEmployeReport(employee models.User, startDate, endDate time.Time) (typstData, error) {
|
||||||
targetHoursThisMonth := employee.ArbeitszeitProWocheFrac(.2) * time.Duration(helper.GetWorkingDays(startDate, endDate))
|
publicHolidays, err := models.GetHolidaysFromTo(startDate, endDate)
|
||||||
|
targetHoursThisMonth := employee.ArbeitszeitProWocheFrac(.2) * time.Duration(helper.GetWorkingDays(startDate, endDate)-len(publicHolidays))
|
||||||
workDaysThisMonth := models.GetDays(employee, startDate, endDate.AddDate(0, 0, 1), false)
|
workDaysThisMonth := models.GetDays(employee, startDate, endDate.AddDate(0, 0, 1), false)
|
||||||
|
|
||||||
slog.Debug("Baseline Working hours", "targetHours", targetHoursThisMonth.Hours())
|
slog.Debug("Baseline Working hours", "targetHours", targetHoursThisMonth.Hours())
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ go 1.24.7
|
|||||||
|
|
||||||
require github.com/lib/pq v1.10.9
|
require github.com/lib/pq v1.10.9
|
||||||
|
|
||||||
require github.com/a-h/templ v0.3.943
|
require github.com/a-h/templ v0.3.960
|
||||||
|
|
||||||
require github.com/alexedwards/scs/v2 v2.8.0
|
require github.com/alexedwards/scs/v2 v2.8.0
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
|
|||||||
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
||||||
github.com/a-h/templ v0.3.943 h1:o+mT/4yqhZ33F3ootBiHwaY4HM5EVaOJfIshvd5UNTY=
|
github.com/a-h/templ v0.3.943 h1:o+mT/4yqhZ33F3ootBiHwaY4HM5EVaOJfIshvd5UNTY=
|
||||||
github.com/a-h/templ v0.3.943/go.mod h1:oCZcnKRf5jjsGpf2yELzQfodLphd2mwecwG4Crk5HBo=
|
github.com/a-h/templ v0.3.943/go.mod h1:oCZcnKRf5jjsGpf2yELzQfodLphd2mwecwG4Crk5HBo=
|
||||||
|
github.com/a-h/templ v0.3.960 h1:trshEpGa8clF5cdI39iY4ZrZG8Z/QixyzEyUnA7feTM=
|
||||||
|
github.com/a-h/templ v0.3.960/go.mod h1:oCZcnKRf5jjsGpf2yELzQfodLphd2mwecwG4Crk5HBo=
|
||||||
github.com/alexedwards/scs/v2 v2.8.0 h1:h31yUYoycPuL0zt14c0gd+oqxfRwIj6SOjHdKRZxhEw=
|
github.com/alexedwards/scs/v2 v2.8.0 h1:h31yUYoycPuL0zt14c0gd+oqxfRwIj6SOjHdKRZxhEw=
|
||||||
github.com/alexedwards/scs/v2 v2.8.0/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8=
|
github.com/alexedwards/scs/v2 v2.8.0/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8=
|
||||||
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
|
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
|
||||||
|
|||||||
@@ -26,10 +26,9 @@ func (p ParamsParser) ParseIntListFallback(key string, delimiter string, fallbac
|
|||||||
if !p.urlParams.Has(key) {
|
if !p.urlParams.Has(key) {
|
||||||
return fallback
|
return fallback
|
||||||
}
|
}
|
||||||
paramList := p.urlParams.Get(key)
|
paramList := p.urlParams[key]
|
||||||
list := strings.Split(paramList, delimiter)
|
|
||||||
parsedList := make([]int, 0)
|
parsedList := make([]int, 0)
|
||||||
for _, item := range list {
|
for _, item := range paramList {
|
||||||
if parsedItem, err := strconv.Atoi(item); err == nil {
|
if parsedItem, err := strconv.Atoi(item); err == nil {
|
||||||
parsedList = append(parsedList, parsedItem)
|
parsedList = append(parsedList, parsedItem)
|
||||||
}
|
}
|
||||||
|
|||||||
53
Backend/models/publicHoliday.go
Normal file
53
Backend/models/publicHoliday.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
type PublicHoliday struct {
|
||||||
|
name string
|
||||||
|
date time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetHolidaysFromTo(tsFrom, tsTo time.Time) ([]PublicHoliday, error) {
|
||||||
|
return make([]PublicHoliday, 0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Interface implementation
|
||||||
|
func (p *PublicHoliday) Date() time.Time {
|
||||||
|
return time.Now()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) ToString() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) IsWorkDay() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) IsKurzArbeit() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) GetDayProgress(User) int8 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) RequiresAction() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) GetWorktime(User, WorktimeBase, bool) time.Duration {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) GetPausetime(User, WorktimeBase, bool) time.Duration {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) GetTimes(User, WorktimeBase, bool) (work, pause, overtime time.Duration) {
|
||||||
|
return 0, 0, 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PublicHoliday) GetOvertime(User, WorktimeBase, bool) time.Duration {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by templ - DO NOT EDIT.
|
// Code generated by templ - DO NOT EDIT.
|
||||||
|
|
||||||
// templ: version: v0.3.943
|
// templ: version: v0.3.960
|
||||||
package templates
|
package templates
|
||||||
|
|
||||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by templ - DO NOT EDIT.
|
// Code generated by templ - DO NOT EDIT.
|
||||||
|
|
||||||
// templ: version: v0.3.943
|
// templ: version: v0.3.960
|
||||||
package templates
|
package templates
|
||||||
|
|
||||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||||
@@ -116,7 +116,6 @@ func SettingsPage(status int) templ.Component {
|
|||||||
templ_7745c5c3_Var4 = templ.NopComponent
|
templ_7745c5c3_Var4 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
user := ctx.Value("user").(models.User)
|
user := ctx.Value("user").(models.User)
|
||||||
templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer)
|
templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by templ - DO NOT EDIT.
|
// Code generated by templ - DO NOT EDIT.
|
||||||
|
|
||||||
// templ: version: v0.3.943
|
// templ: version: v0.3.960
|
||||||
package templates
|
package templates
|
||||||
|
|
||||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||||
@@ -130,7 +130,6 @@ func CheckboxComponent(pNr int, label string) templ.Component {
|
|||||||
templ_7745c5c3_Var5 = templ.NopComponent
|
templ_7745c5c3_Var5 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
id := fmt.Sprintf("pdf-%d", pNr)
|
id := fmt.Sprintf("pdf-%d", pNr)
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<div class=\"inline-flex items-center\"><label class=\"flex items-center cursor-pointer relative\" for=\"")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<div class=\"inline-flex items-center\"><label class=\"flex items-center cursor-pointer relative\" for=\"")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -290,7 +289,6 @@ func ColorDuration(d time.Duration, classes string) templ.Component {
|
|||||||
templ_7745c5c3_Var11 = templ.NopComponent
|
templ_7745c5c3_Var11 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
color := ""
|
color := ""
|
||||||
if d.Abs() < time.Minute {
|
if d.Abs() < time.Minute {
|
||||||
color = "text-neutral-300"
|
color = "text-neutral-300"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by templ - DO NOT EDIT.
|
// Code generated by templ - DO NOT EDIT.
|
||||||
|
|
||||||
// templ: version: v0.3.943
|
// templ: version: v0.3.960
|
||||||
package templates
|
package templates
|
||||||
|
|
||||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by templ - DO NOT EDIT.
|
// Code generated by templ - DO NOT EDIT.
|
||||||
|
|
||||||
// templ: version: v0.3.943
|
// templ: version: v0.3.960
|
||||||
package templates
|
package templates
|
||||||
|
|
||||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||||
@@ -37,7 +37,6 @@ func weekPicker(weekStart time.Time) templ.Component {
|
|||||||
templ_7745c5c3_Var1 = templ.NopComponent
|
templ_7745c5c3_Var1 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
year, kw := weekStart.ISOWeek()
|
year, kw := weekStart.ISOWeek()
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<form method=\"get\" class=\"flex flex-row gap-4 items-center justify-around\"><input type=\"date\" class=\"hidden\" name=\"submission_date\" value=\"")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<form method=\"get\" class=\"flex flex-row gap-4 items-center justify-around\"><input type=\"date\" class=\"hidden\" name=\"submission_date\" value=\"")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -177,7 +176,6 @@ func defaultWeekDayComponent(u models.User, day models.IWorkDay) templ.Component
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
if day.IsWorkDay() {
|
if day.IsWorkDay() {
|
||||||
|
|
||||||
workDay, _ := day.(*models.WorkDay)
|
workDay, _ := day.(*models.WorkDay)
|
||||||
work, pause, _ := workDay.GetTimes(u, models.WorktimeBaseDay, false)
|
work, pause, _ := workDay.GetTimes(u, models.WorktimeBaseDay, false)
|
||||||
if !workDay.RequiresAction() {
|
if !workDay.RequiresAction() {
|
||||||
@@ -260,7 +258,6 @@ func defaultWeekDayComponent(u models.User, day models.IWorkDay) templ.Component
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
absentDay, _ := day.(*models.Absence)
|
absentDay, _ := day.(*models.Absence)
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<div>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<div>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -344,7 +341,6 @@ func workWeekComponent(week models.WorkWeek, onlyAccept bool) templ.Component {
|
|||||||
templ_7745c5c3_Var15 = templ.NopComponent
|
templ_7745c5c3_Var15 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
year, kw := week.WeekStart.ISOWeek()
|
year, kw := week.WeekStart.ISOWeek()
|
||||||
progress := (float32(week.WorktimeVirtual.Hours()) / week.User.ArbeitszeitPerWoche) * 100
|
progress := (float32(week.WorktimeVirtual.Hours()) / week.User.ArbeitszeitPerWoche) * 100
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<div class=\"employeComponent grid-sub responsive lg:divide-x-1 max-md:divide-y-1 @container\"><div class=\"grid-cell flex flex-col max-md:bg-neutral-300 gap-2\">")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<div class=\"employeComponent grid-sub responsive lg:divide-x-1 max-md:divide-y-1 @container\"><div class=\"grid-cell flex flex-col max-md:bg-neutral-300 gap-2\">")
|
||||||
@@ -501,7 +497,6 @@ func workWeekComponent(week models.WorkWeek, onlyAccept bool) templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
|
|
||||||
week.CheckStatus()
|
week.CheckStatus()
|
||||||
method := "accept"
|
method := "accept"
|
||||||
if !onlyAccept {
|
if !onlyAccept {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by templ - DO NOT EDIT.
|
// Code generated by templ - DO NOT EDIT.
|
||||||
|
|
||||||
// templ: version: v0.3.943
|
// templ: version: v0.3.960
|
||||||
package templates
|
package templates
|
||||||
|
|
||||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||||
@@ -124,7 +124,6 @@ func timeGaugeComponent(progress int8, today bool) templ.Component {
|
|||||||
templ_7745c5c3_Var5 = templ.NopComponent
|
templ_7745c5c3_Var5 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
var bgColor string
|
var bgColor string
|
||||||
switch {
|
switch {
|
||||||
case (0 > progress):
|
case (0 > progress):
|
||||||
@@ -278,7 +277,6 @@ func absenceComponent(a *models.Absence, isKurzarbeit bool) templ.Component {
|
|||||||
templ_7745c5c3_Var13 = templ.NopComponent
|
templ_7745c5c3_Var13 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
editBox := ""
|
editBox := ""
|
||||||
if isKurzarbeit {
|
if isKurzarbeit {
|
||||||
editBox = "edit-box"
|
editBox = "edit-box"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by templ - DO NOT EDIT.
|
// Code generated by templ - DO NOT EDIT.
|
||||||
|
|
||||||
// templ: version: v0.3.943
|
// templ: version: v0.3.960
|
||||||
package templates
|
package templates
|
||||||
|
|
||||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||||
@@ -37,7 +37,6 @@ func TimePage(workDays []models.WorkDay, lastSub time.Time) templ.Component {
|
|||||||
templ_7745c5c3_Var1 = templ.NopComponent
|
templ_7745c5c3_Var1 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
allDays := ctx.Value("days").([]models.IWorkDay)
|
allDays := ctx.Value("days").([]models.IWorkDay)
|
||||||
templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer)
|
templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -104,7 +103,6 @@ func inputForm() templ.Component {
|
|||||||
templ_7745c5c3_Var2 = templ.NopComponent
|
templ_7745c5c3_Var2 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
urlParams := ctx.Value("urlParams").(url.Values)
|
urlParams := ctx.Value("urlParams").(url.Values)
|
||||||
user := ctx.Value("user").(models.User)
|
user := ctx.Value("user").(models.User)
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div class=\"grid-sub divide-x-1 bg-neutral-300 responsive\"><div class=\"grid-cell md:col-span-1 max-md:grid grid-cols-2\"><p class=\"font-bold uppercase\">")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div class=\"grid-sub divide-x-1 bg-neutral-300 responsive\"><div class=\"grid-cell md:col-span-1 max-md:grid grid-cols-2\"><p class=\"font-bold uppercase\">")
|
||||||
@@ -232,7 +230,6 @@ func defaultDayComponent(day models.IWorkDay) templ.Component {
|
|||||||
templ_7745c5c3_Var9 = templ.NopComponent
|
templ_7745c5c3_Var9 = templ.NopComponent
|
||||||
}
|
}
|
||||||
ctx = templ.ClearChildren(ctx)
|
ctx = templ.ClearChildren(ctx)
|
||||||
|
|
||||||
user := ctx.Value("user").(models.User)
|
user := ctx.Value("user").(models.User)
|
||||||
justify := "justify-center"
|
justify := "justify-center"
|
||||||
if day.IsWorkDay() && len(day.(*models.WorkDay).Bookings) > 1 {
|
if day.IsWorkDay() && len(day.(*models.WorkDay).Bookings) > 1 {
|
||||||
@@ -295,7 +292,6 @@ func defaultDayComponent(day models.IWorkDay) templ.Component {
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
if day.IsWorkDay() {
|
if day.IsWorkDay() {
|
||||||
|
|
||||||
workDay, _ := day.(*models.WorkDay)
|
workDay, _ := day.(*models.WorkDay)
|
||||||
work, pause, overtime := workDay.GetTimes(user, models.WorktimeBaseDay, true)
|
work, pause, overtime := workDay.GetTimes(user, models.WorktimeBaseDay, true)
|
||||||
work = workDay.GetWorktime(user, models.WorktimeBaseDay, false)
|
work = workDay.GetWorktime(user, models.WorktimeBaseDay, false)
|
||||||
@@ -416,7 +412,6 @@ func defaultDayComponent(day models.IWorkDay) templ.Component {
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
if day.IsWorkDay() {
|
if day.IsWorkDay() {
|
||||||
|
|
||||||
workDay, _ := day.(*models.WorkDay)
|
workDay, _ := day.(*models.WorkDay)
|
||||||
templ_7745c5c3_Err = newAbsenceComponent().Render(ctx, templ_7745c5c3_Buffer)
|
templ_7745c5c3_Err = newAbsenceComponent().Render(ctx, templ_7745c5c3_Buffer)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -457,7 +452,6 @@ func defaultDayComponent(day models.IWorkDay) templ.Component {
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
absentDay, _ := day.(*models.Absence)
|
absentDay, _ := day.(*models.Absence)
|
||||||
templ_7745c5c3_Err = absenceComponent(absentDay, false).Render(ctx, templ_7745c5c3_Buffer)
|
templ_7745c5c3_Err = absenceComponent(absentDay, false).Render(ctx, templ_7745c5c3_Buffer)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
|
|||||||
@@ -109,7 +109,12 @@ DROP TABLE IF EXISTS "s_feiertage";
|
|||||||
CREATE TABLE "s_feiertage" (
|
CREATE TABLE "s_feiertage" (
|
||||||
"counter_id" serial PRIMARY KEY NOT NULL,
|
"counter_id" serial PRIMARY KEY NOT NULL,
|
||||||
"datum" date NOT NULL,
|
"datum" date NOT NULL,
|
||||||
"name" varchar(100) NOT NULL,
|
"name" varchar(100) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE index feiertage_unique_pro_jahr on s_feiertage (
|
||||||
|
extract ( year from datum ),
|
||||||
|
name
|
||||||
);
|
);
|
||||||
|
|
||||||
-- Adds crypto extension
|
-- Adds crypto extension
|
||||||
|
|||||||
6
migrations/20251217215955_feiertage.down.sql
Normal file
6
migrations/20251217215955_feiertage.down.sql
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-- reverse: create index "feiertage_unique_pro_jahr" to table: "s_feiertage"
|
||||||
|
DROP INDEX "feiertage_unique_pro_jahr";
|
||||||
|
-- reverse: create "s_feiertage" table
|
||||||
|
DROP TABLE "s_feiertage";
|
||||||
|
-- reverse: set comment to column: "arbeitszeit_equivalent" on table: "s_abwesenheit_typen"
|
||||||
|
COMMENT ON COLUMN "s_abwesenheit_typen"."arbeitszeit_equivalent" IS '0=keine Arbeitszeit; 1=Arbeitszeit auffüllen; 2=Arbeitszeit austauschen';
|
||||||
11
migrations/20251217215955_feiertage.up.sql
Normal file
11
migrations/20251217215955_feiertage.up.sql
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
-- set comment to column: "arbeitszeit_equivalent" on table: "s_abwesenheit_typen"
|
||||||
|
COMMENT ON COLUMN "s_abwesenheit_typen"."arbeitszeit_equivalent" IS '0=keine Arbeitszeit; -1=Arbeitszeit auffüllen; <=1 - 100 => Arbeitszeit pro Tag prozentual';
|
||||||
|
-- create "s_feiertage" table
|
||||||
|
CREATE TABLE "s_feiertage" (
|
||||||
|
"counter_id" serial NOT NULL,
|
||||||
|
"datum" date NOT NULL,
|
||||||
|
"name" character varying(100) NOT NULL,
|
||||||
|
PRIMARY KEY ("counter_id")
|
||||||
|
);
|
||||||
|
-- create index "feiertage_unique_pro_jahr" to table: "s_feiertage"
|
||||||
|
CREATE UNIQUE INDEX "feiertage_unique_pro_jahr" ON "s_feiertage" ((EXTRACT(year FROM datum)), "name");
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
h1:gE7ikkZS7bQbedAjVspQKftSo5ODij2eiQGWbfQEYmI=
|
h1:1lrLZOm9nGe6v1/TrR1Ij8LBRDCY2igXwwUB+XqEIrc=
|
||||||
20250901201159_initial.up.sql h1:Mb1RlVdFvcxqU9HrSK6oNeURqFa3O4KzB3rDa+6+3gc=
|
20250901201159_initial.up.sql h1:Mb1RlVdFvcxqU9HrSK6oNeURqFa3O4KzB3rDa+6+3gc=
|
||||||
20250901201250_control_tables.up.sql h1:a5LATgR/CRiC4GsqxkJ94TyJOxeTcW74eCnodIy+c1E=
|
20250901201250_control_tables.up.sql h1:a5LATgR/CRiC4GsqxkJ94TyJOxeTcW74eCnodIy+c1E=
|
||||||
20250901201710_triggers_extension.up.sql h1:z9b6Hk9btE2Ns4mU7B16HjvYBP6EEwHAXVlvPpkn978=
|
20250901201710_triggers_extension.up.sql h1:z9b6Hk9btE2Ns4mU7B16HjvYBP6EEwHAXVlvPpkn978=
|
||||||
@@ -7,3 +7,4 @@ h1:gE7ikkZS7bQbedAjVspQKftSo5ODij2eiQGWbfQEYmI=
|
|||||||
20250904114004_intervals.up.sql h1:gDdN8cJ4xH1vQhAbbhqD5lwdyEO1N9EIqEYkmWGiWIU=
|
20250904114004_intervals.up.sql h1:gDdN8cJ4xH1vQhAbbhqD5lwdyEO1N9EIqEYkmWGiWIU=
|
||||||
20250916093608_kurzarbeit.up.sql h1:yDAAMLyUXz6b7+MI6XK/HZMPzutKoT2NNNOCjFaqSts=
|
20250916093608_kurzarbeit.up.sql h1:yDAAMLyUXz6b7+MI6XK/HZMPzutKoT2NNNOCjFaqSts=
|
||||||
20251013212224_buchungs_array.up.sql h1:mbhvnwMUkEFFQQ41NC47auqxbtvNkztziWvpLDFm6tA=
|
20251013212224_buchungs_array.up.sql h1:mbhvnwMUkEFFQQ41NC47auqxbtvNkztziWvpLDFm6tA=
|
||||||
|
20251217215955_feiertage.up.sql h1:PipbYvfL8YtsidgbJ3oEHYrmiNzffQ7veyaGAxINltE=
|
||||||
|
|||||||
Reference in New Issue
Block a user