Plume/templates/session/login.rs.html

30 lines
1,023 B
HTML
Raw Normal View History

@use template_utils::*;
@use templates::base;
@use validator::ValidationErrors;
@use routes::session::LoginForm;
@use routes::*;
@(ctx: BaseContext, message: Option<String>, form: &LoginForm, errors: ValidationErrors)
@:base(ctx, i18n!(ctx.1, "Log in"), {}, {}, {
<h1>@i18n!(ctx.1, "Log in")</h1>
@if let Some(message) = message {
<p>@message</p>
}
<form method="post" action="@uri!(session::create)">
@(Input::new("email_or_name", i18n!(ctx.1, "Username, or email"))
.default(&form.email_or_name)
.error(&errors)
.set_prop("minlenght", 1)
.html(ctx.1))
@(Input::new("password", i18n!(ctx.1, "Password"))
.default(&form.password)
.error(&errors)
.set_prop("minlenght", 8)
.input_type("password")
.html(ctx.1))
<input type="submit" value="@i18n!(ctx.1, "Log in")" />
</form>
<a href="@uri!(session::password_reset_request_form)">Forgot your password?</a>
})