diff --git a/public/bg_pf24.png b/public/bg_pf24.png new file mode 100644 index 0000000..8a6cf2d Binary files /dev/null and b/public/bg_pf24.png differ diff --git a/public/css/style.css b/public/css/style.css index 783ef03..443e9b3 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -29,6 +29,27 @@ body { flex-direction: column; } +/* Hintergrundbild auf öffentlichen Seiten */ +body:not(.admin-body) { + background-image: url('/bg_pf24.png'); + background-size: cover; + background-position: center top; + background-attachment: fixed; + background-repeat: no-repeat; +} +body:not(.admin-body)::before { + content: ''; + position: fixed; + inset: 0; + background: rgba(255, 255, 255, 0.82); + z-index: 0; + pointer-events: none; +} +body:not(.admin-body) > * { + position: relative; + z-index: 1; +} + /* ---- HEADER ---- */ .site-header { border-bottom: 1px solid var(--border); diff --git a/routes/admin.js b/routes/admin.js index 6003f4e..810e7ba 100644 --- a/routes/admin.js +++ b/routes/admin.js @@ -221,15 +221,23 @@ router.post('/members/:id/update', requireAdmin, async (req, res) => { // ===== AUSZEITEN ===== router.post('/members/:id/pauses/add', requireAdmin, async (req, res) => { - const { pause_start, pause_end, pause_months, reason } = req.body; + const { pause_start, pause_end, reason } = req.body; const memberId = req.params.id; try { - if (!pause_start || !pause_end || !pause_months) { - return res.redirect(`/admin/members/${memberId}?error=Bitte+alle+Pflichtfelder+ausfüllen`); + if (!pause_start || !pause_end) { + return res.redirect(`/admin/members/${memberId}?error=Bitte+Von+und+Bis+ausfüllen`); } - if (new Date(pause_end) <= new Date(pause_start)) { + const start = new Date(pause_start); + const end = new Date(pause_end); + if (end <= start) { return res.redirect(`/admin/members/${memberId}?error=Enddatum+muss+nach+Startdatum+liegen`); } + // Monate automatisch berechnen (aufgerundet) + const pause_months = Math.ceil( + (end.getFullYear() - start.getFullYear()) * 12 + + (end.getMonth() - start.getMonth()) + + (end.getDate() > start.getDate() ? 1 : 0) + ); // Auszeit eintragen await db.query( 'INSERT INTO membership_pauses (membership_id, pause_start, pause_end, pause_months, reason) VALUES (?, ?, ?, ?, ?)', diff --git a/views/admin/member-detail.ejs b/views/admin/member-detail.ejs index 6e1eef4..4628ccc 100644 --- a/views/admin/member-detail.ejs +++ b/views/admin/member-detail.ejs @@ -128,7 +128,7 @@ -
+
📄

Vertrag

@@ -154,12 +154,14 @@
+
+
- +
@@ -173,6 +175,8 @@
+ +
-
- - -
@@ -260,7 +260,7 @@
-
+
🏦

Bankdaten / SEPA

@@ -272,6 +272,8 @@
+
+