@use validator::ValidationErrors; @use plume_models::blogs::Blog; @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!(ctx.1, title (text), "Title", form, errors.clone(), "minlenght=\"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)

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

@i18n!(ctx.1, "Be very careful, any action taken here can't be reversed.")

})