@use plume_models::instance::Instance; @use validator::ValidationErrors; @use crate::templates::base; @use crate::template_utils::*; @use crate::routes::user::UpdateUserForm; @use crate::routes::*; @(ctx: BaseContext, form: UpdateUserForm, errors: ValidationErrors) @:base(ctx, i18n!(ctx.1, "Edit your account"), {}, {}, { @if let Some(u) = ctx.2.clone() {

@i18n!(ctx.1, "Your Profile")

@i18n!(ctx.1, "To change your avatar, upload it to your gallery and then select from there.") @i18n!(ctx.1, "Upload an avatar")

@(Input::new("display_name", i18n!(ctx.1, "Display name")) .default(&form.display_name) .error(&errors) .html(ctx.1)) @(Input::new("email", i18n!(ctx.1, "Email")) .default(&form.email) .error(&errors) .input_type("email") .html(ctx.1)) @if let Ok(themes) = Instance::list_themes() { } else {

@i18n!(ctx.1, "Error while loading theme selector.")

}

@i18n!(ctx.1, "Danger zone")

@i18n!(ctx.1, "Be very careful, any action taken here can't be cancelled.") @if !u.is_admin() {

} else {

@i18n!(ctx.1, "Sorry, but as an admin, you can't leave your own instance.")

} } })