aboutsummaryrefslogtreecommitdiff
path: root/src/pages/sign_ups/new_page.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/sign_ups/new_page.cr')
-rw-r--r--src/pages/sign_ups/new_page.cr22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/pages/sign_ups/new_page.cr b/src/pages/sign_ups/new_page.cr
new file mode 100644
index 0000000..24f6cb2
--- /dev/null
+++ b/src/pages/sign_ups/new_page.cr
@@ -0,0 +1,22 @@
+class SignUps::NewPage < AuthLayout
+ needs operation : SignUpUser
+
+ def content
+ h1 "Sign Up"
+ render_sign_up_form(@operation)
+ end
+
+ private def render_sign_up_form(op)
+ form_for SignUps::Create do
+ sign_up_fields(op)
+ submit "Sign Up", flow_id: "sign-up-button"
+ end
+ link "Sign in instead", to: SignIns::New
+ end
+
+ private def sign_up_fields(op)
+ mount Shared::Field, attribute: op.email, label_text: "Email", &.email_input(autofocus: "true")
+ mount Shared::Field, attribute: op.password, label_text: "Password", &.password_input
+ mount Shared::Field, attribute: op.password_confirmation, label_text: "Confirm Password", &.password_input
+ end
+end