1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/*
This file is part of jellything (https://codeberg.org/metamuffin/jellything)
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
use jellyui_locale::tr;
use crate::RenderInfo;
markup::define! {
AccountSetPassword<'a>(ri: &'a RenderInfo<'a>, session: &'a str) {
form.account[method="POST", action=""] {
h1 { @tr(ri.lang, "account.set_password") }
input[type="text", name="session", hidden, value=session]; br;
label[for="inp-password"] { @tr(ri.lang, "account.password") }
input[type="password", id="inp-password", name="password"]; br;
input[type="submit", value=tr(ri.lang, "account.register.submit")];
}
}
AccountLogin<'a>(ri: &'a RenderInfo<'a>) {
form.account[method="POST", action=""] {
h1 { @tr(ri.lang, "account.login") }
label[for="inp-username"] { @tr(ri.lang, "account.username") }
input[type="text", id="inp-username", name="username"]; br;
label[for="inp-password"] { @tr(ri.lang, "account.password") }
input[type="password", id="inp-password", name="password"]; br;
input[type="submit", value=tr(ri.lang, if ri.user.is_some() { "account.login.submit.switch" } else { "account.login.submit" })];
}
}
AccountLogout<'a>(ri: &'a RenderInfo<'a>) {
form.account[method="POST", action=""] {
h1 { @tr(ri.lang, "account.logout") }
input[type="submit", value=tr(ri.lang, "account.logout.submit")];
}
}
}
|