Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ea8e78fd9f | |||
| 6da58d6753 | |||
| 89eb5d255d | |||
| 1b8fb747e8 | |||
| 74cded42d8 | |||
| 22350142fc | |||
| 659fb80049 | |||
| cbc4028f8d | |||
| e4d423385a | |||
| c9c2d801b0 | |||
| 94c7c8a36e | |||
| d69ec600cd | |||
| 95d5c4ab9d | |||
| bf841ad5c6 | |||
| a1aae9dc56 | |||
| 750fb1ff58 | |||
| f4e9915e7f | |||
| 18046bbe18 |
@@ -23,7 +23,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||||
|
fetch-depth: 0
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
@@ -45,4 +47,25 @@ jobs:
|
|||||||
restore-keys: |-
|
restore-keys: |-
|
||||||
arbeitszeitmessung-
|
arbeitszeitmessung-
|
||||||
- name: Run Go Tests
|
- 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 . .
|
COPY . .
|
||||||
RUN go build -o server .
|
RUN go build -o server .
|
||||||
|
|
||||||
FROM alpine
|
FROM alpine:3.22
|
||||||
RUN apk add --no-cache tzdata
|
RUN apk add --no-cache tzdata
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/server /app/server
|
COPY --from=build /app/server /app/server
|
||||||
|
|||||||
@@ -53,9 +53,11 @@ func GetDays(user User, tsFrom, tsTo time.Time, orderedForward bool) []IWorkDay
|
|||||||
}
|
}
|
||||||
if day.AbwesenheitTyp.WorkTime == 1 {
|
if day.AbwesenheitTyp.WorkTime == 1 {
|
||||||
if workDay, ok := allDays[day.Date().Format("2006-01-02")].(*WorkDay); ok {
|
if workDay, ok := allDays[day.Date().Format("2006-01-02")].(*WorkDay); ok {
|
||||||
|
if len(workDay.Bookings) > 0 {
|
||||||
workDay.kurzArbeit = true
|
workDay.kurzArbeit = true
|
||||||
workDay.kurzArbeitAbsence = day
|
workDay.kurzArbeitAbsence = day
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
allDays[day.Date().Format("2006-01-02")] = &day
|
allDays[day.Date().Format("2006-01-02")] = &day
|
||||||
}
|
}
|
||||||
@@ -84,6 +86,7 @@ func (d *WorkDay) TimeWorkVirtual(u User) time.Duration {
|
|||||||
if d.IsKurzArbeit() {
|
if d.IsKurzArbeit() {
|
||||||
return u.ArbeitszeitProTag()
|
return u.ArbeitszeitProTag()
|
||||||
}
|
}
|
||||||
|
|
||||||
return d.workTime
|
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) {
|
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)
|
w.Days = GetDays(w.User, w.WeekStart, w.WeekStart.Add(6*24*time.Hour), false)
|
||||||
|
log.Println(w.Worktime)
|
||||||
|
|
||||||
for _, day := range w.Days {
|
for _, day := range w.Days {
|
||||||
|
log.Println(day.TimeWorkVirtual(w.User))
|
||||||
w.Worktime += 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.Overtime = w.Worktime - w.User.ArbeitszeitProWoche()
|
||||||
|
|
||||||
w.Worktime = w.Worktime.Round(time.Minute)
|
w.Worktime = w.Worktime.Round(time.Minute)
|
||||||
@@ -127,12 +131,13 @@ func (w *WorkWeek) GetSendWeeks(user User) []WorkWeek {
|
|||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var week WorkWeek = WorkWeek{User: user}
|
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)
|
log.Println("Error scanning row!", err)
|
||||||
return weeks
|
return weeks
|
||||||
}
|
}
|
||||||
|
|
||||||
week.PopulateWithDays(week.Worktime, week.Overtime)
|
week.PopulateWithDays(workTime, overTime)
|
||||||
weeks = append(weeks, week)
|
weeks = append(weeks, week)
|
||||||
}
|
}
|
||||||
if err = rows.Err(); err != nil {
|
if err = rows.Err(); err != nil {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
sonar.projectKey=Arbeitszeitmessung
|
sonar.projectKey=arbeitszeitmessung
|
||||||
sonar.sources=.
|
sonar.sources=.
|
||||||
sonar.exclusions=**/*_test.go
|
sonar.exclusions=**/*_test.go, **/*_templ.go
|
||||||
|
|
||||||
sonar.tests=.
|
sonar.tests=.
|
||||||
sonar.test.inclusions=**/*_test.go
|
sonar.test.inclusions=**/*_test.go
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
function clearEditState() {
|
function clearEditState() {
|
||||||
for (e of document.querySelectorAll(".edit")) {
|
for (let e of document.querySelectorAll(".edit")) {
|
||||||
e.classList.remove("edit");
|
e.classList.remove("edit");
|
||||||
}
|
}
|
||||||
toggleAbsenceEdit(false);
|
toggleAbsenceEdit(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearButtonState() {
|
||||||
|
for (let b of document.querySelectorAll(".change-button-component")) {
|
||||||
|
b.type = "button";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function editWorkday(element, event, id, isWorkDay) {
|
function editWorkday(element, event, id, isWorkDay) {
|
||||||
console.log("editWorkday called", isWorkDay);
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var form = document.getElementById(id);
|
let form = document.getElementById(id);
|
||||||
if (form == null) {
|
if (form == null) {
|
||||||
form = element
|
form = element.closest(".grid-sub").querySelector(".all-booking-component > form");
|
||||||
.closest(".grid-sub")
|
|
||||||
.querySelector(".all-booking-component > form");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clearEditState();
|
clearEditState();
|
||||||
@@ -21,38 +24,29 @@ function editWorkday(element, event, id, isWorkDay) {
|
|||||||
|
|
||||||
if (isWorkDay) {
|
if (isWorkDay) {
|
||||||
element.classList.add("edit");
|
element.classList.add("edit");
|
||||||
if (element.classList.contains("edit")) {
|
if (element.type == "button") {
|
||||||
form.querySelectorAll("input, select").forEach((input) => {
|
for (let input of form.querySelectorAll("input, select")) {
|
||||||
input.disabled = false;
|
input.disabled = false;
|
||||||
});
|
}
|
||||||
|
clearButtonState();
|
||||||
|
element.type = "submit";
|
||||||
} else {
|
} else {
|
||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var absenceForm = document.getElementById("absence_form");
|
const absenceForm = document.getElementById("absence_form");
|
||||||
|
|
||||||
if (id != 0) {
|
if (id == 0) {
|
||||||
syncFields(form, absenceForm, [
|
absenceForm.querySelector("[name=date_from]").value = form.id.replace("time-", "");
|
||||||
"date_from",
|
absenceForm.querySelector("[name=date_to]").value = form.id.replace("time-", "");
|
||||||
"date_to",
|
|
||||||
"aw_type",
|
|
||||||
"aw_id",
|
|
||||||
]);
|
|
||||||
} else {
|
} else {
|
||||||
absenceForm.querySelector("[name=date_from]").value = form.id.replace(
|
syncFields(form, absenceForm, ["date_from", "date_to", "aw_type", "aw_id"]);
|
||||||
"time-",
|
|
||||||
"",
|
|
||||||
);
|
|
||||||
absenceForm.querySelector("[name=date_to]").value = form.id.replace(
|
|
||||||
"time-",
|
|
||||||
"",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleAbsenceEdit(state) {
|
function toggleAbsenceEdit(state) {
|
||||||
var form = document.getElementById("absence_form");
|
const form = document.getElementById("absence_form");
|
||||||
if (state) {
|
if (state) {
|
||||||
form.classList.remove("hidden");
|
form.classList.remove("hidden");
|
||||||
form.scrollIntoView({
|
form.scrollIntoView({
|
||||||
@@ -66,22 +60,22 @@ function toggleAbsenceEdit(state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function syncFields(from, to, fieldsToSync) {
|
function syncFields(from, to, fieldsToSync) {
|
||||||
fieldsToSync.forEach((name) => {
|
for (let field of fieldsToSync) {
|
||||||
const src = from.querySelector(`[name=${name}]`);
|
const src = from.querySelector(`[name=${field}]`);
|
||||||
const target = to.querySelector(`[name=${name}]`);
|
const target = to.querySelector(`[name=${field}]`);
|
||||||
if (!src || !target) return;
|
if (!src || !target) return;
|
||||||
target.value = src.value;
|
target.value = src.value;
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function navigateWeek(element, event, direction) {
|
function navigateWeek(element, event, direction) {
|
||||||
var dateInput = element.closest("form").querySelector("input[type=date]");
|
const dateInput = element.closest("form").querySelector("input[type=date]");
|
||||||
var date = dateInput.valueAsDate;
|
const date = dateInput.valueAsDate;
|
||||||
date.setDate(date.getDate() + 7 * direction);
|
date.setDate(date.getDate() + 7 * direction);
|
||||||
date.setHours(10);
|
date.setHours(10);
|
||||||
dateInput.valueAsDate = date;
|
dateInput.valueAsDate = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
function logoutUser() {
|
function logoutUser() {
|
||||||
fetch("/user/logout", {}).then(() => window.location.reload());
|
fetch("/user/logout", {}).then(() => globalThis.location.reload());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,61 +93,6 @@ templ TeamPage(weeks []models.WorkWeek, userWeek models.WorkWeek) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@workWeekComponent(userWeek, false)
|
@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 {
|
if len(weeks) > 0 {
|
||||||
<div class="grid-cell col-span-full bg-neutral-300">
|
<div class="grid-cell col-span-full bg-neutral-300">
|
||||||
<h2 class="text-2xl uppercase font-bold">Abrechnung Mitarbeiter</h2>
|
<h2 class="text-2xl uppercase font-bold">Abrechnung Mitarbeiter</h2>
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ func TeamPresencePage(teamPresence map[models.User]bool) templ.Component {
|
|||||||
var templ_7745c5c3_Var11 string
|
var templ_7745c5c3_Var11 string
|
||||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(user.Vorname)
|
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(user.Vorname)
|
||||||
if templ_7745c5c3_Err != nil {
|
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))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
@@ -350,7 +350,7 @@ func TeamPresencePage(teamPresence map[models.User]bool) templ.Component {
|
|||||||
var templ_7745c5c3_Var12 string
|
var templ_7745c5c3_Var12 string
|
||||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(user.Name)
|
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(user.Name)
|
||||||
if templ_7745c5c3_Err != nil {
|
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))
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ templ lineComponent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
templ changeButtonComponent(id string, workDay bool) {
|
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 md:block group-[.edit]/button:hidden">Ändern</p>
|
||||||
<p class="hidden group-[.edit]/button:md:block">Absenden</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">
|
<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>
|
</p>
|
||||||
<div class="w-full"></div>
|
<div class="w-full"></div>
|
||||||
if isKurzarbeit {
|
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>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ func changeButtonComponent(id string, workDay bool) templ.Component {
|
|||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
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 {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
@@ -394,15 +394,15 @@ func absenceComponent(a *models.Absence, isKurzarbeit bool) templ.Component {
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
if isKurzarbeit {
|
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 {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
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 {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
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)
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var22.Call)
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ templ defaultDayComponent(day models.IWorkDay) {
|
|||||||
if day.IsWorkDay() {
|
if day.IsWorkDay() {
|
||||||
{{
|
{{
|
||||||
workDay, _ := day.(*models.WorkDay)
|
workDay, _ := day.(*models.WorkDay)
|
||||||
work, pause, overtime := workDay.GetAllWorkTimesVirtual(user)
|
work, pause, overtime := workDay.GetAllWorkTimesReal(user)
|
||||||
}}
|
}}
|
||||||
if day.RequiresAction() {
|
if day.RequiresAction() {
|
||||||
<p class="text-red-600">Bitte anpassen</p>
|
<p class="text-red-600">Bitte anpassen</p>
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ func defaultDayComponent(day models.IWorkDay) templ.Component {
|
|||||||
if day.IsWorkDay() {
|
if day.IsWorkDay() {
|
||||||
|
|
||||||
workDay, _ := day.(*models.WorkDay)
|
workDay, _ := day.(*models.WorkDay)
|
||||||
work, pause, overtime := workDay.GetAllWorkTimesVirtual(user)
|
work, pause, overtime := workDay.GetAllWorkTimesReal(user)
|
||||||
if day.RequiresAction() {
|
if day.RequiresAction() {
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<p class=\"text-red-600\">Bitte anpassen</p>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<p class=\"text-red-600\">Bitte anpassen</p>")
|
||||||
if templ_7745c5c3_Err != nil {
|
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
|
# 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
|
bis jetzt ein einfaches Backend mit PostgreSQL Datenbank und GO Webserver um Arbeitszeitbuchungen per HTTP PUT einzufügen
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|||||||
Reference in New Issue
Block a user