@use validator::ValidationErrors; @use plume_models::blogs::Blog; @use plume_models::instance::Instance; @use plume_models::medias::Media; @use routes::blogs; @use routes::blogs::EditForm; @use routes::medias; @use template_utils::*; @use templates::base; @use templates::partials::image_select; @(ctx: BaseContext, blog: &Blog, medias: Vec, form: &EditForm, errors: ValidationErrors) @:base(ctx, i18n!(ctx.1, "Edit \"{}\""; &blog.title), {}, { @blog.title }, {

@i18n!(ctx.1, "Edit \"{}\""; &blog.title)

@(Input::new("title", i18n!(ctx.1, "Title")) .default(&form.title) .error(&errors) .set_prop("minlenght", 1) .html(ctx.1))

@i18n!(ctx.1, "You can upload images to your gallery, to use them as blog icons, or banners.") @i18n!(ctx.1, "Upload images")

@:image_select(ctx, "icon", i18n!(ctx.1, "Blog icon"), true, medias.clone(), form.icon) @:image_select(ctx, "banner", i18n!(ctx.1, "Blog banner"), true, medias, form.banner) @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 reversed.")

})