Files
crawlnicle/src/partials/forgot_password_form.rs
Tyler Hallada 6c23b3aaa3 Cleanup the other auth forms
Somewhat kinda progressively enhanced, but at least I'm using page partials now... mostly.
2023-12-19 01:33:19 -05:00

34 lines
976 B
Rust

use maud::{html, Markup};
#[derive(Debug, Clone, Default)]
pub struct ForgotPasswordFormProps {
pub email: Option<String>,
pub email_error: Option<String>,
}
pub fn forgot_password_form(props: ForgotPasswordFormProps) -> Markup {
let ForgotPasswordFormProps { email, email_error } = props;
html! {
form
action="/forgot-password"
method="post"
hx-post="/forgot-password"
id="forgot-password-form"
class="auth-form-grid"
{
label for="email" { "Email" }
input
type="email"
name="email"
id="email"
placeholder="Email"
value=(email.unwrap_or_default())
required;
@if let Some(email_error) = email_error {
span class="error" { (email_error) }
}
button type="submit" { "Send password reset email" }
}
}
}