diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-24 17:56:16 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-24 17:56:16 +0100 |
| commit | 6949f8d40d1784d5a9c54dbe44e212fe2fae76f4 (patch) | |
| tree | 6c3851aa40ba37945bcbc0e78d53d6aea569586e /ui/src/components | |
| parent | e7ed6eecbd9ccce486b34454fe77d71a22d1bfe2 (diff) | |
| download | jellything-6949f8d40d1784d5a9c54dbe44e212fe2fae76f4.tar jellything-6949f8d40d1784d5a9c54dbe44e212fe2fae76f4.tar.bz2 jellything-6949f8d40d1784d5a9c54dbe44e212fe2fae76f4.tar.zst | |
user list
Diffstat (limited to 'ui/src/components')
| -rw-r--r-- | ui/src/components/admin.rs | 12 | ||||
| -rw-r--r-- | ui/src/components/mod.rs | 5 | ||||
| -rw-r--r-- | ui/src/components/user.rs | 5 |
3 files changed, 16 insertions, 6 deletions
diff --git a/ui/src/components/admin.rs b/ui/src/components/admin.rs index cddb0e2..cd691a2 100644 --- a/ui/src/components/admin.rs +++ b/ui/src/components/admin.rs @@ -7,7 +7,7 @@ use crate::RenderInfo; use jellycommon::{ jellyobject::Object, - routes::{u_admin_import, u_admin_import_post, u_admin_log}, + routes::{u_admin_import, u_admin_import_post, u_admin_log, u_admin_users, u_user}, *, }; use jellyui_locale::tr; @@ -20,7 +20,8 @@ markup::define!( li{a[href=u_admin_log(false)] { @tr(ri.lang, "admin.log.full") }} } - a[href=u_admin_import()] { h2 { @tr(ri.lang, "admin.import.title") }} + a[href=u_admin_import()] { h2 { @tr(ri.lang, "admin.import") }} + a[href=u_admin_users()] { h2 { @tr(ri.lang, "admin.users") }} } AdminImport<'a>(ri: &'a RenderInfo<'a>, data: Object<'a>) { @@ -55,4 +56,11 @@ markup::define!( pre { @data.get(ADMIN_INFO_TEXT) } } + AdminUserList<'a>(ri: &'a RenderInfo<'a>, data: Object<'a>) { + h1 { @tr(ri.lang, "admin.users") } + ul { @for u in data.iter(ADMIN_USER_LIST_ITEM) { + li { a[href=u_user(u.get(USER_LOGIN).unwrap_or_default())] { @u.get(USER_LOGIN) } } + }} + } + ); diff --git a/ui/src/components/mod.rs b/ui/src/components/mod.rs index dde77b0..e7e5f9c 100644 --- a/ui/src/components/mod.rs +++ b/ui/src/components/mod.rs @@ -18,7 +18,7 @@ pub mod user; use crate::{ RenderInfo, components::{ - admin::{AdminDashboard, AdminImport, AdminInfo}, + admin::{AdminDashboard, AdminImport, AdminInfo, AdminUserList}, login::{AccountLogin, AccountLogout, AccountSetPassword}, message::Message, node_list::NodeList, @@ -64,5 +64,8 @@ define! { @if let Some(user) = view.get(VIEW_USER_SETTINGS) { @UserSettings { ri, user } } + @if let Some(data) = view.get(VIEW_ADMIN_USER_LIST) { + @AdminUserList { ri, data } + } } } diff --git a/ui/src/components/user.rs b/ui/src/components/user.rs index cf1c123..22b296e 100644 --- a/ui/src/components/user.rs +++ b/ui/src/components/user.rs @@ -17,8 +17,8 @@ markup::define! { h1 { @tr(ri.lang, "settings") } h2 { @tr(ri.lang, "settings.account") } - a.switch_account[href=u_account_login()] { button { "Switch Account" } } - a.switch_account[href=u_account_logout()] { button { "Log out" } } + a[href=u_account_login()] { button { "Switch Account" } } + a[href=u_account_logout()] { button { "Log out" } } 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") } @@ -41,7 +41,6 @@ markup::define! { input[type="range", id="accent", name="theme_accent", min=0, max=360, step=1, value=user.get(USER_THEME_ACCENT)]; input[type="submit", value=tr(ri.lang, "settings.update")]; } - // h2 { @tr(ri.lang, "settings.appearance") } // form[method="POST", action=u_account_settings()] { // fieldset { |