26 lines
1.2 KiB
HTML
26 lines
1.2 KiB
HTML
@use crate::ActixLoader;
|
|
@use crate::templates::accounts::inputs::{text_input, password_input};
|
|
@use hyaenidae_accounts::RegisterState;
|
|
@use hyaenidae_toolkit::{templates::{button_group, card, card_body, card_title, link}, Button, Card, Link};
|
|
@use i18n_embed_fl::fl;
|
|
|
|
@(card_config: &Card, loader: &ActixLoader, state: &RegisterState, dark: bool)
|
|
|
|
@:card(card_config, {
|
|
<form method="POST" action="@state.register_path()">
|
|
@:card_title({ @fl!(loader, "register-heading") })
|
|
@:card_body({
|
|
@:text_input("username", &fl!(loader, "register-username"), state.username(), state.username_error(), dark)
|
|
@:password_input("password", &fl!(loader, "register-password"), state.password(), None, dark)
|
|
@:password_input("password_confirmation", &fl!(loader, "register-confirmation"), state.confirmation(), state.confirmation_error(), dark)
|
|
@:link(&Link::current_tab(&state.login_path()), { I already have an account })
|
|
})
|
|
@:card_body({
|
|
@:button_group(&[
|
|
Button::primary(&fl!(loader, "register-submit")),
|
|
Button::primary_outline(&fl!(loader, "register-cancel")).href(&state.home_path()),
|
|
])
|
|
})
|
|
</form>
|
|
})
|