hyaenidae/accounts/templates/register.rs.html

24 lines
1,017 B
HTML

@use crate::RegisterState;
@use super::inputs::{text_input, password_input};
@use hyaenidae_toolkit::{templates::{button_group, card, card_body, card_title, link}, Button, Card, Link};
@(card_config: &Card, state: &RegisterState)
@:card(card_config, {
<form method="POST" action="@state.register_path()">
@:card_title({ Register })
@:card_body({
@:text_input("username", "Username", state.username(), state.username_error(), state.dark)
@:password_input("password", "Password", state.password(), None, state.dark)
@:password_input("password_confirmation", "Password Confirmation", state.confirmation(), state.confirmation_error(), state.dark)
@:link(&Link::current_tab(&state.login_path()), { I already have an account })
})
@:card_body({
@:button_group(&[
Button::primary("Register"),
Button::primary_outline("Cancel").href(&state.home_path()),
])
})
</form>
})