saasitone/templ/pages/forgot-password.templ

37 lines
1.2 KiB
Plaintext

package pages
import (
"git.grosinger.net/tgrosinger/saasitone/templ/components"
"git.grosinger.net/tgrosinger/saasitone/pkg/form"
"git.grosinger.net/tgrosinger/saasitone/pkg/page"
)
type ForgotPasswordForm struct {
Email string `form:"email" validate:"required,email"`
form.Submission
}
templ ForgotPassword(p page.Page, f *ForgotPasswordForm) {
<form method="post" hx-boost="true" action={ templ.URL(p.ToURL("forgot_password.submit")) }>
<div class="content">
<p>Enter your email address and we'll email you a link that allows you to reset your password.</p>
</div>
<div class="field">
<label for="email" class="label">Email address</label>
<div class="control">
<input id="email" type="email" name="email" class={ "input", f.Submission.GetFieldStatusClass("Email") } value={ f.Email }/>
@components.FieldErrors(f.Submission.GetFieldErrors("Email"))
</div>
</div>
<div class="field is-grouped">
<p class="control">
<button class="button is-primary">Reset password</button>
</p>
<p class="control">
<a href={ templ.URL(p.ToURL("home")) } class="button is-light">Cancel</a>
</p>
</div>
@components.CSRF(p.CSRF)
</form>
}