Plume/templates/session/login.rs.html

30 lines
1.0 KiB
HTML
Raw Normal View History

@use validator::ValidationErrors;
2020-01-21 07:02:03 +01:00
@use crate::template_utils::*;
@use crate::templates::base;
@use crate::routes::session::LoginForm;
@use crate::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>
})