diff --git a/Backend/src/main.css b/Backend/src/main.css
index c54539c..2e260d6 100644
--- a/Backend/src/main.css
+++ b/Backend/src/main.css
@@ -1,152 +1,163 @@
@import "tailwindcss";
@source "../templates/*.templ";
@plugin "@iconify/tailwind4" {
- scale: 1.25;
+ scale: 1.25;
}
@theme {
- --color-accent-50: #e7fdea;
- --color-accent-100: #cbfbd1;
- --color-accent-200: #9cf7a8;
- --color-accent-300: #68f37a;
- --color-accent-400: #33ef4d;
- --color-accent-500: #11db2d;
- --color-accent-600: #0eaf23;
- --color-accent-700: #0a851b;
- --color-accent-800: #075a12;
- --color-accent-900: #032b09;
- --color-accent-950: #021805;
- --color-accent: #0eaf23;
- --color-text-50: #f7f8f7;
- --color-text-100: #f2f3f2;
- --color-text-200: #e2e4e2;
- --color-text-300: #d2d6d2;
- --color-text-400: #c2c7c2;
- --color-text-500: #afb6af;
- --color-text-600: #97a097;
- --color-text-700: #7d877d;
- --color-text-800: #5a625a;
- --color-text-900: #161816;
- --color-text-950: #000000;
+ --color-accent-50: #e7fdea;
+ --color-accent-100: #cbfbd1;
+ --color-accent-200: #9cf7a8;
+ --color-accent-300: #68f37a;
+ --color-accent-400: #33ef4d;
+ --color-accent-500: #11db2d;
+ --color-accent-600: #0eaf23;
+ --color-accent-700: #0a851b;
+ --color-accent-800: #075a12;
+ --color-accent-900: #032b09;
+ --color-accent-950: #021805;
+ --color-accent: #0eaf23;
+ --color-text-50: #f7f8f7;
+ --color-text-100: #f2f3f2;
+ --color-text-200: #e2e4e2;
+ --color-text-300: #d2d6d2;
+ --color-text-400: #c2c7c2;
+ --color-text-500: #afb6af;
+ --color-text-600: #97a097;
+ --color-text-700: #7d877d;
+ --color-text-800: #5a625a;
+ --color-text-900: #161816;
+ --color-text-950: #000000;
}
@layer base {
- body {
- -webkit-print-color-adjust: exact !important;
- print-color-adjust: exact !important;
- background-color: white;
- }
+ body {
+ -webkit-print-color-adjust: exact !important;
+ print-color-adjust: exact !important;
+ background-color: white;
+ }
}
@layer components {
- .grid-main {
- display: grid;
- grid-template-columns: 4fr 3fr 3fr 1fr;
- align-items: stretch;
- }
+ .grid-main {
+ display: grid;
+ grid-template-columns: 4fr 3fr 3fr 1fr;
+ align-items: stretch;
+ }
- .grid-sub {
- display: grid;
- grid-template-columns: subgrid;
- grid-column: 1 / -1;
- border-color: var(--color-neutral-400);
- transition: background-color 0.2s ease-in-out;
+ .grid-sub {
+ display: grid;
+ grid-template-columns: subgrid;
+ grid-column: 1 / -1;
+ border-color: var(--color-neutral-400);
+ transition: background-color 0.2s ease-in-out;
+ }
+
+ .grid-sub.responsive {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .grid-sub:hover {
+ background-color: var(--color-neutral-200);
+ }
+
+ .grid-cell {
+ padding: calc(var(--spacing) * 2);
+ border-color: var(--color-neutral-400);
+ }
+
+ .btn {
+ width: 100%;
+ cursor: pointer;
+ border-radius: var(--radius-md);
+ color: var(--color-neutral-800);
+ font-size: var(--text-sm);
+ text-align: center;
+ padding: calc(var(--spacing) * 2);
+ border-style: var(--tw-border-style);
+ border-width: 1px;
+ border-color: var(--color-neutral-800);
+ transition-property:
+ color, background-color, border-color, outline-color,
+ text-decoration-color, fill, stroke, --tw-gradient-from,
+ --tw-gradient-via, --tw-gradient-to;
+ transition-timing-function: var(
+ --tw-ease,
+ var(--default-transition-timing-function)
+ );
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
+ }
+
+ input.btn,
+ select.btn {
+ transition-duration: 300ms;
+ }
+
+ .btn:hover {
+ color: var(--color-white);
+ background-color: var(--color-neutral-700);
+ }
+
+ .btn:disabled {
+ opacity: 50%;
+ pointer-events: none;
+ }
+
+ input.btn,
+ select.btn {
+ text-align: left;
+ }
+
+ input.btn:hover,
+ select.btn:hover {
+ border-color: var(--color-neutral-300);
+ background-color: var(--color-neutral-100);
+ color: var(--color-neutral-800);
+ }
+
+ .edit-box {
+ border-radius: var(--radius-md);
+ overflow: hidden;
+ border-color: var(--color-neutral-500);
+ transition-property: background-color, border-color;
+ transition-timing-function: var(--default-transition-timing-function) * 2;
+ transition-duration: var(--default-transition-duration);
+ outline: none;
+
+ &:is(:where(.group):is(.edit) *) {
+ border-width: 1px;
+ }
+ }
+
+ .edit-box:hover {
+ &:is(:where(.group):is(.edit) *) {
+ background-color: var(--color-white);
+ border-color: var(--color-neutral-300);
+ }
+ }
+
+ .edit-box input:focus {
+ outline: none;
+ }
+
+ div.edit {
+ border-width: 1px;
+ background-color: var(--color-neutral-300);
+ }
+
+ @media (width >=48rem) {
+ .grid-main {
+ grid-template-columns: repeat(5, 1fr);
+ margin: 0 10%;
}
.grid-sub.responsive {
- display: flex;
- flex-direction: column;
- }
-
- .grid-sub:hover {
- background-color: var(--color-neutral-200);
- }
-
- .grid-cell {
- padding: calc(var(--spacing) * 2);
- border-color: var(--color-neutral-400);
+ display: grid;
}
.btn {
- width: 100%;
- cursor: pointer;
- border-radius: var(--radius-md);
- color: var(--color-neutral-800);
- font-size: var(--text-sm);
- text-align: center;
- padding: calc(var(--spacing) * 2);
- border-style: var(--tw-border-style);
- border-width: 1px;
- border-color: var(--color-neutral-800);
- transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
- transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
- transition-duration: var(--tw-duration, var(--default-transition-duration));
- }
-
- input.btn,
- select.btn {
- transition-duration: 300ms;
- }
-
- .btn:hover {
- color: var(--color-white);
- background-color: var(--color-neutral-700);
- }
-
- .btn:disabled {
- opacity: 50%;
- pointer-events: none;
- }
-
- input.btn,
- select.btn {
- text-align: left;
- }
-
- input.btn:hover,
- select.btn:hover {
- border-color: var(--color-neutral-300);
- background-color: var(--color-neutral-100);
- color: var(--color-neutral-800);
- }
-
- .edit-box {
- border-radius: var(--radius-md);
- overflow: hidden;
- border-color: var(--color-neutral-500);
- transition-property: background-color, border-color;
- transition-timing-function: var(--default-transition-timing-function) * 2;
- transition-duration: var(--default-transition-duration);
- outline: none;
-
- &:is(:where(.group):is(.edit) *) {
- border-width: 1px;
- }
- }
-
- .edit-box:hover {
- &:is(:where(.group):is(.edit) *) {
- background-color: var(--color-white);
- border-color: var(--color-neutral-300);
- }
- }
-
- .edit-box input:focus {
- outline: none;
- }
-
- @media (width >=48rem) {
- .grid-main {
- grid-template-columns: repeat(5, 1fr);
- margin: 0 10%;
- }
-
- .grid-sub.responsive {
- display: grid;
- }
-
- .btn {
- padding-inline: calc(var(--spacing) * 4);
- }
+ padding-inline: calc(var(--spacing) * 4);
}
+ }
}
diff --git a/Backend/static/css/styles.css b/Backend/static/css/styles.css
index 9f5c58c..e65589d 100644
--- a/Backend/static/css/styles.css
+++ b/Backend/static/css/styles.css
@@ -197,6 +197,9 @@
.relative {
position: relative;
}
+ .top-2 {
+ top: calc(var(--spacing) * 2);
+ }
.top-2\.5 {
top: calc(var(--spacing) * 2.5);
}
@@ -206,6 +209,9 @@
.right-1 {
right: calc(var(--spacing) * 1);
}
+ .right-2 {
+ right: calc(var(--spacing) * 2);
+ }
.right-2\.5 {
right: calc(var(--spacing) * 2.5);
}
@@ -236,6 +242,19 @@
.ml-1 {
margin-left: calc(var(--spacing) * 1);
}
+ .icon-\[material-symbols-light--cancel-outline\] {
+ display: inline-block;
+ width: 1.25em;
+ height: 1.25em;
+ background-color: currentColor;
+ -webkit-mask-image: var(--svg);
+ mask-image: var(--svg);
+ -webkit-mask-repeat: no-repeat;
+ mask-repeat: no-repeat;
+ -webkit-mask-size: 100% 100%;
+ mask-size: 100% 100%;
+ --svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='m8.4 16.308l3.6-3.6l3.6 3.6l.708-.708l-3.6-3.6l3.6-3.6l-.708-.708l-3.6 3.6l-3.6-3.6l-.708.708l3.6 3.6l-3.6 3.6zM12.003 21q-1.866 0-3.51-.708q-1.643-.709-2.859-1.924t-1.925-2.856T3 12.003t.709-3.51Q4.417 6.85 5.63 5.634t2.857-1.925T11.997 3t3.51.709q1.643.708 2.859 1.922t1.925 2.857t.709 3.509t-.708 3.51t-1.924 2.859t-2.856 1.925t-3.509.709M12 20q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8'/%3E%3C/svg%3E");
+ }
.icon-\[material-symbols-light--check-circle-outline\] {
display: inline-block;
width: 1.25em;
@@ -353,6 +372,14 @@
width: calc(var(--spacing) * 4);
height: calc(var(--spacing) * 4);
}
+ .size-5 {
+ width: calc(var(--spacing) * 5);
+ height: calc(var(--spacing) * 5);
+ }
+ .size-6 {
+ width: calc(var(--spacing) * 6);
+ height: calc(var(--spacing) * 6);
+ }
.h-2 {
height: calc(var(--spacing) * 2);
}
@@ -380,6 +407,9 @@
.w-5 {
width: calc(var(--spacing) * 5);
}
+ .w-9 {
+ width: calc(var(--spacing) * 9);
+ }
.w-9\/10 {
width: calc(9/10 * 100%);
}
@@ -392,6 +422,9 @@
.w-full {
width: 100%;
}
+ .flex-shrink {
+ flex-shrink: 1;
+ }
.flex-shrink-0 {
flex-shrink: 0;
}
@@ -407,9 +440,15 @@
.basis-\[content\] {
flex-basis: content;
}
+ .border-collapse {
+ border-collapse: collapse;
+ }
.cursor-pointer {
cursor: pointer;
}
+ .resize {
+ resize: both;
+ }
.scroll-m-2 {
scroll-margin: calc(var(--spacing) * 2);
}
@@ -564,6 +603,9 @@
.bg-red-600 {
background-color: var(--color-red-600);
}
+ .mask-repeat {
+ mask-repeat: repeat;
+ }
.p-1 {
padding: calc(var(--spacing) * 1);
}
@@ -634,6 +676,13 @@
.uppercase {
text-transform: uppercase;
}
+ .underline {
+ text-decoration-line: underline;
+ }
+ .outline {
+ outline-style: var(--tw-outline-style);
+ outline-width: 1px;
+ }
.filter {
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
}
@@ -702,6 +751,16 @@
display: inline;
}
}
+ .group-\[\.edit\]\/button\:block {
+ &:is(:where(.group\/button):is(.edit) *) {
+ display: block;
+ }
+ }
+ .group-\[\.edit\]\/button\:hidden {
+ &:is(:where(.group\/button):is(.edit) *) {
+ display: none;
+ }
+ }
.placeholder\:text-neutral-400 {
&::placeholder {
color: var(--color-neutral-400);
@@ -857,6 +916,13 @@
}
}
}
+ .group-\[\.edit\]\/button\:md\:block {
+ &:is(:where(.group\/button):is(.edit) *) {
+ @media (width >= 48rem) {
+ display: block;
+ }
+ }
+ }
.lg\:hidden {
@media (width >= 64rem) {
display: none;
@@ -942,7 +1008,7 @@
border-width: 1px;
border-color: var(--color-neutral-800);
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
- transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
+ transition-timing-function: var( --tw-ease, var(--default-transition-timing-function) );
transition-duration: var(--tw-duration, var(--default-transition-duration));
}
input.btn, select.btn {
@@ -985,6 +1051,10 @@
.edit-box input:focus {
outline: none;
}
+ div.edit {
+ border-width: 1px;
+ background-color: var(--color-neutral-300);
+ }
@media (width >=48rem) {
.grid-main {
grid-template-columns: repeat(5, 1fr);
@@ -1017,6 +1087,11 @@
syntax: "*";
inherits: false;
}
+@property --tw-outline-style {
+ syntax: "*";
+ inherits: false;
+ initial-value: solid;
+}
@property --tw-blur {
syntax: "*";
inherits: false;
@@ -1081,6 +1156,7 @@
--tw-border-style: solid;
--tw-divide-y-reverse: 0;
--tw-font-weight: initial;
+ --tw-outline-style: solid;
--tw-blur: initial;
--tw-brightness: initial;
--tw-contrast: initial;
diff --git a/Backend/static/script.js b/Backend/static/script.js
index 04bae89..176e4f8 100644
--- a/Backend/static/script.js
+++ b/Backend/static/script.js
@@ -1,14 +1,67 @@
-function editDay(element, event, formId) {
- var form = element.closest(".grid-sub").querySelector(".all-booking-component > form");
- form.classList.toggle("edit");
- element.classList.toggle("edit");
- if (element.classList.contains("edit")) {
- event.preventDefault();
- form.querySelectorAll("input, select").forEach((input) => {
- input.disabled = false;
+function clearEditState() {
+ for (e of document.querySelectorAll(".edit")) {
+ e.classList.remove("edit");
+ }
+ toggleAbsenceEdit(false);
+}
+
+function editWorkday(element, event, id, isWorkDay) {
+ console.log("editWorkday called", isWorkDay);
+ event.preventDefault();
+ var form = document.getElementById(id);
+ if (form == null) {
+ form = element
+ .closest(".grid-sub")
+ .querySelector(".all-booking-component > form");
+ }
+
+ clearEditState();
+ element.closest(".grid-sub").classList.add("edit");
+ toggleAbsenceEdit(!isWorkDay);
+
+ if (isWorkDay) {
+ element.classList.add("edit");
+ if (element.classList.contains("edit")) {
+ form.querySelectorAll("input, select").forEach((input) => {
+ input.disabled = false;
+ });
+ } else {
+ form.submit();
+ }
+ } else {
+ var absenceForm = document.getElementById("absence_form");
+
+ if (id != 0) {
+ syncFields(form, absenceForm, [
+ "date_from",
+ "date_to",
+ "aw_type",
+ "aw_id",
+ ]);
+ } else {
+ absenceForm.querySelector("[name=date_from]").value = form.id.replace(
+ "time-",
+ "",
+ );
+ absenceForm.querySelector("[name=date_to]").value = form.id.replace(
+ "time-",
+ "",
+ );
+ }
+ }
+}
+
+function toggleAbsenceEdit(state) {
+ var form = document.getElementById("absence_form");
+ if (state) {
+ form.classList.remove("hidden");
+ form.scrollIntoView({
+ behavior: "smooth",
+ block: "start",
+ inline: "nearest",
});
} else {
- form.submit();
+ form.classList.add("hidden");
}
}
@@ -21,31 +74,6 @@ function syncFields(from, to, fieldsToSync) {
});
}
-function editAbsence(element, event, absenceId) {
- event.preventDefault();
- var form = document.getElementById("absence_form");
-
- if (absenceId != 0) {
- var dataForm = document.getElementById(absenceId);
- syncFields(dataForm, form, ["date_from", "date_to", "aw_type", "aw_id"]);
- } else {
- var dataForm = element.closest(".grid-sub").querySelector(".all-booking-component > form");
- form.querySelector("[name=date_from]").value = dataForm.id.replace("time-", "");
- form.querySelector("[name=date_to]").value = dataForm.id.replace("time-", "");
- }
- form.classList.remove("hidden");
- form.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" });
-}
-
-function editAbwesenheit(element, event) {
- var newBookingComponent = element.closest(".grid-sub").querySelector(".new-booking-component");
- if (element.value == 0) {
- newBookingComponent.style.display = "";
- } else {
- newBookingComponent.style.display = "none";
- }
-}
-
function navigateWeek(element, event, direction) {
var dateInput = element.closest("form").querySelector("input[type=date]");
var date = dateInput.valueAsDate;
diff --git a/Backend/templates/headerComponent_templ.go b/Backend/templates/headerComponent_templ.go
index aeef6ec..8e59160 100644
--- a/Backend/templates/headerComponent_templ.go
+++ b/Backend/templates/headerComponent_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.3.924
+// templ: version: v0.3.943
package templates
//lint:file-ignore SA4006 This context is only used if a nested component is present.
diff --git a/Backend/templates/pages_templ.go b/Backend/templates/pages_templ.go
index 04f8e10..79a983d 100644
--- a/Backend/templates/pages_templ.go
+++ b/Backend/templates/pages_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.3.924
+// templ: version: v0.3.943
package templates
//lint:file-ignore SA4006 This context is only used if a nested component is present.
diff --git a/Backend/templates/pdf_templ.go b/Backend/templates/pdf_templ.go
index 3c73ded..321301b 100644
--- a/Backend/templates/pdf_templ.go
+++ b/Backend/templates/pdf_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.3.924
+// templ: version: v0.3.943
package templates
//lint:file-ignore SA4006 This context is only used if a nested component is present.
diff --git a/Backend/templates/teamComponents_templ.go b/Backend/templates/teamComponents_templ.go
index ec539f2..c1d475e 100644
--- a/Backend/templates/teamComponents_templ.go
+++ b/Backend/templates/teamComponents_templ.go
@@ -1,6 +1,6 @@
// Code generated by templ - DO NOT EDIT.
-// templ: version: v0.3.924
+// templ: version: v0.3.943
package templates
//lint:file-ignore SA4006 This context is only used if a nested component is present.
diff --git a/Backend/templates/timeComponents.templ b/Backend/templates/timeComponents.templ
index 413c16b..c2b5fab 100644
--- a/Backend/templates/timeComponents.templ
+++ b/Backend/templates/timeComponents.templ
@@ -19,78 +19,16 @@ templ lineComponent() {
}
-// templ workDayComponent(workDay models.WorkDay, submitted bool) {
-// {{
-// // work, pause := workDay.GetWorkTimeString()
-// user := ctx.Value("user").(models.User)
-// work, pause, overtime := workDay.GetAllWorkTimesReal(user)
-// // overtime := helper.FormatDuration(workDay.CalcOvertime(user))
-// justify := ""
-// if len(workDay.Bookings) <= 1 {
-// justify = "justify-content: center"
-// }
-// }}
-//
-//
-// @timeGaugeComponent(workDay.GetDayProgress(user), workDay.Day.Equal(time.Now().Truncate(24*time.Hour)))
-//
-//
{ workDay.Day.Format("Mon") }: { workDay.Day.Format("02.01.2006") }
-// if (workDay.RequiresAction()) {
-//
Bitte anpassen
-// } else {
-// if work > 0 {
-//
Arbeitszeit:
-//
{ helper.FormatDuration(work) }
-// }
-// if pause > 0 {
-// }
-//
{ helper.FormatDuration(pause) }
-// if overtime > 0 {
-//
{ helper.FormatDuration(overtime) }
-// }
-// }
-//
-//
-//
-// @lineComponent()
-//
-//
-//
-// @changeButtonComponent("time-" + workDay.Day.Format("2006-01-02"))
-//
-//
-// }
templ changeButtonComponent(id string, workDay bool) {
- {{
- functionName := "editDay"
- if !workDay {
- functionName = "editAbsence"
- }
- }}
-