diff --git a/crates/im-web/assets/main.css b/crates/im-web/assets/main.css index ab6e15e..e2dc4d2 100644 --- a/crates/im-web/assets/main.css +++ b/crates/im-web/assets/main.css @@ -313,6 +313,11 @@ body:has(.auth-stage) > .auth-stage::-webkit-scrollbar { letter-spacing: 0.02em; } +.landing-nav { + justify-content: center; + padding: 4px 0 10px; +} + .auth-card { background: var(--surface); border: 1px solid var(--border); @@ -402,6 +407,12 @@ body:has(.auth-stage) > .auth-stage::-webkit-scrollbar { border-color: var(--danger); } +textarea.auth-input { + height: auto; + padding: 10px 12px; + resize: vertical; +} + .auth-input-mono { font-family: var(--font-mono); } diff --git a/crates/im-web/src/admin.rs b/crates/im-web/src/admin.rs index aa2ddd9..ba911ad 100644 --- a/crates/im-web/src/admin.rs +++ b/crates/im-web/src/admin.rs @@ -126,7 +126,7 @@ async fn admin_page(cx: &Cx) -> Result { .query() .unwrap_or("") .to_string(); - let section = query_value(&query, "section").unwrap_or_else(|| "account".to_string()); + let section = query_value(&query, "section").unwrap_or_else(|| "users".to_string()); let error = query_value(&query, "error"); let ok = query_value(&query, "ok"); let why = query_value(&query, "why"); @@ -134,7 +134,6 @@ async fn admin_page(cx: &Cx) -> Result { let nav = |current: &str| { [ - ("account", t(lang, Key::NavAccount)), ("users", t(lang, Key::NavUsers)), ("mail", t(lang, Key::NavMail)), ("settings", t(lang, Key::NavSettings)), @@ -155,7 +154,7 @@ async fn admin_page(cx: &Cx) -> Result { "settings" => settings_section(cx, lang).await?, "logs" => logs_section(cx, lang).await?, "users" => users_section(cx, &me, invited.as_deref(), lang).await?, - _ => account_section(&me, lang), + _ => users_section(cx, &me, invited.as_deref(), lang).await?, }; let banner = match (ok.as_deref(), error.as_deref()) { @@ -169,7 +168,7 @@ async fn admin_page(cx: &Cx) -> Result { "enabled" => t(lang, Key::OkEnabled), "smtp" => t(lang, Key::OkSmtpSaved), "smtp_test" => t(lang, Key::OkSmtpTest), - "password" => t(lang, Key::OkPasswordChanged), + "message" => t(lang, Key::OkMessageSent), "uninvited" => t(lang, Key::OkUninvited), "deleted" => t(lang, Key::OkDeleted), "settings" => t(lang, Key::OkSettingsSaved), @@ -207,38 +206,6 @@ async fn admin_page(cx: &Cx) -> Result { .await? .into_response(cx) } -/// The self-service half of the panel: the account the panel is signed in -/// as. Izlek keeps this on the settings rail's first tab; so do we. -fn account_section(me: &User, lang: i18n::Lang) -> String { - let two_factor = if me.totp_confirmed { - t(lang, Key::TwoFactorOnNote) - } else { - t(lang, Key::TwoFactorOffNote) - }; - format!( - r#"
-
{title}
-
{sub}
-
- - - - -
-
{note}
-
"#, - title = t(lang, Key::AccountTitle), - sub = i18n::account_sub(lang, &escape(&me.email), two_factor), - current = t(lang, Key::CurrentPasswordLabel), - new = t(lang, Key::NewPasswordLabel), - again = t(lang, Key::NewPasswordAgainLabel), - change = t(lang, Key::ChangePassword), - note = t(lang, Key::AccountPasswordNote), - ) -} /// One person's live sessions as the disclosure under their row: a small /// table with a per-session revoke, or the muted line when nothing is live. @@ -337,10 +304,7 @@ async fn users_section( .join(" · "); let actions = if user.id == me.id { // Never let the only admin lock themselves out by reflex. - format!( - r#"{}"#, - t(lang, Key::YouWord) - ) + format!(r#"{}"#, t(lang, Key::YouWord)) } else { let id = escape(&user.id.to_string()); let email = escape(&user.email); @@ -567,6 +531,38 @@ async fn mail_section(cx: &Cx, lang: i18n::Lang) -> Result{lede}"#) }; + let users = accounts::list_users(store).await?; + let mut options = format!( + r#""#, + t(lang, Key::EveryoneOption) + ); + for person in &users { + options.push_str(&format!( + r#""#, + escape(person.id.as_str()), + escape(&person.name), + escape(&person.email), + )); + } + let message_card = format!( + r#"
+
{msg_title}
+
+ + + + +
+
"#, + msg_title = t(lang, Key::MessageTitle), + to_label = t(lang, Key::MessageToLabel), + subject_label = t(lang, Key::MessageSubjectLabel), + body_label = t(lang, Key::MessageBodyLabel), + send = t(lang, Key::SendMessageButton), + ); Ok(format!( r#"
{title}
{chip_text}
@@ -609,6 +605,7 @@ async fn mail_section(cx: &Cx, lang: i18n::Lang) -> Result Result { @@ -730,50 +727,10 @@ async fn delete(cx: &Cx, Form(input): Form) -> Result { back(cx, "users", "&ok=deleted") } -#[derive(Deserialize)] -struct PasswordForm { - current: String, - password: String, - password_confirm: String, -} - -#[route(POST "/admin/password")] -async fn password(cx: &Cx, Form(input): Form) -> Result { - let me = match require_admin(cx).await { - Ok(me) => me, - Err(redirect) => return Ok(redirect), - }; - if input.password != input.password_confirm { - return back(cx, "account", "&error=passwords_differ"); - } - let store = &app(cx).store; - match accounts::change_password(store, &me, &input.current, &input.password).await { - Ok(()) => {} - Err(accounts::AccountError::Password(problem)) => { - use im_core::accounts::PasswordProblem::*; - let code = match problem { - TooShort => "password_too_short", - LooksLikeYou => "password_personal", - WrongCurrent => "password_wrong", - IsCurrent => "password_same", - }; - return back(cx, "account", &format!("&error={code}")); - } - Err(e) => return Err(topcoat::Error::from(std::io::Error::other(e.to_string()))), - } - // Every other device is out; the browser holding this form proved the - // old password and keeps its session. - if let Some(token) = server::presented_session(cx) { - im_core::sessions::revoke_user_sessions_except(store, &me.id, &token).await?; - } - server::log_event(cx, "password_changed", Some(&me.email), None).await; - back(cx, "account", "&ok=password") -} #[derive(Deserialize)] struct UserAction { user: String, } - #[route(POST "/admin/revoke")] async fn revoke(cx: &Cx, Form(input): Form) -> Result { let me = match require_admin(cx).await { @@ -908,6 +865,9 @@ async fn smtp_test(cx: &Cx) -> Result { Ok(me) => me, Err(redirect) => return Ok(redirect), }; + if !settings::smtp(&app(cx).store).await?.configured() { + return back(cx, "mail", "&error=sender_unset"); + } match mailer::send_test(&app(cx).store, &me.email, lang_of(Some(&me))).await { Ok(()) => { server::log_event(cx, "smtp_test_sent", Some(&me.email), None).await; @@ -932,6 +892,71 @@ async fn smtp_test(cx: &Cx) -> Result { } } } + +#[derive(Deserialize)] +struct MessageForm { + to: String, + subject: String, + body: String, +} + +/// The composed notice, izlek's `send_message`: one person or everyone (the +/// admin excluded — they wrote it), the words verbatim through the +/// configured sender. A failure answers with the server's own words, like +/// the test mail does. +#[route(POST "/admin/message")] +async fn message(cx: &Cx, Form(input): Form) -> Result { + let me = match require_admin(cx).await { + Ok(me) => me, + Err(redirect) => return Ok(redirect), + }; + let store = &app(cx).store; + if !settings::smtp(store).await?.configured() { + return back(cx, "mail", "&error=sender_unset"); + } + let subject = input.subject.trim(); + if subject.is_empty() { + return back(cx, "mail", "&error=empty_subject"); + } + let body = input.body.trim(); + if body.is_empty() { + return back(cx, "mail", "&error=empty_body"); + } + let users = accounts::list_users(store).await?; + let recipients: Vec = if input.to == "everyone" { + users + .into_iter() + .filter(|person| person.id != me.id) + .map(|person| person.email) + .collect() + } else { + match users + .into_iter() + .find(|person| person.id.as_str() == input.to) + { + Some(person) => vec![person.email], + None => return back(cx, "mail", "&error=no_such_user"), + } + }; + if recipients.is_empty() { + return back(cx, "mail", "&error=no_such_user"); + } + for recipient in &recipients { + if let Err(e) = mailer::send_message(store, recipient, subject, body.to_string()).await { + server::log_event(cx, "message_failed", Some(&me.email), Some(&e.to_string())).await; + return back( + cx, + "mail", + &format!( + "&error=message&why={}", + crate::oidc::urlencode(&e.to_string()) + ), + ); + } + } + server::log_event(cx, "message_sent", Some(&me.email), Some(subject)).await; + back(cx, "mail", "&ok=message") +} /// Dials the mail server without sending, on an admin's say-so, and writes /// down what it said. The result shows on the Mail section as the standing /// line; the panel redirects straight back. @@ -941,6 +966,9 @@ async fn smtp_check(cx: &Cx) -> Result { Ok(me) => me, Err(redirect) => return Ok(redirect), }; + if !settings::smtp(&app(cx).store).await?.configured() { + return back(cx, "mail", "&error=sender_unset"); + } probe(store_of(cx), app(cx).live.clone()).await; server::log_event(cx, "smtp_checked", Some(&me.email), None).await; back(cx, "mail", "") diff --git a/crates/im-web/src/auth.rs b/crates/im-web/src/auth.rs index fe062f7..78ab347 100644 --- a/crates/im-web/src/auth.rs +++ b/crates/im-web/src/auth.rs @@ -371,10 +371,10 @@ async fn revoke_session(cx: &Cx, Form(input): Form) -> Redire .find(|s| s.token_hash == input.session) .and_then(|s| s.ip); if !im_core::sessions::revoke_owned_session(store, &user.id, &input.session).await? { - return see("/?error=session_unknown".to_string()); + return see("/?section=sessions&error=session_unknown".to_string()); } server::log_event(cx, "session_revoked", Some(&user.email), ip.as_deref()).await; - see("/?ok=session_revoked".to_string()) + see("/?section=sessions&ok=session_revoked".to_string()) } #[derive(Deserialize)] @@ -393,27 +393,27 @@ async fn preferences(cx: &Cx, Form(input): Form) -> Redirect { return see("/".to_string()); }; let Some(theme) = input.theme.as_deref() else { - return see("/?error=bad_theme".to_string()); + return see("/?section=preferences&error=bad_theme".to_string()); }; if theme != "light" && theme != "dark" { - return see("/?error=bad_theme".to_string()); + return see("/?section=preferences&error=bad_theme".to_string()); } let Some(ui) = input.ui.as_deref() else { - return see("/?error=bad_ui".to_string()); + return see("/?section=preferences&error=bad_ui".to_string()); }; if ui != "instrument" && ui != "ledger" { - return see("/?error=bad_ui".to_string()); + return see("/?section=preferences&error=bad_ui".to_string()); } let Some(language) = input.language.as_deref() else { - return see("/?error=bad_language".to_string()); + return see("/?section=preferences&error=bad_language".to_string()); }; if language != "en" && language != "tr" { - return see("/?error=bad_language".to_string()); + return see("/?section=preferences&error=bad_language".to_string()); } let store = &server::app(cx).store; im_core::accounts::set_preferences(store, &user.id, theme, language, ui).await?; server::log_event(cx, "preferences_saved", Some(&user.email), None).await; - see("/?ok=preferences".to_string()) + see("/?section=preferences&ok=preferences".to_string()) } #[derive(Deserialize)] @@ -433,7 +433,7 @@ async fn password(cx: &Cx, Form(input): Form) -> Redirect { return see("/".to_string()); }; if input.password != input.password_confirm { - return see("/?error=passwords_differ".to_string()); + return see("/?section=password&error=passwords_differ".to_string()); } let store = &server::app(cx).store; match im_core::accounts::change_password(store, &me, &input.current, &input.password).await { @@ -446,7 +446,7 @@ async fn password(cx: &Cx, Form(input): Form) -> Redirect { WrongCurrent => "password_wrong", IsCurrent => "password_same", }; - return see(format!("/?error={code}")); + return see(format!("/?section=password&error={code}")); } Err(e) => return Err(topcoat::Error::from(std::io::Error::other(e.to_string()))), } @@ -454,5 +454,5 @@ async fn password(cx: &Cx, Form(input): Form) -> Redirect { im_core::sessions::revoke_user_sessions_except(store, &me.id, &token).await?; } server::log_event(cx, "password_changed", Some(&me.email), None).await; - see("/?ok=password".to_string()) + see("/?section=password&ok=password".to_string()) } diff --git a/crates/im-web/src/i18n.rs b/crates/im-web/src/i18n.rs index dfc4b22..cadd0c4 100644 --- a/crates/im-web/src/i18n.rs +++ b/crates/im-web/src/i18n.rs @@ -81,6 +81,7 @@ pub enum Key { SignInSub, EmailLabel, PasswordLabel, + ProfileLabel, SignInButton, ForgotIt, BrandFooter, @@ -139,7 +140,6 @@ pub enum Key { RevokeButton, // Admin panel nav and banners. - NavAccount, NavUsers, NavMail, NavSettings, @@ -150,16 +150,25 @@ pub enum Key { OkEnabled, OkSmtpSaved, OkSmtpTest, - OkPasswordChanged, OkUninvited, OkDeleted, OkSettingsSaved, - - // Admin account section. - AccountTitle, - SignedInAs, - TwoFactorOnNote, - TwoFactorOffNote, + OkMessageSent, + + // Admin mail section: the composed notice. + MessageTitle, + MessageToLabel, + EveryoneOption, + MessageSubjectLabel, + MessageBodyLabel, + SendMessageButton, + ErrEmptySubject, + ErrEmptyBody, + ErrNoSuchUser, + ErrMessageFailed, + ErrSenderUnset, + + // Landing password pane. AccountPasswordNote, // Admin users section. @@ -330,6 +339,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { (EmailLabel, Tr) => "E-posta", (PasswordLabel, En) => "Password", (PasswordLabel, Tr) => "Parola", + (ProfileLabel, En) => "Profile", + (ProfileLabel, Tr) => "Profil", (SignInButton, En) => "Sign in", (SignInButton, Tr) => "Giriş yap", (ForgotIt, En) => "Forgot it?", @@ -347,7 +358,9 @@ pub fn t(lang: Lang, key: Key) -> &'static str { (InviteTitle, En) => "You're invited", (InviteTitle, Tr) => "Davetlisin", (InviteSub, En) => "Pick a name and a password. Next step sets up two-factor sign-in.", - (InviteSub, Tr) => "Bir ad ve bir parola seç. Sonraki adımda iki faktörlü girişi kuracaksın.", + (InviteSub, Tr) => { + "Bir ad ve bir parola seç. Sonraki adımda iki faktörlü girişi kuracaksın." + } (YourNameLabel, En) => "Your name", (YourNameLabel, Tr) => "Adın", (PasswordAgainLabel, En) => "Password again", @@ -444,8 +457,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { (RevokeButton, En) => "Revoke", (RevokeButton, Tr) => "İptal et", - (NavAccount, En) => "Account", - (NavAccount, Tr) => "Hesap", (NavUsers, En) => "Users", (NavUsers, Tr) => "Kullanıcılar", (NavMail, En) => "Mail", @@ -466,25 +477,42 @@ pub fn t(lang: Lang, key: Key) -> &'static str { (OkSmtpSaved, Tr) => "Posta ayarları kaydedildi.", (OkSmtpTest, En) => "Test mail sent.", (OkSmtpTest, Tr) => "Test postası gönderildi.", - (OkPasswordChanged, En) => "Password changed — every other device is signed out.", - (OkPasswordChanged, Tr) => "Parola değişti — diğer tüm cihazların oturumu kapatıldı.", (OkUninvited, En) => "Invite invalidated — the link is dead.", (OkUninvited, Tr) => "Davet geçersiz kılındı — bağlantı artık ölü.", (OkDeleted, En) => "Account deleted.", (OkDeleted, Tr) => "Hesap silindi.", (OkSettingsSaved, En) => "Settings saved.", (OkSettingsSaved, Tr) => "Ayarlar kaydedildi.", + (OkMessageSent, En) => "Message sent.", + (OkMessageSent, Tr) => "Mesaj gönderildi.", + + (MessageTitle, En) => "Send a message", + (MessageTitle, Tr) => "Mesaj gönder", + (MessageToLabel, En) => "To", + (MessageToLabel, Tr) => "Kime", + (EveryoneOption, En) => "Everyone", + (EveryoneOption, Tr) => "Herkes", + (MessageSubjectLabel, En) => "Subject", + (MessageSubjectLabel, Tr) => "Konu", + (MessageBodyLabel, En) => "Message", + (MessageBodyLabel, Tr) => "Mesaj", + (SendMessageButton, En) => "Send", + (SendMessageButton, Tr) => "Gönder", + (ErrEmptySubject, En) => "A subject is needed.", + (ErrEmptySubject, Tr) => "Bir konu gerekli.", + (ErrEmptyBody, En) => "The message is empty.", + (ErrEmptyBody, Tr) => "Mesaj boş.", + (ErrNoSuchUser, En) => "No such person.", + (ErrNoSuchUser, Tr) => "Böyle biri yok.", + (ErrMessageFailed, En) => "That mail did not send — the server's words are below.", + (ErrMessageFailed, Tr) => "Posta gönderilemedi — sunucunun söyledikleri aşağıda.", + (ErrSenderUnset, En) => "Set up the sender above first.", + (ErrSenderUnset, Tr) => "Önce yukarıdan göndereni kur.", - (AccountTitle, En) => "Account", - (AccountTitle, Tr) => "Hesap", - (SignedInAs, En) => "Signed in as", - (SignedInAs, Tr) => "Giriş yapılan hesap", - (TwoFactorOnNote, En) => "two-factor is on", - (TwoFactorOnNote, Tr) => "iki faktörlü doğrulama açık", - (TwoFactorOffNote, En) => "two-factor is NOT on — sign out and back in to set it up", - (TwoFactorOffNote, Tr) => "iki faktörlü doğrulama KAPALI — kurmak için oturumu kapatıp tekrar aç", (AccountPasswordNote, En) => "Changing it signs every other device out — this one stays.", - (AccountPasswordNote, Tr) => "Değiştirince diğer tüm cihazların oturumu kapanır — bu cihaz açık kalır.", + (AccountPasswordNote, Tr) => { + "Değiştirince diğer tüm cihazların oturumu kapanır — bu cihaz açık kalır." + } (AdminSessionsEmpty, En) => "No active sessions", (AdminSessionsEmpty, Tr) => "Aktif oturum yok", @@ -666,20 +694,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { } } -/// The account section's "Signed in as … · …" line, in the admin's language. -/// `email_html` is already escaped; the mono span is markup, not prose. -pub fn account_sub(lang: Lang, email_html: &str, two_factor: &str) -> String { - match lang { - Lang::En => format!( - "{} {email_html} · {two_factor}.", - t(lang, Key::SignedInAs) - ), - Lang::Tr => format!( - "{email_html} olarak giriş yapıldı · {two_factor}." - ), - } -} - /// A user row's "Sessions (N)" disclosure summary, in the viewer's language. pub fn sessions_summary(lang: Lang, n: usize) -> String { match lang { diff --git a/crates/im-web/src/mailer.rs b/crates/im-web/src/mailer.rs index 8631435..e85335b 100644 --- a/crates/im-web/src/mailer.rs +++ b/crates/im-web/src/mailer.rs @@ -2,9 +2,9 @@ //! built per send: settings can change at any moment, and invites are rare — //! the pool a long-lived transport would buy serves nothing here. +use crate::i18n::{self, Lang}; use im_core::settings::{self, Smtp}; use im_core::store::Store; -use crate::i18n::{self, Lang}; #[derive(Debug, thiserror::Error)] pub enum MailError { @@ -137,3 +137,9 @@ pub async fn send_test(store: &Store, to: &str, lang: Lang) -> Result<()> { ) .await } + +/// The panel's composed notice, izlek's `send_message`: the admin's words +/// verbatim, to one address at a time, through the configured sender. +pub async fn send_message(store: &Store, to: &str, subject: &str, body: String) -> Result<()> { + send(store, to, subject, body).await +} diff --git a/crates/im-web/src/pages.rs b/crates/im-web/src/pages.rs index 0d7d454..e1424be 100644 --- a/crates/im-web/src/pages.rs +++ b/crates/im-web/src/pages.rs @@ -42,6 +42,11 @@ pub fn error_text(code: &str, lang: Lang) -> &'static str { "bad_theme" => t(lang, Key::ErrBadTheme), "bad_ui" => t(lang, Key::ErrBadUi), "bad_language" => t(lang, Key::ErrBadLanguage), + "empty_subject" => t(lang, Key::ErrEmptySubject), + "empty_body" => t(lang, Key::ErrEmptyBody), + "no_such_user" => t(lang, Key::ErrNoSuchUser), + "message" => t(lang, Key::ErrMessageFailed), + "sender_unset" => t(lang, Key::ErrSenderUnset), _ => t(lang, Key::ErrFallback), } } @@ -569,10 +574,13 @@ fn sessions_html( /// the proof of session, the person's profile — photo and the counts their /// identity has earned — and the way out. izlek gives a profile its own /// page under `/people`; im has exactly one signed-in screen, so the -/// profile is a section of it. +/// profile is a section of it. Six cards in one column ran twice the height +/// of a window, so the landing is sectioned like the admin panel: a tab row +/// under the wordmark, one section's cards at a time. async fn signed_in(cx: &Cx, user: &im_core::model::User) -> Result { let lang = lang_of(Some(user)); let query = current_query(cx); + let section = query_value(&query, "section").unwrap_or_else(|| "profile".to_string()); let ok = query_value(&query, "ok"); let error = query_value(&query, "error"); let stats = im_core::stats::profile_stats(&server::app(cx).store, &user.id).await?; @@ -580,43 +588,141 @@ async fn signed_in(cx: &Cx, user: &im_core::model::User) -> Result { let sessions = im_core::sessions::list_sessions(&server::app(cx).store, &user.id).await?; let current = server::presented_session(cx).map(|token| im_core::accounts::hash_token(&token)); let sessions_html = sessions_html(&sessions, current.as_deref(), lang); + // Same idiom as the admin panel's nav: one tab per section, the live one + // underlined. + let nav = [ + ("profile", t(lang, Key::ProfileLabel)), + ("sessions", t(lang, Key::SessionsTitle)), + ("preferences", t(lang, Key::PreferencesLabel)), + ("password", t(lang, Key::PasswordLabel)), + ] + .into_iter() + .map(|(id, label)| { + format!( + r#"{label}"#, + if id == section { " admin-nav-on" } else { "" } + ) + }) + .collect::(); let stage = view! { cx =>
(wordmark(cx).await?) -
-
- if user.has_photo { - // The face is the whole control surface: it opens - // the viewer, and the viewer carries Change/Remove - // (avatar_script builds them for `data-own`). The - // picker input hides here, unreached until the - // viewer's Change label points at it by id. - - - } else { - // Without one, the face itself is the picker: the - // label wraps the hidden input, which autosubmits - // on change (avatar_script) — no buttons at all. -
+ } + if section == "preferences" { +
+
(t(lang, Key::PreferencesLabel))
+
+ + + + +
+
+ } + if section == "password" { +
+
(t(lang, Key::ChangePassword))
+
+ + + + +
+
(t(lang, Key::AccountPasswordNote))
+
+ } + if section != "sessions" && section != "preferences" && section != "password" { +
+
+ if user.has_photo { + // The face is the whole control surface: it opens + // the viewer, and the viewer carries Change/Remove + // (avatar_script builds them for a `data-own` + // face). The picker input hides here, unreached + // until the viewer's Change label points at it by + // id. + Result { form="profile-photo-form" data-autosubmit="" > - - } -
-
(user.name.clone())
-
- if user.totp_confirmed { - (t(lang, Key::TwoFaOn)) - } else { - (t(lang, Key::TwoFaOff)) - } - if user.admin { - (t(lang, Key::AdminChip)) - } + } else { + // Without one, the face itself is the picker: the + // label wraps the hidden input, which autosubmits + // on change (avatar_script) — no buttons at all. + + } +
+
(user.name.clone())
+
+ if user.totp_confirmed { + (t(lang, Key::TwoFaOn)) + } else { + (t(lang, Key::TwoFaOff)) + } + if user.admin { + (t(lang, Key::AdminChip)) + } +
-
- if let Some(code) = ok { -
(ok_text(&code, lang))
- } - if let Some(code) = error { -
(error_text(&code, lang))
- } -
-
-
(t(lang, Key::EmailLabel))
-
(user.email.clone())
-
-
-
(t(lang, Key::MemberSinceLabel))
-
(joined)
-
-
- (t(lang, Key::PublicProfileLink)) - // Both forms carry no visible chrome of their own: the - // picker input hides beside the face, the remove button - // lives in the viewer — all reaching here by `form=`. -
- if user.has_photo { +
+
+
(t(lang, Key::EmailLabel))
+
(user.email.clone())
+
+
+
(t(lang, Key::MemberSinceLabel))
+
(joined)
+
+
+ (t(lang, Key::PublicProfileLink)) + if user.admin { + (t(lang, Key::AdminPanelLink)) + } + // Both forms carry no visible chrome of their own: the + // picker input hides beside the face, the remove button + // lives in the viewer — all reaching here by `form=`.
- } -
-
-
-
-
(stats.sign_ins)
-
(t(lang, Key::StatSignIns))
-
-
-
(stats.active_sessions)
-
(t(lang, Key::StatActiveSessions))
-
-
-
(stats.connected_apps)
-
(t(lang, Key::StatConnectedApps))
-
-
-
-
-
(t(lang, Key::SessionsTitle))
-
(topcoat::view::Unescaped::new_unchecked(sessions_html))
-
-
-
(t(lang, Key::PreferencesLabel))
-
- - - - -
-
-
-
(t(lang, Key::ChangePassword))
-
- - - - -
-
(t(lang, Key::AccountPasswordNote))
-
-
-
- -
- if user.admin { - (t(lang, Key::AdminPanelLink)) - } -
+ if user.has_photo { +
+ } +
+
+
+
+
(stats.sign_ins)
+
(t(lang, Key::StatSignIns))
+
+
+
(stats.active_sessions)
+
(t(lang, Key::StatActiveSessions))
+
+
+
(stats.connected_apps)
+
(t(lang, Key::StatConnectedApps))
+
+
+
+ }
diff --git a/style/main.scss b/style/main.scss index f9a7b6d..a78faf1 100644 --- a/style/main.scss +++ b/style/main.scss @@ -250,6 +250,7 @@ body:has(.auth-stage) { gap: 10px; text-decoration: none; color: inherit; + padding: 6px 0; &:hover { color: inherit; } @@ -271,6 +272,13 @@ body:has(.auth-stage) { } } +// The landing's section tabs wear the admin nav's skin, centred under the +// wordmark instead of left-aligned in the admin bar. +.landing-nav { + justify-content: center; + padding: 4px 0 10px; +} + .auth-card { background: var(--surface); border: 1px solid var(--border); @@ -365,6 +373,14 @@ body:has(.auth-stage) { } } +// The message body is the one multi-line field: same skin, height from +// `rows`, vertical resize only. +textarea.auth-input { + height: auto; + padding: 10px 12px; + resize: vertical; +} + .auth-input-mono { font-family: var(--font-mono); }