From 8ab13c554e74b97f55a6f0ecf684a1c815c4b13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sun, 4 Feb 2024 09:26:17 +0100 Subject: [PATCH] test --- assets/script.js | 12 +++++++ assets/style.css | 15 ++++++++- templates/userActions.html | 66 ++++++++------------------------------ 3 files changed, 40 insertions(+), 53 deletions(-) diff --git a/assets/script.js b/assets/script.js index d980d0e..713f40f 100644 --- a/assets/script.js +++ b/assets/script.js @@ -28,6 +28,18 @@ function handleResponse(data, SuccessMessage, failureMessage) { } else { StatusMessageElement.innerText = failureMessage; } + + // Show the status message + StatusMessageElement.style.display = "block"; + setTimeout(() => { + // Hide the status message after 3 seconds + StatusMessageElement.style.opacity = 0; + setTimeout(() => { + StatusMessageElement.style.display = "none"; + // Reset opacity for future messages + StatusMessageElement.style.opacity = 1; + }, 500); + }, 3000); } function logout() { diff --git a/assets/style.css b/assets/style.css index 9da1dc7..f09e606 100644 --- a/assets/style.css +++ b/assets/style.css @@ -211,6 +211,20 @@ header ul li { margin-left: 20px; } +#StatusMessage { + display: none; + position: fixed; + top: 20px; + right: 20px; + padding: 10px; + background-color: var(--third-bg); + color: var(--primary-text); + border-radius: 5px; + opacity: 0; + transition: opacity 0.5s ease-in-out; +} + + /* */ /* ZAČÍNAJ VŠETKO S ".dashboard" */ @@ -221,5 +235,4 @@ header ul li { text-align: center; } - /* */ \ No newline at end of file diff --git a/templates/userActions.html b/templates/userActions.html index 7eaa25b..465a0b2 100644 --- a/templates/userActions.html +++ b/templates/userActions.html @@ -63,53 +63,14 @@ function init(){ getUserInfo(); } - - function displayUserInfo(userData) { - const tableContainer = document.getElementById("userInfoTable"); - tableContainer.innerHTML = ""; // Clear previous content - - const table = document.createElement("table"); - table.border = "1"; - - const headerRow = table.insertRow(0); - for (const key in userData) { - const th = document.createElement("th"); - th.appendChild(document.createTextNode(key)); - headerRow.appendChild(th); - } - - const dataRow = table.insertRow(1); - for (const key in userData) { - const td = document.createElement("td"); - td.appendChild(document.createTextNode(userData[key])); - dataRow.appendChild(td); - } - - tableContainer.appendChild(table); - } window.onload = init();

-
- -
-

Change Password

-
- -
- - -
- - -

-
-
-

Update User Profile

+

Update User


@@ -124,19 +85,7 @@
-

-
-
-

Get User Info

-
- -

-
- -
-

Update User Email

-

@@ -144,4 +93,17 @@

+
+

Change Password

+
+ +
+ + +
+ + +

+
+