Compare commits
20 Commits
9e5dc760d5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| ea8e78fd9f | |||
| 6da58d6753 | |||
| 89eb5d255d | |||
| 1b8fb747e8 | |||
| 74cded42d8 | |||
| 22350142fc | |||
| 659fb80049 | |||
| cbc4028f8d | |||
| e4d423385a | |||
| c9c2d801b0 | |||
| 94c7c8a36e | |||
| d69ec600cd | |||
| 95d5c4ab9d | |||
| bf841ad5c6 | |||
| a1aae9dc56 | |||
| 750fb1ff58 | |||
| f4e9915e7f | |||
| 18046bbe18 | |||
| 75929e3b7d | |||
| 627f5b7e5b |
@@ -23,7 +23,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
with:
|
||||
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||
fetch-depth: 0
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
@@ -45,4 +47,25 @@ jobs:
|
||||
restore-keys: |-
|
||||
arbeitszeitmessung-
|
||||
- name: Run Go Tests
|
||||
run: cd Backend && go test ./...
|
||||
run: cd Backend && mkdir .test && go test ./... -coverprofile=.test/coverage.out -json > .test/report.json
|
||||
- name: Verify coverage report exists
|
||||
run: |
|
||||
if [ -f "Backend/.test/coverage.out" ]; then
|
||||
echo "Coverage report found"
|
||||
else
|
||||
echo "Coverage report not found"
|
||||
fi
|
||||
- uses: SonarSource/sonarqube-scan-action@v6
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
with:
|
||||
projectBaseDir: Backend
|
||||
args: >
|
||||
-Dsonar.projectVersion=${{ gitea.sha_short }}
|
||||
- uses: SonarSource/sonarqube-quality-gate-action@v1
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
with:
|
||||
scanMetadataReportFile: Backend/.scannerwork/report-task.txt
|
||||
|
||||
@@ -13,7 +13,7 @@ RUN go mod download && go mod verify
|
||||
COPY . .
|
||||
RUN go build -o server .
|
||||
|
||||
FROM alpine
|
||||
FROM alpine:3.22
|
||||
RUN apk add --no-cache tzdata
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/server /app/server
|
||||
|
||||
@@ -127,6 +127,7 @@ func updateBooking(w http.ResponseWriter, r *http.Request) {
|
||||
log.Println("No user found!", err)
|
||||
return
|
||||
}
|
||||
|
||||
switch r.FormValue("action") {
|
||||
case "add":
|
||||
timestamp, err := time.ParseInLocation("2006-01-02|15:04", r.FormValue("date")+"|"+r.FormValue("timestamp"), loc)
|
||||
@@ -149,14 +150,14 @@ func updateBooking(w http.ResponseWriter, r *http.Request) {
|
||||
log.Printf("Error inserting booking %v -> %v\n", newBooking, err)
|
||||
}
|
||||
case "change":
|
||||
absenceType, err := strconv.Atoi(r.FormValue("absence"))
|
||||
if err != nil {
|
||||
log.Println("Error parsing absence type.", err)
|
||||
absenceType = 0
|
||||
}
|
||||
if absenceType != 0 {
|
||||
createAbsence(absenceType, user, loc, r)
|
||||
}
|
||||
// absenceType, err := strconv.Atoi(r.FormValue("absence"))
|
||||
// if err != nil {
|
||||
// log.Println("Error parsing absence type.", err)
|
||||
// absenceType = 0
|
||||
// }
|
||||
// if absenceType != 0 {
|
||||
// createAbsence(absenceType, user, loc, r)
|
||||
// }
|
||||
for index, possibleBooking := range r.PostForm {
|
||||
if len(index) > 7 && index[:7] == "booking" {
|
||||
booking_id, err := strconv.Atoi(index[8:])
|
||||
@@ -174,10 +175,11 @@ func updateBooking(w http.ResponseWriter, r *http.Request) {
|
||||
log.Println("Error parsing time!", err)
|
||||
continue
|
||||
}
|
||||
// log.Println("Parsing time", parsedTime)
|
||||
booking.UpdateTime(parsedTime)
|
||||
}
|
||||
}
|
||||
default:
|
||||
log.Println("No action from /time found")
|
||||
}
|
||||
getBookings(w, r)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -84,6 +86,7 @@ func (d *WorkDay) TimeWorkVirtual(u User) time.Duration {
|
||||
if d.IsKurzArbeit() {
|
||||
return u.ArbeitszeitProTag()
|
||||
}
|
||||
|
||||
return d.workTime
|
||||
}
|
||||
|
||||
|
||||
@@ -45,11 +45,15 @@ func NewWorkWeek(user User, tsMonday time.Time, populate bool) WorkWeek {
|
||||
}
|
||||
|
||||
func (w *WorkWeek) PopulateWithDays(worktime time.Duration, overtime time.Duration) {
|
||||
log.Println("Got Days with overtime and worktime", worktime, overtime)
|
||||
w.Days = GetDays(w.User, w.WeekStart, w.WeekStart.Add(6*24*time.Hour), false)
|
||||
log.Println(w.Worktime)
|
||||
|
||||
for _, day := range w.Days {
|
||||
log.Println(day.TimeWorkVirtual(w.User))
|
||||
w.Worktime += day.TimeWorkVirtual(w.User)
|
||||
}
|
||||
log.Println("Calculated new worktime", w.Worktime)
|
||||
w.Overtime = w.Worktime - w.User.ArbeitszeitProWoche()
|
||||
|
||||
w.Worktime = w.Worktime.Round(time.Minute)
|
||||
@@ -127,12 +131,13 @@ func (w *WorkWeek) GetSendWeeks(user User) []WorkWeek {
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
var week WorkWeek = WorkWeek{User: user}
|
||||
if err := rows.Scan(&week.Id, &week.WeekStart, &week.Worktime, &week.Overtime); err != nil {
|
||||
var workTime, overTime time.Duration
|
||||
if err := rows.Scan(&week.Id, &week.WeekStart, &workTime, &overTime); err != nil {
|
||||
log.Println("Error scanning row!", err)
|
||||
return weeks
|
||||
}
|
||||
|
||||
week.PopulateWithDays(week.Worktime, week.Overtime)
|
||||
week.PopulateWithDays(workTime, overTime)
|
||||
weeks = append(weeks, week)
|
||||
}
|
||||
if err = rows.Err(); err != nil {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
sonar.projectKey=Arbeitszeitmessung
|
||||
sonar.projectKey=arbeitszeitmessung
|
||||
sonar.sources=.
|
||||
sonar.exclusions=**/*_test.go
|
||||
sonar.exclusions=**/*_test.go, **/*_templ.go
|
||||
|
||||
sonar.tests=.
|
||||
sonar.test.inclusions=**/*_test.go
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
function clearEditState() {
|
||||
for (e of document.querySelectorAll(".edit")) {
|
||||
for (let e of document.querySelectorAll(".edit")) {
|
||||
e.classList.remove("edit");
|
||||
}
|
||||
toggleAbsenceEdit(false);
|
||||
}
|
||||
|
||||
function clearButtonState() {
|
||||
for (let b of document.querySelectorAll(".change-button-component")) {
|
||||
b.type = "button";
|
||||
}
|
||||
}
|
||||
|
||||
function editWorkday(element, event, id, isWorkDay) {
|
||||
console.log("editWorkday called", isWorkDay);
|
||||
event.preventDefault();
|
||||
var form = document.getElementById(id);
|
||||
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();
|
||||
@@ -21,38 +24,29 @@ function editWorkday(element, event, id, isWorkDay) {
|
||||
|
||||
if (isWorkDay) {
|
||||
element.classList.add("edit");
|
||||
if (element.classList.contains("edit")) {
|
||||
form.querySelectorAll("input, select").forEach((input) => {
|
||||
if (element.type == "button") {
|
||||
for (let input of form.querySelectorAll("input, select")) {
|
||||
input.disabled = false;
|
||||
});
|
||||
}
|
||||
clearButtonState();
|
||||
element.type = "submit";
|
||||
} else {
|
||||
form.submit();
|
||||
}
|
||||
} else {
|
||||
var absenceForm = document.getElementById("absence_form");
|
||||
const absenceForm = document.getElementById("absence_form");
|
||||
|
||||
if (id != 0) {
|
||||
syncFields(form, absenceForm, [
|
||||
"date_from",
|
||||
"date_to",
|
||||
"aw_type",
|
||||
"aw_id",
|
||||
]);
|
||||
if (id == 0) {
|
||||
absenceForm.querySelector("[name=date_from]").value = form.id.replace("time-", "");
|
||||
absenceForm.querySelector("[name=date_to]").value = form.id.replace("time-", "");
|
||||
} else {
|
||||
absenceForm.querySelector("[name=date_from]").value = form.id.replace(
|
||||
"time-",
|
||||
"",
|
||||
);
|
||||
absenceForm.querySelector("[name=date_to]").value = form.id.replace(
|
||||
"time-",
|
||||
"",
|
||||
);
|
||||
syncFields(form, absenceForm, ["date_from", "date_to", "aw_type", "aw_id"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAbsenceEdit(state) {
|
||||
var form = document.getElementById("absence_form");
|
||||
const form = document.getElementById("absence_form");
|
||||
if (state) {
|
||||
form.classList.remove("hidden");
|
||||
form.scrollIntoView({
|
||||
@@ -66,22 +60,22 @@ function toggleAbsenceEdit(state) {
|
||||
}
|
||||
|
||||
function syncFields(from, to, fieldsToSync) {
|
||||
fieldsToSync.forEach((name) => {
|
||||
const src = from.querySelector(`[name=${name}]`);
|
||||
const target = to.querySelector(`[name=${name}]`);
|
||||
for (let field of fieldsToSync) {
|
||||
const src = from.querySelector(`[name=${field}]`);
|
||||
const target = to.querySelector(`[name=${field}]`);
|
||||
if (!src || !target) return;
|
||||
target.value = src.value;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function navigateWeek(element, event, direction) {
|
||||
var dateInput = element.closest("form").querySelector("input[type=date]");
|
||||
var date = dateInput.valueAsDate;
|
||||
const dateInput = element.closest("form").querySelector("input[type=date]");
|
||||
const date = dateInput.valueAsDate;
|
||||
date.setDate(date.getDate() + 7 * direction);
|
||||
date.setHours(10);
|
||||
dateInput.valueAsDate = date;
|
||||
}
|
||||
|
||||
function logoutUser() {
|
||||
fetch("/user/logout", {}).then(() => window.location.reload());
|
||||
fetch("/user/logout", {}).then(() => globalThis.location.reload());
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -93,61 +93,6 @@ templ TeamPage(weeks []models.WorkWeek, userWeek models.WorkWeek) {
|
||||
</div>
|
||||
</div>
|
||||
@workWeekComponent(userWeek, false)
|
||||
// <div class="grid-sub lg:divide-x-1 max-md:divide-y-1 responsive @container">
|
||||
// <div class="grid-cell col-span-full bg-neutral-300 lg:border-0">
|
||||
// <h2 class="text-2xl uppercase font-bold">Eigene Abrechnung</h2>
|
||||
// </div>
|
||||
// <div class="grid-cell flex flex-col max-md:border-b-1 max-md:bg-neutral-300 gap-2 ">
|
||||
// <div class="lg:hidden">
|
||||
// @weekPicker(userWeek.WeekStart)
|
||||
// </div>
|
||||
// <h2 class="uppercase font-bold">{ fmt.Sprintf("%s %s", userWeek.User.Vorname, userWeek.User.Name) }</h2>
|
||||
// <div class="grid grid-cols-5 gap-2 lg:grid-cols-1">
|
||||
// <div class="col-span-2">
|
||||
// <span class="flex flex-row gap-2 items-center">
|
||||
// @statusCheckMark(userWeek.CheckStatus(), models.WeekStatusSent)
|
||||
// Gesendet
|
||||
// </span>
|
||||
// <span class="flex flex-row gap-2 items-center">
|
||||
// @statusCheckMark(userWeek.CheckStatus(), models.WeekStatusAccepted)
|
||||
// Akzeptiert
|
||||
// </span>
|
||||
// </div>
|
||||
// <div class="flex flex-row gap-2 col-span-3">
|
||||
// @timeGaugeComponent(int8(progress), false)
|
||||
// <div>
|
||||
// <p>Arbeitszeit: { fmt.Sprintf("%s", helper.FormatDuration(userWeek.Worktime)) }</p>
|
||||
// <p>Überstunden: { fmt.Sprintf("%s", helper.FormatDurationFill(userWeek.Overtime, true)) }</p>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// <div class="grid-cell col-span-3 flex flex-col @7xl:grid @7xl:grid-cols-5 gap-2 py-4 content-baseline">
|
||||
// for _, day := range userWeek.Days {
|
||||
// @defaultWeekDayComponent(userWeek.User, day)
|
||||
// }
|
||||
// </div>
|
||||
// <div class="grid-cell flex flex-col gap-2 justify-between">
|
||||
// <div class="max-md:hidden">
|
||||
// @weekPicker(userWeek.WeekStart)
|
||||
// </div>
|
||||
// <form method="post" class="flex flex-col gap-2">
|
||||
// <input type="hidden" name="method" value="send"/>
|
||||
// <input type="hidden" name="user" value={ strconv.Itoa(userWeek.User.PersonalNummer) }/>
|
||||
// <input type="hidden" name="week" value={ userWeek.WeekStart.Format(time.DateOnly) }/>
|
||||
// switch userWeek.CheckStatus() {
|
||||
// case models.WeekStatusNone:
|
||||
// <p class="text-sm">an Vorgesetzten senden</p>
|
||||
// case models.WeekStatusSent:
|
||||
// <p class="text-sm">an Vorgesetzten gesendet</p>
|
||||
// case models.WeekStatusAccepted:
|
||||
// <p class="text-sm">vom Vorgesetzten bestätigt</p>
|
||||
// }
|
||||
// <button disabled?={ userWeek.Status < models.WeekStatusSent } type="submit" class="btn">Korrigieren</button>
|
||||
// <button disabled?={ time.Since(userWeek.WeekStart) < 24*7*time.Hour || userWeek.Status >= models.WeekStatusSent || userWeek.RequiresAction() } type="submit" class="btn">Senden</button>
|
||||
// </form>
|
||||
// </div>
|
||||
// </div>
|
||||
if len(weeks) > 0 {
|
||||
<div class="grid-cell col-span-full bg-neutral-300">
|
||||
<h2 class="text-2xl uppercase font-bold">Abrechnung Mitarbeiter</h2>
|
||||
|
||||
@@ -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.
|
||||
@@ -337,7 +337,7 @@ func TeamPresencePage(teamPresence map[models.User]bool) templ.Component {
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(user.Vorname)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pages.templ`, Line: 173, Col: 22}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pages.templ`, Line: 118, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -350,7 +350,7 @@ func TeamPresencePage(teamPresence map[models.User]bool) templ.Component {
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(user.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pages.templ`, Line: 173, Col: 36}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/pages.templ`, Line: 118, Col: 36}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -20,7 +20,7 @@ templ lineComponent() {
|
||||
}
|
||||
|
||||
templ changeButtonComponent(id string, workDay bool) {
|
||||
<button class="btn w-auto group/button" type="submit" onclick={ templ.JSFuncCall("editWorkday", templ.JSExpression("this"), templ.JSExpression("event"), id, workDay) }>
|
||||
<button class="change-button-component btn w-auto group/button" type="button" onclick={ templ.JSFuncCall("editWorkday", templ.JSExpression("this"), templ.JSExpression("event"), id, workDay) }>
|
||||
<p class="hidden md:block group-[.edit]/button:hidden">Ändern</p>
|
||||
<p class="hidden group-[.edit]/button:md:block">Absenden</p>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4 md:hidden">
|
||||
@@ -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.
|
||||
@@ -69,7 +69,7 @@ func changeButtonComponent(id string, workDay bool) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<button class=\"btn w-auto group/button\" type=\"submit\" onclick=\"")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "<button class=\"change-button-component btn w-auto group/button\" type=\"button\" onclick=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -103,7 +103,7 @@ templ defaultDayComponent(day models.IWorkDay) {
|
||||
if day.IsWorkDay() {
|
||||
{{
|
||||
workDay, _ := day.(*models.WorkDay)
|
||||
work, pause, overtime := workDay.GetAllWorkTimesVirtual(user)
|
||||
work, pause, overtime := workDay.GetAllWorkTimesReal(user)
|
||||
}}
|
||||
if day.RequiresAction() {
|
||||
<p class="text-red-600">Bitte anpassen</p>
|
||||
@@ -149,6 +149,7 @@ templ defaultDayComponent(day models.IWorkDay) {
|
||||
}}
|
||||
@absenceComponent(absentDay, false)
|
||||
}
|
||||
<input type="hidden" name="action" value="change"/> <!-- default action value for ändern button -->
|
||||
</form>
|
||||
</div>
|
||||
<div class="grid-cell flex flex-row gap-2 items-end">
|
||||
|
||||
@@ -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.
|
||||
@@ -297,7 +297,7 @@ func defaultDayComponent(day models.IWorkDay) templ.Component {
|
||||
if day.IsWorkDay() {
|
||||
|
||||
workDay, _ := day.(*models.WorkDay)
|
||||
work, pause, overtime := workDay.GetAllWorkTimesVirtual(user)
|
||||
work, pause, overtime := workDay.GetAllWorkTimesReal(user)
|
||||
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 {
|
||||
@@ -463,7 +463,7 @@ func defaultDayComponent(day models.IWorkDay) templ.Component {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</form></div><div class=\"grid-cell flex flex-row gap-2 items-end\">")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "<input type=\"hidden\" name=\"action\" value=\"change\"><!-- default action value for ändern button --></form></div><div class=\"grid-cell flex flex-row gap-2 items-end\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -507,7 +507,7 @@ func absentInput(a models.Absence) templ.Component {
|
||||
var templ_7745c5c3_Var21 string
|
||||
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(a.DateFrom.Format("2006-01-02"))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/timePage.templ`, Line: 161, Col: 78}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/timePage.templ`, Line: 162, Col: 78}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -520,7 +520,7 @@ func absentInput(a models.Absence) templ.Component {
|
||||
var templ_7745c5c3_Var22 string
|
||||
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(a.DateTo.Format("2006-01-02"))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/timePage.templ`, Line: 162, Col: 74}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/timePage.templ`, Line: 163, Col: 74}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -533,7 +533,7 @@ func absentInput(a models.Absence) templ.Component {
|
||||
var templ_7745c5c3_Var23 string
|
||||
templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(a.AbwesenheitTyp.Id)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/timePage.templ`, Line: 163, Col: 64}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/timePage.templ`, Line: 164, Col: 64}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -546,7 +546,7 @@ func absentInput(a models.Absence) templ.Component {
|
||||
var templ_7745c5c3_Var24 string
|
||||
templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(a.CounterId)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/timePage.templ`, Line: 164, Col: 54}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/timePage.templ`, Line: 165, Col: 54}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
0
DB/initdb/01_schema.sql
Normal file → Executable file
0
DB/initdb/01_schema.sql
Normal file → Executable file
0
DB/initdb/02_sample_data.sql
Normal file → Executable file
0
DB/initdb/02_sample_data.sql
Normal file → Executable file
0
DB/initdb/03_create_user.sh
Normal file → Executable file
0
DB/initdb/03_create_user.sh
Normal file → Executable file
@@ -1,5 +1,7 @@
|
||||
# Arbeitszeitmessung
|
||||
|
||||
[](https://sonar.letsstein.de/dashboard?id=arbeitszeitmessung)
|
||||
|
||||
bis jetzt ein einfaches Backend mit PostgreSQL Datenbank und GO Webserver um Arbeitszeitbuchungen per HTTP PUT einzufügen
|
||||
|
||||
## Installation
|
||||
|
||||
Reference in New Issue
Block a user