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