From 4bdd9310ea287c52c89e95a3ebb7d3d723f04257 Mon Sep 17 00:00:00 2001 From: Felix Schlusche Date: Fri, 24 Oct 2025 21:06:44 +0200 Subject: [PATCH] feat: refactor CSV filter & export section and enhance row styling in monthly view --- public/index.html | 288 +++++++++++++++++++++++----------------------- public/js/main.js | 64 ++++++----- 2 files changed, 178 insertions(+), 174 deletions(-) diff --git a/public/index.html b/public/index.html index f1f9ff5..60f0f38 100644 --- a/public/index.html +++ b/public/index.html @@ -418,128 +418,6 @@ - - -
- - - - CSV Filter & Export - -
-
- - -
- -
- - -
- -
- - - - - - - -
-
-
- - -
- - - - Einstellungen - -
- -
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
- - -
-

- - Datenbank Verwaltung -

-
- - - -
-

- - Export erstellt eine JSON-Datei mit allen Einträgen und Einstellungen. Import überschreibt alle vorhandenen Daten. -

-
-
@@ -600,7 +478,7 @@ -
+
@@ -625,14 +503,12 @@ @@ -663,16 +539,14 @@
- + + + + + + +
+
+ +
+ + +
+
+ + + + Einstellungen + +
+ +
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+

+ + Datenbank Verwaltung +

+
+ + + +
+

+ + Export erstellt eine JSON-Datei mit allen Einträgen und Einstellungen. Import überschreibt alle vorhandenen Daten. +

+
+
+
+ diff --git a/public/js/main.js b/public/js/main.js index 6a4badd..1f77f6e 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -1015,15 +1015,15 @@ function renderMonthlyView(entries) { const entryType = entry.entryType || 'work'; // Row color based on entry type and location - let rowClass = 'hover:bg-gray-700'; + let rowClass = 'hover:bg-slate-600/40 transition-colors'; if (entryType === 'vacation') { - rowClass = 'hover:bg-yellow-900 bg-yellow-950'; + rowClass = 'hover:bg-yellow-800/50 bg-yellow-900/30 transition-colors'; } else if (entryType === 'flextime') { - rowClass = 'hover:bg-cyan-900 bg-cyan-950'; + rowClass = 'hover:bg-cyan-800/50 bg-cyan-900/30 transition-colors'; } else if (location === 'home') { - rowClass = 'hover:bg-green-900 bg-green-950'; + rowClass = 'hover:bg-green-800/50 bg-green-900/30 transition-colors'; } else if (weekend) { - rowClass = 'hover:bg-gray-700 bg-gray-700'; + rowClass = 'hover:bg-slate-600/50 bg-slate-700/30 transition-colors'; } @@ -1041,13 +1041,13 @@ function renderMonthlyView(entries) { if (entryType === 'vacation') { displayIcon = ''; displayText = 'Urlaub'; - displayTimes = ` + displayTimes = ` Urlaub `; } else if (entryType === 'flextime') { displayIcon = ''; displayText = 'Gleitzeit'; - displayTimes = ` + displayTimes = ` Gleittag (8h) `; } else { @@ -1063,15 +1063,15 @@ function renderMonthlyView(entries) { : entry.endTime; displayTimes = ` - ${entry.startTime} - ${endTimeDisplay} - ${entry.pauseMinutes} `; @@ -1079,28 +1079,28 @@ function renderMonthlyView(entries) { // Checkbox column (always present for consistent layout) const checkboxCell = bulkEditMode ? ` - - + ` : ''; row.innerHTML = checkboxCell + ` - ${dayOfWeek} - ${formatDateDisplay(entry.date)} + ${dayOfWeek} + ${formatDateDisplay(entry.date)} ${displayTimes} - ${entry.netHours.toFixed(2)} - + ${entry.netHours.toFixed(2)} + ${displayIcon} ${displayText} - +
${entryType === 'work' ? ` - ` : ''} -
@@ -1113,8 +1113,8 @@ function renderMonthlyView(entries) { // Don't mark future days as red, only past workdays without entries const isFutureDay = dateObj > today; - let emptyRowClass = weekend ? 'hover:bg-gray-700 bg-gray-700' : - isFutureDay ? 'hover:bg-gray-700' : 'hover:bg-gray-700 bg-red-950/40'; + let emptyRowClass = weekend ? 'hover:bg-slate-600/50 bg-slate-700/30 transition-colors' : + isFutureDay ? 'hover:bg-slate-600/40 transition-colors' : 'hover:bg-slate-600/40 bg-red-900/30 transition-colors'; row.className = emptyRowClass; @@ -1127,29 +1127,29 @@ function renderMonthlyView(entries) { // Checkbox cell for empty days (in bulk edit mode) const checkboxCell = bulkEditMode ? ` - - + ` : ''; const colspan = bulkEditMode ? '5' : '5'; row.innerHTML = checkboxCell + ` - ${dayOfWeek} - ${formatDateDisplay(dateISO)} - + ${dayOfWeek} + ${formatDateDisplay(dateISO)} + ${displayText} - +
- ${!weekend ? ` - - ` : ''} @@ -1290,10 +1290,14 @@ async function loadMonthlyView() { (displayYear === today.getFullYear() && displayMonth >= today.getMonth()); const pdfButton = document.getElementById('btnExportPDF'); + const pdfButtonMobile = document.getElementById('btnExportPDFMobile'); + if (isCurrentOrFutureMonth) { pdfButton.style.display = 'none'; + if (pdfButtonMobile) pdfButtonMobile.style.display = 'none'; } else { pdfButton.style.display = ''; + if (pdfButtonMobile) pdfButtonMobile.style.display = ''; } }