removed and refactored virtual and real worktime
This commit is contained in:
@@ -36,7 +36,7 @@ templ defaultWeekDayComponent(u models.User, day models.IWorkDay) {
|
||||
if day.IsWorkDay() {
|
||||
{{
|
||||
workDay, _ := day.(*models.WorkDay)
|
||||
work, pause, _ := workDay.GetTimesReal(u, models.WorktimeBaseDay)
|
||||
work, pause, _ := workDay.GetTimes(u, models.WorktimeBaseDay, false)
|
||||
}}
|
||||
if !workDay.RequiresAction() {
|
||||
<div class="flex flex-row gap-2">
|
||||
@@ -81,7 +81,7 @@ templ weekDayComponent(user models.User, day models.WorkDay) {
|
||||
templ workWeekComponent(week models.WorkWeek, onlyAccept bool) {
|
||||
{{
|
||||
year, kw := week.WeekStart.ISOWeek()
|
||||
progress := (float32(week.WorkTimeVirtual.Hours()) / week.User.ArbeitszeitPerWoche) * 100
|
||||
progress := (float32(week.WorktimeVirtual.Hours()) / week.User.ArbeitszeitPerWoche) * 100
|
||||
}}
|
||||
<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">
|
||||
|
||||
@@ -179,7 +179,7 @@ func defaultWeekDayComponent(u models.User, day models.IWorkDay) templ.Component
|
||||
if day.IsWorkDay() {
|
||||
|
||||
workDay, _ := day.(*models.WorkDay)
|
||||
work, pause, _ := workDay.GetTimesReal(u, models.WorktimeBaseDay)
|
||||
work, pause, _ := workDay.GetTimes(u, models.WorktimeBaseDay, false)
|
||||
if !workDay.RequiresAction() {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<div class=\"flex flex-row gap-2\"><span class=\"text-accent\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -346,7 +346,7 @@ func workWeekComponent(week models.WorkWeek, onlyAccept bool) templ.Component {
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
|
||||
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\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
||||
@@ -103,8 +103,8 @@ templ defaultDayComponent(day models.IWorkDay) {
|
||||
if day.IsWorkDay() {
|
||||
{{
|
||||
workDay, _ := day.(*models.WorkDay)
|
||||
work, pause, overtime := workDay.GetTimesVirtual(user, models.WorktimeBaseDay)
|
||||
work = workDay.GetWorktimeReal(user, models.WorktimeBaseDay)
|
||||
work, pause, overtime := workDay.GetTimes(user, models.WorktimeBaseDay, true)
|
||||
work = workDay.GetWorktime(user, models.WorktimeBaseDay, false)
|
||||
}}
|
||||
if day.RequiresAction() {
|
||||
<p class="text-red-600">Bitte anpassen</p>
|
||||
|
||||
@@ -297,8 +297,8 @@ func defaultDayComponent(day models.IWorkDay) templ.Component {
|
||||
if day.IsWorkDay() {
|
||||
|
||||
workDay, _ := day.(*models.WorkDay)
|
||||
work, pause, overtime := workDay.GetTimesVirtual(user, models.WorktimeBaseDay)
|
||||
work = workDay.GetWorktimeReal(user, models.WorktimeBaseDay)
|
||||
work, pause, overtime := workDay.GetTimes(user, models.WorktimeBaseDay, true)
|
||||
work = workDay.GetWorktime(user, models.WorktimeBaseDay, false)
|
||||
if day.RequiresAction() {
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<p class=\"text-red-600\">Bitte anpassen</p>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
Reference in New Issue
Block a user