diff --git a/app/views/authentications/new.html.erb b/app/views/authentications/new.html.erb index 11186e01..478d567d 100644 --- a/app/views/authentications/new.html.erb +++ b/app/views/authentications/new.html.erb @@ -1,12 +1,5 @@ -<% content_for :heading, "Welcome back" %> -<% if Feature.registration? %> - - Don't have an account? <%= link_to "Sign up", register_path, class: "underline" %> - -<% end %> - <% if Feature.google_authentication? %> -<%= button_to "Log In with Google", "/auth/google", + <%= button_to "Log In with Google", "/auth/google", method: "post", class: %| text-white font-medium @@ -21,9 +14,9 @@ turbo: false, } %> - - - Or - - + + - Or - + <% end %> <% if Feature.microsoft_graph_authentication? %> @@ -46,23 +39,29 @@ - Or - <% end %> +<% content_for :heading, "Welcome back" %> +<% if Feature.registration? %> + + Don't have an account? <%= link_to "Sign up", register_path, class: "underline" %> + +<% end %> <% if Feature.password_authentication? %> -<%= form_with(url: login_path, method: :post, class: "flex flex-col space-y-4 w-80") do |f| %> -<%= f.email_field :email, + <%= form_with(url: login_path, method: :post, class: "flex flex-col space-y-4 w-80") do |f| %> + <%= f.email_field :email, value: params[:email], id: "email", autofocus: params[:email].present? ? false : true, placeholder: "Email address", class: "border border-gray-400 rounded p-3 dark:text-black" %> -<%= f.password_field :password, + <%= f.password_field :password, id: "password", autofocus: params[:email].present? ? true : false, placeholder: "Password", class: "border border-gray-400 rounded p-3 dark:text-black" %> -<%= f.submit "Log In", + <%= f.submit "Log In", class: %| text-white font-medium bg-brand-blue dark:bg-gray-900 @@ -73,10 +72,10 @@ |, data: { turbo_submits_with: "Authenticating..." } %> -<% end %> -<% if Feature.password_reset_email? %> - - <%= link_to "Forgot your password?", new_password_reset_path, class: "underline" %> - -<% end %> + <% end %> + <% if Feature.password_reset_email? %> + + <%= link_to "Forgot your password?", new_password_reset_path, class: "underline" %> + + <% end %> <% end %> 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 %>