39 lines
1.4 KiB
Plaintext
39 lines
1.4 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 ResetPasswordForm struct {
|
||
|
Password string `form:"password" validate:"required"`
|
||
|
ConfirmPassword string `form:"password-confirm" validate:"required,eqfield=Password"`
|
||
|
form.Submission
|
||
|
}
|
||
|
|
||
|
templ ResetPassword(p page.Page, f *ResetPasswordForm) {
|
||
|
<form method="post" hx-boost="true" action={ templ.URL(p.Path) }>
|
||
|
<div class="field">
|
||
|
<label for="password" class="label">Password</label>
|
||
|
<div class="control">
|
||
|
<input type="password" id="password" name="password" placeholder="*******" class={ "input", f.Submission.GetFieldStatusClass("Password") }/>
|
||
|
@components.FieldErrors(f.Submission.GetFieldErrors("Password"))
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="field">
|
||
|
<label for="password-confirm" class="label">Confirm password</label>
|
||
|
<div class="control">
|
||
|
<input type="password" id="password-confirm" name="password-confirm" placeholder="*******" class={ "input", f.Submission.GetFieldStatusClass("ConfirmPassword") }/>
|
||
|
@components.FieldErrors(f.Submission.GetFieldErrors("ConfigmPassword"))
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="field is-grouped">
|
||
|
<p class="control">
|
||
|
<button class="button is-primary">Update password</button>
|
||
|
</p>
|
||
|
</div>
|
||
|
@components.CSRF(p.CSRF)
|
||
|
</form>
|
||
|
}
|