From d7d121b541c49729f3b68bd39fb4150322e2f60b Mon Sep 17 00:00:00 2001 From: Caroline Schulte Date: Sun, 19 Jul 2026 19:20:12 +0200 Subject: [PATCH 1/4] . --- .idea/dataSources.local.xml | 2 +- content/profile.php | 22 ++++++++++++---------- index.php | 1 + js/profile.js | 29 +++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 js/profile.js diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index b341a8a..707e2b3 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + " diff --git a/content/profile.php b/content/profile.php index 815e5ad..b784d93 100644 --- a/content/profile.php +++ b/content/profile.php @@ -81,10 +81,12 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
-
+ +
@@ -154,14 +156,16 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error); Bearbeiten -
+ +
@@ -172,11 +176,9 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);

Du hast noch keine Beiträge erstellt.

- + diff --git a/index.php b/index.php index 42d054c..31cbe28 100644 --- a/index.php +++ b/index.php @@ -24,6 +24,7 @@ include_once "php/controller/index-controller.php"; + diff --git a/js/profile.js b/js/profile.js new file mode 100644 index 0000000..a11241c --- /dev/null +++ b/js/profile.js @@ -0,0 +1,29 @@ +document.addEventListener("DOMContentLoaded", function () { + + const deleteAccountForm = document.querySelector(".confirm-delete-account"); + + if (deleteAccountForm) { + deleteAccountForm.addEventListener("submit", function (event) { + + if (!confirm("Möchtest du deinen Account und alle deine Beiträge wirklich unwiderruflich löschen?")) { + event.preventDefault(); + } + + }); + } + + const deleteArticleForms = document.querySelectorAll(".confirm-delete-article"); + + deleteArticleForms.forEach(function (form) { + + form.addEventListener("submit", function (event) { + + if (!confirm("Möchtest du diesen Artikel wirklich löschen?")) { + event.preventDefault(); + } + + }); + + }); + +}); \ No newline at end of file -- 2.47.3 From 5eca2f162b0a802b1367b4352470b61953d2ae94 Mon Sep 17 00:00:00 2001 From: Caroline Schulte Date: Sun, 19 Jul 2026 20:10:51 +0200 Subject: [PATCH 2/4] . --- content/search-results.php | 31 ++++++++++++++++--------------- content/showArticle.php | 30 ++++++++++++++++++++---------- index.php | 1 - js/comments.js | 22 ++++++++++++++++++++-- 4 files changed, 56 insertions(+), 28 deletions(-) diff --git a/content/search-results.php b/content/search-results.php index d9a6399..956b416 100644 --- a/content/search-results.php +++ b/content/search-results.php @@ -123,9 +123,9 @@ $categories = [ - + @@ -189,21 +189,22 @@ $categories = [ - + diff --git a/content/showArticle.php b/content/showArticle.php index c5152c1..ae55dbd 100644 --- a/content/showArticle.php +++ b/content/showArticle.php @@ -251,11 +251,23 @@ if ($replyAuthor === null) { (string) $comment->getArticleId() ); ?>"> - +
+ + + + + + +
@@ -383,11 +395,9 @@ if ($replyAuthor === null) { (string) $reply->getArticleId() ); ?>"> - +
diff --git a/index.php b/index.php index 31cbe28..67b3238 100644 --- a/index.php +++ b/index.php @@ -26,7 +26,6 @@ include_once "php/controller/index-controller.php"; - diff --git a/js/comments.js b/js/comments.js index b9b83b0..d1c648b 100644 --- a/js/comments.js +++ b/js/comments.js @@ -11,6 +11,26 @@ document.addEventListener("DOMContentLoaded", function () { const parentCommentInput = document.getElementById("parent-comment-id"); const replyInfo = document.getElementById("reply-info"); + /** + * Fragt vor dem Löschen eines Kommentars nach einer Bestätigung. + * + * Der Listener funktioniert auch für Kommentare, + * die später per AJAX eingefügt werden. + */ + document.addEventListener("submit", function (event) { + if (!event.target.classList.contains("delete-comment-form")) { + return; + } + + const confirmed = confirm( + "Möchtest du diesen Kommentar wirklich löschen?" + ); + + if (!confirmed) { + event.preventDefault(); + } + }); + if (!form || !commentsList || !commentContent || !parentCommentInput) { return; } @@ -152,7 +172,6 @@ document.addEventListener("DOMContentLoaded", function () { @@ -230,7 +249,6 @@ document.addEventListener("DOMContentLoaded", function () { -- 2.47.3 From fedb6f59f5a6793a95dcf7aad7c2af90fa9b188f Mon Sep 17 00:00:00 2001 From: Caroline Schulte Date: Sun, 19 Jul 2026 20:58:52 +0200 Subject: [PATCH 3/4] . --- content/showArticle.php | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/content/showArticle.php b/content/showArticle.php index ae55dbd..dd99c1e 100644 --- a/content/showArticle.php +++ b/content/showArticle.php @@ -237,7 +237,7 @@ if ($replyAuthor === null) {
+ class="delete-comment-form confirm-delete-comment"> getArticleId() ); ?>"> - - - - - - - -
+ @@ -381,7 +368,7 @@ if ($replyAuthor === null) {
+ class="delete-comment-form confirm-delete-comment"> getArticleId() ); ?>"> - +
-- 2.47.3 From ef3699d5f5d706195ed5a623d7970e9c11fec612 Mon Sep 17 00:00:00 2001 From: Caroline Schulte Date: Sun, 19 Jul 2026 21:54:44 +0200 Subject: [PATCH 4/4] =?UTF-8?q?Review=C3=A4nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/search-results.php | 50 ++++++++++++++++++++++++++------------ index.php | 1 + 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/content/search-results.php b/content/search-results.php index 956b416..740a22e 100644 --- a/content/search-results.php +++ b/content/search-results.php @@ -123,9 +123,11 @@ $categories = [ - + @@ -189,22 +191,38 @@ $categories = [ - + diff --git a/index.php b/index.php index 67b3238..0f2fc97 100644 --- a/index.php +++ b/index.php @@ -27,6 +27,7 @@ include_once "php/controller/index-controller.php"; + EduForge -- 2.47.3