This commit is contained in:
@@ -53,8 +53,10 @@ func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay
|
||||
}
|
||||
if day.AbwesenheitTyp.WorkTime == 1 {
|
||||
if workDay, ok := allDays[day.Date().Format("2006-01-02")].(*WorkDay); ok {
|
||||
workDay.kurzArbeit = true
|
||||
workDay.kurzArbeitAbsence = day
|
||||
if len(workDay.Bookings) > 0 {
|
||||
workDay.kurzArbeit = true
|
||||
workDay.kurzArbeitAbsence = day
|
||||
}
|
||||
}
|
||||
} else {
|
||||
allDays[day.Date().Format("2006-01-02")] = &day
|
||||
|
||||
@@ -15,9 +15,7 @@ function editWorkday(element, event, id, isWorkDay) {
|
||||
event.preventDefault();
|
||||
let form = document.getElementById(id);
|
||||
if (form == null) {
|
||||
form = element
|
||||
.closest(".grid-sub")
|
||||
.querySelector(".all-booking-component > form");
|
||||
form = element.closest(".grid-sub").querySelector(".all-booking-component > form");
|
||||
}
|
||||
|
||||
clearEditState();
|
||||
@@ -39,21 +37,10 @@ function editWorkday(element, event, id, isWorkDay) {
|
||||
const absenceForm = document.getElementById("absence_form");
|
||||
|
||||
if (id == 0) {
|
||||
absenceForm.querySelector("[name=date_from]").value = form.id.replace(
|
||||
"time-",
|
||||
"",
|
||||
);
|
||||
absenceForm.querySelector("[name=date_to]").value = form.id.replace(
|
||||
"time-",
|
||||
"",
|
||||
);
|
||||
absenceForm.querySelector("[name=date_from]").value = form.id.replace("time-", "");
|
||||
absenceForm.querySelector("[name=date_to]").value = form.id.replace("time-", "");
|
||||
} else {
|
||||
syncFields(form, absenceForm, [
|
||||
"date_from",
|
||||
"date_to",
|
||||
"aw_type",
|
||||
"aw_id",
|
||||
]);
|
||||
syncFields(form, absenceForm, ["date_from", "date_to", "aw_type", "aw_id"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.3.943
|
||||
// templ: version: v0.3.924
|
||||
package templates
|
||||
|
||||
//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.
|
||||
|
||||
// templ: version: v0.3.943
|
||||
// templ: version: v0.3.924
|
||||
package templates
|
||||
|
||||
//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.
|
||||
|
||||
// templ: version: v0.3.943
|
||||
// templ: version: v0.3.924
|
||||
package templates
|
||||
|
||||
//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.
|
||||
|
||||
// templ: version: v0.3.943
|
||||
// templ: version: v0.3.924
|
||||
package templates
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
@@ -89,7 +89,7 @@ templ absenceComponent(a *models.Absence, isKurzarbeit bool) {
|
||||
</p>
|
||||
<div class="w-full"></div>
|
||||
if isKurzarbeit {
|
||||
<button onclick={ templ.JSFuncCall("editAbsence", templ.JSExpression("this"), templ.JSExpression("event"), "time-"+a.Date().Format("2006-01-02")) } class="hidden btn border-0 rounded-none grow-0 w-auto group-[.edit]:inline">Bearbeiten</button>
|
||||
<button type="button" onclick={ templ.JSFuncCall("editWorkday", templ.JSExpression("this"), templ.JSExpression("event"), "time-"+a.Date().Format("2006-01-02"), false) } class="hidden btn border-0 rounded-none grow-0 w-auto group-[.edit]:inline">Bearbeiten</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.3.943
|
||||
// templ: version: v0.3.924
|
||||
package templates
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
@@ -394,15 +394,15 @@ func absenceComponent(a *models.Absence, isKurzarbeit bool) templ.Component {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if isKurzarbeit {
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, templ.JSFuncCall("editAbsence", templ.JSExpression("this"), templ.JSExpression("event"), "time-"+a.Date().Format("2006-01-02")))
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, templ.JSFuncCall("editWorkday", templ.JSExpression("this"), templ.JSExpression("event"), "time-"+a.Date().Format("2006-01-02"), false))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<button onclick=\"")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<button type=\"button\" onclick=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var22 templ.ComponentScript = templ.JSFuncCall("editAbsence", templ.JSExpression("this"), templ.JSExpression("event"), "time-"+a.Date().Format("2006-01-02"))
|
||||
var templ_7745c5c3_Var22 templ.ComponentScript = templ.JSFuncCall("editWorkday", templ.JSExpression("this"), templ.JSExpression("event"), "time-"+a.Date().Format("2006-01-02"), false)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.3.943
|
||||
// templ: version: v0.3.924
|
||||
package templates
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
Reference in New Issue
Block a user