diff options
Diffstat (limited to 'ui/src/old')
| -rw-r--r-- | ui/src/old/admin/import.rs | 46 | ||||
| -rw-r--r-- | ui/src/old/admin/mod.rs | 64 |
2 files changed, 0 insertions, 110 deletions
diff --git a/ui/src/old/admin/import.rs b/ui/src/old/admin/import.rs deleted file mode 100644 index 805d787..0000000 --- a/ui/src/old/admin/import.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - 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::{FlashM, Page, locale::tr, scaffold::{FlashDisplay, RenderInfo}}; -use jellycommon::routes::u_admin_import_post; - -impl Page for AdminImportPage<'_> { - fn title(&self) -> String { - "Import".to_string() - } - fn to_render(&self) -> markup::DynRender<'_> { - markup::new!(@self) - } -} - -markup::define!( - AdminImportPage<'a>(ri: &'a RenderInfo<'a>, busy: bool, last_import_err: &'a [String], flash: &'a FlashM) { - @FlashDisplay { flash } - @if *busy { - h1 { @tr(ri.lang, "admin.import.running") } - noscript { "Live import progress needs javascript." } - div[id="admin_import"] {} - } else { - h1 { @tr(ri.lang, "admin.import.title") } - @if !last_import_err.is_empty() { - section.message.error { - details { - summary { p.error { @tr(ri.lang, "admin.import_errors").replace("{n}", &last_import_err.len().to_string()) } } - ol { @for e in *last_import_err { - li.error { pre.error { @e } } - }} - } - } - } - form[method="POST", action=u_admin_import_post(true)] { - input[type="submit", value=tr(ri.lang, "admin.dashboard.import.inc").to_string()]; - } - form[method="POST", action=u_admin_import_post(false)] { - input[type="submit", value=tr(ri.lang, "admin.dashboard.import.full").to_string()]; - } - } - } -); diff --git a/ui/src/old/admin/mod.rs b/ui/src/old/admin/mod.rs deleted file mode 100644 index f42ba76..0000000 --- a/ui/src/old/admin/mod.rs +++ /dev/null @@ -1,64 +0,0 @@ -/* - 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> -*/ - -pub mod import; -pub mod log; -pub mod user; - -use crate::{FlashM, Page, locale::tr, scaffold::{FlashDisplay, RenderInfo}}; -use jellycommon::routes::{ - u_admin_import, u_admin_invite_create, u_admin_invite_remove, u_admin_log, - u_admin_update_search, u_admin_users, -}; - -impl Page for AdminDashboardPage<'_> { - fn title(&self) -> String { - "Admin Dashboard".to_string() - } - fn to_render(&self) -> markup::DynRender<'_> { - markup::new!(@self) - } -} - -markup::define!( - AdminDashboardPage<'a>(ri: &'a RenderInfo<'a>, busy: Option<&'static str>, flash: &'a FlashM, invites: &'a [String]) { - h1 { @tr(ri.lang, "admin.dashboard.title") } - @FlashDisplay { flash } - ul { - li{a[href=u_admin_log(true)] { @tr(ri.lang, "admin.log.warnonly") }} - 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") }} - @if let Some(text) = busy { - section.message { p.warn { @text } } - } - form[method="POST", action=u_admin_update_search()] { - input[type="submit", value=tr(ri.lang, "admin.dashboard.update_search").to_string()]; - } - h2 { @tr(ri.lang, "admin.dashboard.users") } - p { a[href=u_admin_users()] { @tr(ri.lang, "admin.dashboard.manage_users") } } - h2 { @tr(ri.lang, "admin.dashboard.invites") } - form[method="POST", action=u_admin_invite_create()] { - input[type="submit", value=tr(ri.lang, "admin.dashboard.create_invite").to_string()]; - } - ul { @for t in *invites { - li { - form[method="POST", action=u_admin_invite_remove()] { - span { @t } - input[type="text", name="invite", value=&t, hidden]; - input[type="submit", value=tr(ri.lang, "admin.dashboard.create_invite").to_string()]; - } - } - }} - - // h2 { "Database" } - // @match db_stats(&database) { - // Ok(s) => { @s } - // Err(e) => { pre.error { @format!("{e:?}") } } - // } - } -); |