2018-12-06 18:54:16 +01:00
|
|
|
@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::*;
|
2018-12-06 18:54:16 +01:00
|
|
|
|
|
|
|
@(ctx: BaseContext, message: Option<String>, form: &LoginForm, errors: ValidationErrors)
|
|
|
|
|
2019-04-02 15:08:07 +02:00
|
|
|
@:base(ctx, i18n!(ctx.1, "Log in"), {}, {}, {
|
|
|
|
<h1>@i18n!(ctx.1, "Log in")</h1>
|
2018-12-06 18:54:16 +01:00
|
|
|
@if let Some(message) = message {
|
|
|
|
<p>@message</p>
|
|
|
|
}
|
2018-12-07 12:05:01 +01:00
|
|
|
<form method="post" action="@uri!(session::create)">
|
2019-08-27 16:50:24 +02:00
|
|
|
@(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))
|
2019-04-02 15:08:07 +02:00
|
|
|
<input type="submit" value="@i18n!(ctx.1, "Log in")" />
|
2018-12-06 18:54:16 +01:00
|
|
|
</form>
|
2019-02-27 13:29:26 +01:00
|
|
|
<a href="@uri!(session::password_reset_request_form)">Forgot your password?</a>
|
2018-12-06 18:54:16 +01:00
|
|
|
})
|