diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 0190f239..9626457b 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,16 +1,16 @@ <% content_for :heading, "Create your account" %> <% if @person.errors.any? %> -
- -
+
+ +
<% end %> <% if Feature.google_authentication? %> -<%= button_to "Sign Up with Google", "/auth/google", + <%= button_to "Sign Up with Google", "/auth/google", method: "post", class: %| text-white font-medium @@ -25,9 +25,9 @@ turbo: false, } %> - - - Or - - + + - Or - + <% end %> <% if Feature.microsoft_graph_authentication? %> @@ -52,7 +52,7 @@ <% end %> <% if Feature.password_authentication? %> -<%= form_with method: :post, + <%= form_with method: :post, model: @person, url: users_path, class: "flex flex-col space-y-4 w-80", @@ -61,48 +61,50 @@ transition_toggle_class: "max-h-0 max-h-40" } do |f| %> -<%= f.hidden_field :personable_type, id: "personable_type", value: "User" %> + <%= f.hidden_field :personable_type, id: "personable_type", value: "User" %> -<%= f.label :email, class: "input input-bordered flex items-center justify-between" do %> -Email * -<%= f.email_field :email, + <%= f.label :email, class: "input input-bordered flex items-center justify-between" do %> + Email * + <%= f.email_field :email, autofocus: true, placeholder: "Email", class: "w-44 border-0 dark:text-black" %> -<% end %> + <% end %> -<%= f.fields_for :personable_attributes, @person.personable do |user_fields| %> -<%= user_fields.fields_for :credentials_attributes, @person.personable.credentials.build, index: "0" do |credential_fields| %> -<%= credential_fields.hidden_field :type, value: "PasswordCredential" %> -<%= credential_fields.label :password, class: "input input-bordered flex items-center justify-between" do %> -Password * -<%= credential_fields.password_field :password, + <%= f.fields_for :personable_attributes, @person.personable do |user_fields| %> + <%= user_fields.fields_for :credentials_attributes, @person.personable.credentials.build, index: "0" do |credential_fields| %> + <%= credential_fields.hidden_field :type, value: "PasswordCredential" %> + <%= credential_fields.label :password, class: "input input-bordered flex items-center justify-between" do %> + Password * + <%= credential_fields.password_field :password, placeholder: "Password", class: "w-44 border-0 dark:text-black", data: { action: "focus->transition#toggleClassOn" } %> -<% end %> -<% end %> + <% end %> + <% end %> -
flex flex-col transition-all duration-100 ease-in space-y-4 - " data-transition-target="transitionable"> + " + data-transition-target="transitionable" + > - <%= user_fields.label :name, class: "input input-bordered flex items-center justify-between" do %> - Full Name * - <%= user_fields.text_field :name, + <%= user_fields.label :name, class: "input input-bordered flex items-center justify-between" do %> + Full Name * + <%= user_fields.text_field :name, placeholder: "First & Last name", class: "w-44 border-0 dark:text-black" %> - <% end %> -
-<% end %> -<%= f.submit "Sign Up", + <% end %> + + <% end %> + <%= f.submit "Sign Up", class: %| text-white font-medium bg-brand-blue dark:bg-gray-900 @@ -113,7 +115,7 @@ |, data: { turbo_submits_with: "Creating..." } %> -<% end # password_authentication? %> + <% end # password_authentication? %> <% end %>