diff --git a/backend/templates/auth_signup.templ b/backend/templates/auth_signup.templ index 05e8aec..c53ed17 100644 --- a/backend/templates/auth_signup.templ +++ b/backend/templates/auth_signup.templ @@ -2,25 +2,26 @@ package templates import "backend/internal/web/ui" -// SignupPage renders the full /signup page wrapped in the base Layout. +// SignupPage renders the full /signup page wrapped in AuthLayout. // It delegates the form section to SignupFormFragment so HTMX can swap just the // form on validation errors without re-rendering the surrounding shell. templ SignupPage(form SignupForm, errs SignupErrors, csrfToken string, providers AuthProviderButtons) { - @Layout("Sign up", nil, csrfToken) { -
- @ui.Card(ui.CardProps{Body: signupCardBody(form, errs, csrfToken, providers)}) + @AuthLayout("Create your account", csrfToken) { +
+
+ +
+
+

Create your account

+
+
+ @GoogleButton(providers.Google.StartURL, providers.Google.Configured) + @AuthDivider() + @SignupFormFragment(form, errs, csrfToken)
} } -templ signupCardBody(form SignupForm, errs SignupErrors, csrfToken string, providers AuthProviderButtons) { -
-

Create your account

- @AuthProviderButtonsBlock(providers) - @SignupFormFragment(form, errs, csrfToken) -
-} - // SignupFormFragment is the bare form used for HTMX swaps. // hx-post targets this component itself so the form can be replaced inline // on validation failure (D-19, D-25). @@ -33,37 +34,37 @@ templ SignupFormFragment(form SignupForm, errs SignupErrors, csrfToken string) { hx-post="/signup" hx-target="#signup-form" hx-swap="outerHTML" - class="space-y-5" + class="login-form" > @ui.CSRFField(csrfToken) @GeneralError(errs.General) -
- - - @FieldError(errs.Email) -
-
- - - @FieldError(errs.Password) -
+ @ui.FormField(ui.FormFieldProps{ + Label: "Email address", + For: "email", + Field: ui.Input(ui.InputProps{ + ID: "email", + Name: "email", + Type: "email", + Placeholder: "you@example.com", + Value: form.Email, + Required: true, + Attrs: templ.Attributes{"autocomplete": "email"}, + }), + Error: errs.Email, + }) + @ui.FormField(ui.FormFieldProps{ + Label: "Password", + For: "password", + Field: ui.Input(ui.InputProps{ + ID: "password", + Name: "password", + Type: "password", + Placeholder: "12 characters minimum", + Required: true, + Attrs: templ.Attributes{"autocomplete": "new-password"}, + }), + Error: errs.Password, + }) @ui.Button(ui.ButtonProps{ Label: "Create account", Variant: ui.ButtonVariantDefault, @@ -71,5 +72,9 @@ templ SignupFormFragment(form SignupForm, errs SignupErrors, csrfToken string) { Size: ui.SizeMD, Type: "submit", }) +

+ Already have an account? + +

}