From 6cb75b0c1df6363c01177c2d4176c4cc27f9c6e3 Mon Sep 17 00:00:00 2001 From: Karsten Tlotzek Date: Fri, 11 Jul 2025 17:26:23 +0200 Subject: [PATCH] =?UTF-8?q?News-Ansicht=20aufger=C3=A4umt=20&=20vereinheit?= =?UTF-8?q?licht=20-=20CSS-Klassen=20und=20Benennungen=20=C3=BCberall=20ei?= =?UTF-8?q?nheitlich=20gemacht=20(news-card,=20login-success=20usw.)=20-?= =?UTF-8?q?=20Unn=C3=B6tige=20CSS-Regeln=20rausgeschmissen,=20Code=20jetzt?= =?UTF-8?q?=20viel=20schlanker=20-=20Cards=20sehen=20jetzt=20=C3=BCberall?= =?UTF-8?q?=20gleich=20aus,=20egal=20wie=20viel=20Text=20drinsteht=20-=20?= =?UTF-8?q?=E2=80=9EMehr=20lesen=E2=80=9C-Link=20besser=20sichtbar=20gemac?= =?UTF-8?q?ht=20-=20Bugfix:=20Langer=20News-Text=20l=C3=A4uft=20nicht=20me?= =?UTF-8?q?hr=20aus=20der=20Card=20raus=20-=20Generell:=20Viel=20code=20au?= =?UTF-8?q?fger=C3=A4umt,=20damit=20alles=20schicker=20und=20=C3=BCbersich?= =?UTF-8?q?tlicher=20ist!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CSS/style.css | 104 ++++++++++++++--------- Controller/NewsController.php | 14 +++ Model/Database.php | 6 +- Views/Auth/forgotPassword.phtml | 2 +- Views/Auth/showLoginForm.phtml | 2 +- Views/Auth/showLoginSuccess.phtml | 2 +- Views/Auth/showLogoutSuccess.phtml | 2 +- Views/Auth/showRegistrationForm.phtml | 2 +- Views/Auth/showRegistrationSuccess.phtml | 2 +- Views/Event/showEvents.phtml | 2 +- Views/News/createNewsForm.phtml | 2 +- Views/News/editNewsForm.phtml | 2 +- Views/News/showCreateSuccess.phtml | 2 +- Views/News/showDeleteSuccess.phtml | 2 +- Views/News/showEditSuccess.phtml | 2 +- Views/News/showNews.phtml | 20 +++-- Views/News/showNewsDetail.phtml | 10 +++ bibarts.sql | 23 ++++- 18 files changed, 139 insertions(+), 62 deletions(-) create mode 100644 Views/News/showNewsDetail.phtml diff --git a/CSS/style.css b/CSS/style.css index f0c3687..282af9d 100644 --- a/CSS/style.css +++ b/CSS/style.css @@ -11,16 +11,6 @@ body { max-width: 100vw; overflow-x: hidden; } -#wrapper { - flex: 1 0 auto; - min-height: 0; - display: flex; - flex-direction: column; - justify-content: flex-start; - margin-bottom: 20px; - width: 100vw; - max-width: 100vw; -} a { color: black; @@ -111,12 +101,6 @@ a { grid-column-end: 6; } -.container-rest { - grid-column-start: 1; - grid-column-end: 6; - padding-left: 50px; -} - .link-impressum { padding-left: 30px; @@ -216,10 +200,6 @@ a { max-width: 100vw; overflow-x: hidden; } - #wrapper { - width: 100vw; - max-width: 100vw; - } #navigation { width: 100vw; min-width: 0; @@ -313,13 +293,10 @@ a { text-align: center; padding: 0; } - .desktop-only { - display: none !important; - } .mobile-only { display: block !important; } - .login-container { + .form-container { position: static; width: 95vw; max-width: 400px; @@ -328,7 +305,7 @@ a { padding: 16px 8px; box-sizing: border-box; } - .event-container { + .content-container { position: static; width: 95vw; max-width: 400px; @@ -337,23 +314,23 @@ a { padding: 16px 8px; box-sizing: border-box; } - .login-container h1 { + .form-container h1 { font-size: 1.5em; text-align: center; } - .event-container h1 { + .content-container h1 { font-size: 1.5em; text-align: center; } - .login-container form, - .login-container label, - .login-container input { + .form-container form, + .form-container label, + .form-container input { width: 100%; max-width: 100%; box-sizing: border-box; } - .login-container button, - .login-container a { + .form-container button, + .form-container a { width: 100%; max-width: 100%; margin-top: 8px; @@ -406,8 +383,6 @@ a { margin: 0 12px; } } - -/* Tabellen-Design */ table { width: 100%; border-collapse: separate; @@ -470,7 +445,7 @@ td a:hover { justify-content: flex-start; margin: 24px 0; } -.news-card { +.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); @@ -482,37 +457,86 @@ td a:hover { flex-direction: column; justify-content: space-between; margin: 0; + overflow-wrap: break-word; + overflow: hidden; } -.news-card h3 { +.card h3 { margin: 0 0 8px 0; font-size: 1.2em; color: #222; } -.news-card .news-date { +.card .news-date { font-size: 0.95em; color: #888; margin-bottom: 10px; } -.news-card .news-desc { +.card .news-desc { font-size: 1em; color: #333; margin-bottom: 14px; white-space: pre-line; } -.news-card .admin-btn { +.card .admin-btn { align-self: flex-end; margin: 0 0 0 8px; padding: 6px 12px; font-size: 0.97em; } +.card--wide { + max-width: 700px; + width: 90vw; + display: flex; + overflow-wrap: break-word; + overflow: hidden; +} +.news-desc a { + color: #007b9e; + font-weight: 600; + text-decoration: underline; + margin-left: 4px; + transition: color 0.2s; +} +.news-desc a:hover { + color: #09add0; + text-decoration: underline; +} +.news-card-actions { + margin-top: auto; + display: flex; + gap: 12px; +} +.news-desc { + min-height: 80px; + margin-bottom: 14px; +} @media (max-width: 700px) { .news-cards { flex-direction: column; gap: 16px; } - .news-card { + .card { max-width: 98vw; min-width: unset; width: 100%; } +} +.status-box { + background: #ffe0e0; + color: #b30000; + border: 1px solid #ffb3b3; + border-radius: 6px; + padding: 10px 16px; + margin-bottom: 18px; + width: 100%; + text-align: center; +} +.error-box { + background: #ffe0e0; + color: #b30000; + border: 1px solid #ffb3b3; + border-radius: 6px; + padding: 10px 16px; + margin-bottom: 18px; + width: 100%; + text-align: center; } \ No newline at end of file diff --git a/Controller/NewsController.php b/Controller/NewsController.php index 3a3a82f..1d36fd7 100644 --- a/Controller/NewsController.php +++ b/Controller/NewsController.php @@ -106,4 +106,18 @@ class NewsController { } $this->view->setDoMethodName('showDeleteSuccess'); } + + public function showNewsDetail() { + $id = $_GET['id'] ?? null; + if ($id) { + $news = $this->model->getNewsById($id); + if ($news) { + $this->view->setVars(['news' => $news]); + return; + } + } + // Fehlerfall: zurück zur Übersicht + header('Location: index.php?controller=News&do=showNews'); + exit; + } } \ No newline at end of file diff --git a/Model/Database.php b/Model/Database.php index 6bc235f..19cfcf5 100644 --- a/Model/Database.php +++ b/Model/Database.php @@ -10,10 +10,10 @@ abstract class Database { /** * Zugangsdaten für die Datenbank */ - private $dbName = "pbbfa23csc_bibarts"; //Datenbankname + private $dbName = "bibarts"; //Datenbankname private $linkName = "localhost"; //Datenbank-Server - private $user = "pbbfa23csc"; //Benutzername - private $pw = "gfDVACEQ9BZr"; //Passwort + private $user = "root"; //Benutzername + private $pw = ""; //Passwort /** * Stellt eine Verbindung zur Datenbank her diff --git a/Views/Auth/forgotPassword.phtml b/Views/Auth/forgotPassword.phtml index a6e923f..2e45684 100644 --- a/Views/Auth/forgotPassword.phtml +++ b/Views/Auth/forgotPassword.phtml @@ -1,5 +1,5 @@
-