aboutsummaryrefslogtreecommitdiff
path: root/ui/src/components/user.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-23 17:25:28 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-23 17:25:28 +0100
commit064a7906f6c6e18ad4ce5fb5a19e5e3d02144358 (patch)
treec7e62f961ab5638aa36b1c669bc49d03939bcc41 /ui/src/components/user.rs
parent807cde3a096a6e87d13a98d2ee78578732b1fb45 (diff)
downloadjellything-064a7906f6c6e18ad4ce5fb5a19e5e3d02144358.tar
jellything-064a7906f6c6e18ad4ce5fb5a19e5e3d02144358.tar.bz2
jellything-064a7906f6c6e18ad4ce5fb5a19e5e3d02144358.tar.zst
user settings page
Diffstat (limited to 'ui/src/components/user.rs')
-rw-r--r--ui/src/components/user.rs53
1 files changed, 53 insertions, 0 deletions
diff --git a/ui/src/components/user.rs b/ui/src/components/user.rs
new file mode 100644
index 0000000..815c555
--- /dev/null
+++ b/ui/src/components/user.rs
@@ -0,0 +1,53 @@
+/*
+ This file is part of jellything (https://codeberg.org/metamuffin/jellything)
+ which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
+ Copyright (C) 2026 metamuffin <metamuffin.org>
+*/
+
+use crate::RenderInfo;
+use jellycommon::{
+ jellyobject::Object,
+ routes::{u_account_login, u_account_settings},
+ *,
+};
+use jellyui_locale::tr;
+
+markup::define! {
+ UserSettings<'a>(ri: &'a RenderInfo<'a>, user: Object<'a>) {
+ h1 { @tr(ri.lang, "settings") }
+
+ h2 { @tr(ri.lang, "settings.account") }
+ a.switch_account[href=u_account_login()] { "Switch Account" }
+ p { @tr(ri.lang, "tag.Ulgn") ": " @user.get(USER_LOGIN) }
+ form[method="POST", action=u_account_settings()] {
+ label[for="name"] { @tr(ri.lang, "tag.Unam") }
+ input[type="text", id="name", name="name", value=user.get(USER_NAME)];
+ input[type="submit", value=tr(ri.lang, "settings.update")];
+ }
+ form[method="POST", action=u_account_settings()] {
+ label[for="password"] { @tr(ri.lang, "tag.Upwd") }
+ input[type="password", id="password", name="password"];
+ input[type="submit", value=tr(ri.lang, "settings.update")];
+ }
+
+ // h2 { @tr(ri.lang, "settings.appearance") }
+ // form[method="POST", action=u_account_settings()] {
+ // fieldset {
+ // legend { @tr(ri.lang, "tag.Uthm") }
+ // @for theme in [] {
+ // label { input[type="radio", name="theme", value=A(*theme), checked=session.user.theme==*theme]; @tr(ri.lang, &format!("theme.{theme}")) } br;
+ // }
+ // }
+ // input[type="submit", value=tr(ri.lang, "settings.apply")];
+ // }
+ // form[method="POST", action=u_account_settings()] {
+ // fieldset {
+ // legend { @tr(ri.lang, "settings.player_preference") }
+ // @for kind in PlayerKind::ALL {
+ // label { input[type="radio", name="player_preference", value=A(*kind), checked=session.user.player_preference==*kind]; @tr(ri.lang, &format!("player_kind.{kind}")) } br;
+ // }
+ // }
+ // input[type="submit", value=tr(ri.lang, "settings.apply")];
+ // }
+ }
+}