From b01a2fee0ad53c774583ea8987cf3dee36789ec3 Mon Sep 17 00:00:00 2001 From: gitfreeking Date: Thu, 1 May 2025 00:29:00 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Css=20angepasst.=20Login/Ausloggen=20funkti?= =?UTF-8?q?onen=20hinzugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/bestellformular/bestellformular.html | 21 +++++++++++++++++---- static/Styles/styles-main.css | 6 ------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/public/bestellformular/bestellformular.html b/public/bestellformular/bestellformular.html index f45469d..1608d2b 100644 --- a/public/bestellformular/bestellformular.html +++ b/public/bestellformular/bestellformular.html @@ -19,13 +19,13 @@

Bestellformular

- + - + - + @@ -60,10 +60,23 @@ const kundenNrInput = document.getElementById('KundenNr'); const VornameInput = document.getElementById('Vorname'); const NachnameInput = document.getElementById('Nachname'); - if (kundenNrInput, VornameInput, NachnameInput) { + + const isLoggedIn = user_id && vorname && nachname; + + if (isLoggedIn) { kundenNrInput.value = user_id; VornameInput.value = vorname; NachnameInput.value = nachname; + + // Felder sperren, damit sie nicht bearbeitet werden können + kundenNrInput.readOnly = true; + VornameInput.readOnly = true; + NachnameInput.readOnly = true; + } else { + // Felder leer lassen & bearbeitbar + kundenNrInput.readOnly = false; + VornameInput.readOnly = false; + NachnameInput.readOnly = false; } console.log("User ID from sessionStorage:", user_id); diff --git a/static/Styles/styles-main.css b/static/Styles/styles-main.css index 5ac7c35..1f12e2b 100644 --- a/static/Styles/styles-main.css +++ b/static/Styles/styles-main.css @@ -581,12 +581,6 @@ input[type="text"]:focus, input[type="number"]:focus { background-color: #e95b00; } -#KundenNr, #Vorname, #Nachname { - background-color: #f5f5f5; - border: none; - cursor: not-allowed; -} - @media (max-width: 768px) { .ArtikelNrText, .StueckzahlText { width: 100%; From bef2da62d4c7d37149c232e3e924319ec40ba324 Mon Sep 17 00:00:00 2001 From: gitfreeking Date: Thu, 1 May 2025 09:00:43 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Route=20Kommentare=20hinzugef=C3=BCgt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/bestellformular/bestellformular.html | 1 + scripts/routes/other/route-index.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/bestellformular/bestellformular.html b/public/bestellformular/bestellformular.html index 1608d2b..1e990b5 100644 --- a/public/bestellformular/bestellformular.html +++ b/public/bestellformular/bestellformular.html @@ -190,6 +190,7 @@ } + diff --git a/scripts/routes/other/route-index.js b/scripts/routes/other/route-index.js index 6ba00d0..a059c66 100644 --- a/scripts/routes/other/route-index.js +++ b/scripts/routes/other/route-index.js @@ -16,7 +16,7 @@ router.get('/registrieren', (req, res) => { res.sendFile(path.join(__dirname, '../../../public/registrieren/registrieren.html')); }) -// Route - HeaderFooter +// Route - HeaderFooter Skript router.get('/header_footer', (req, res) => { res.sendFile(path.join(__dirname, '../../../scripts/einfügenHeaderFooter.js')); }) @@ -66,13 +66,14 @@ router.get('/bestellformular', (req, res) => { res.sendFile(path.join(__dirname, '../../../public/bestellformular/bestellformular.html')); }) +// Route - Bestellungen router.get('/bestellung', (req, res) => { res.sendFile(path.join(__dirname, '../../../public/bestellung/bestellung.html')); }) +// Route - Kontaktformular router.get('/kontaktformular', (req, res) => { res.sendFile(path.join(__dirname, '../../../public/kontaktformular/kontaktformular.html')); }) - module.exports = router; \ No newline at end of file