diff --git a/backend/__pycache__/app.cpython-311.pyc b/backend/__pycache__/app.cpython-311.pyc
new file mode 100644
index 0000000..e0e7277
Binary files /dev/null and b/backend/__pycache__/app.cpython-311.pyc differ
diff --git a/manifest.toml b/manifest.toml
index a8c8d2f..6db2320 100644
--- a/manifest.toml
+++ b/manifest.toml
@@ -3,7 +3,7 @@ id = "albumik"
name = "Albumik"
description.en = "Lightweight private photo album with folder permissions and guest uploads"
description.pl = "Lekki prywatny album zdjęć z katalogami, gośćmi i akceptacją zdjęć"
-version = "0.1.1~ynh1"
+version = "0.1.2~ynh1"
maintainers = ["Filip"]
[upstream]
diff --git a/web/app.js b/web/app.js
index 549d2e8..36d824e 100644
--- a/web/app.js
+++ b/web/app.js
@@ -221,3 +221,110 @@ $('#rejectPhotoBtn').addEventListener('click', async()=>{
});
init();
+
+/* Albumik 0.1.2 - Moje konto */
+function albumikEscape(value) {
+ return String(value ?? "")
+ .replaceAll("&", "&")
+ .replaceAll("<", "<")
+ .replaceAll(">", ">")
+ .replaceAll('"', """)
+ .replaceAll("'", "'");
+}
+
+function albumikRenderAccountView() {
+ const main =
+ document.querySelector("#content") ||
+ document.querySelector(".content") ||
+ document.querySelector("main") ||
+ document.querySelector(".main");
+
+ if (!main) return;
+
+ const user = window.state?.user || state?.user || {};
+
+ main.innerHTML = `
+
+
+
+
Dane konta
+
Login${albumikEscape(user.username || "")}
+
Nazwa${albumikEscape(user.display_name || "")}
+
Rola${albumikEscape(user.role || "")}
+
+
+
+ `;
+
+ document.querySelector("#changePasswordForm")?.addEventListener("submit", async (e) => {
+ e.preventDefault();
+
+ const fd = new FormData(e.currentTarget);
+ const current_password = fd.get("current_password");
+ const new_password = fd.get("new_password");
+ const repeat_password = fd.get("repeat_password");
+ const err = document.querySelector("#changePasswordError");
+
+ err.style.color = "";
+
+ if (new_password !== repeat_password) {
+ err.textContent = "Nowe hasła nie są takie same.";
+ return;
+ }
+
+ try {
+ const res = await api("/api/me/password", {
+ method: "POST",
+ body: JSON.stringify({ current_password, new_password })
+ });
+
+ if (!res.ok) {
+ err.textContent = res.error || "Nie udało się zmienić hasła.";
+ return;
+ }
+
+ err.style.color = "#16a34a";
+ err.textContent = "Hasło zostało zmienione.";
+ e.currentTarget.reset();
+ } catch (ex) {
+ err.textContent = "Błąd połączenia z serwerem.";
+ }
+ });
+}
+
+document.addEventListener("click", (e) => {
+ const btn = e.target.closest('[data-view="account"]');
+ if (!btn) return;
+
+ e.preventDefault();
+
+ try {
+ state.currentView = "account";
+ } catch (e) {}
+
+ document.querySelectorAll(".nav-btn").forEach((b) => b.classList.remove("active"));
+ btn.classList.add("active");
+
+ albumikRenderAccountView();
+});
diff --git a/web/index.html b/web/index.html
index 194c561..717b8fc 100644
--- a/web/index.html
+++ b/web/index.html
@@ -4,12 +4,12 @@
Albumik
-
+
-
A
+
Albumik
Lekki prywatny album zdjęć na Twoim serwerze.