2019-04-17 22:09:07 +02:00
|
|
|
@use validator::ValidationErrors;
|
2020-01-21 07:02:03 +01:00
|
|
|
@use crate::templates::base;
|
|
|
|
@use crate::template_utils::*;
|
|
|
|
@use crate::routes::session::LoginForm;
|
|
|
|
@use crate::routes::RemoteForm;
|
2019-04-17 22:09:07 +02:00
|
|
|
|
|
|
|
@(ctx: BaseContext, title: String, login_msg: String, remote_msg: String, header: Content, login_form: LoginForm, login_errs: ValidationErrors, remote_form: RemoteForm, remote_errs: ValidationErrors)
|
|
|
|
|
|
|
|
@:base(ctx, title, {}, {}, {
|
|
|
|
<div>
|
|
|
|
<header class="center">
|
|
|
|
@:header()
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="split">
|
|
|
|
<form method="post" action="/login">
|
|
|
|
<h2>@i18n!(ctx.1, "I'm from this instance")</h2>
|
|
|
|
<p>@login_msg</p>
|
2019-08-27 16:50:24 +02:00
|
|
|
@(Input::new("email_or_name", i18n!(ctx.1, "Username, or email"))
|
|
|
|
.default(&login_form.email_or_name)
|
|
|
|
.error(&login_errs)
|
|
|
|
.set_prop("minlenght", 1)
|
|
|
|
.html(ctx.1))
|
|
|
|
@(Input::new("password", i18n!(ctx.1, "Password"))
|
|
|
|
.default(login_form.password)
|
|
|
|
.error(&login_errs)
|
|
|
|
.set_prop("minlength", 1)
|
|
|
|
.html(ctx.1))
|
2019-04-17 22:09:07 +02:00
|
|
|
<input type="submit" value="@i18n!(ctx.1, "Log in")" />
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<form method="post">
|
|
|
|
<h2>@i18n!(ctx.1, "I'm from another instance")</h2>
|
|
|
|
<p>@remote_msg</p>
|
2019-08-27 16:50:24 +02:00
|
|
|
@(Input::new("remote", i18n!(ctx.1, "Username"))
|
|
|
|
.details("Example: user@plu.me")
|
|
|
|
.default(&remote_form.remote)
|
|
|
|
.error(&remote_errs)
|
|
|
|
.set_prop("minlenght", 1)
|
|
|
|
.html(ctx.1))
|
2019-04-17 22:09:07 +02:00
|
|
|
<input type="submit" value="@i18n!(ctx.1, "Continue to your instance")"/>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
})
|