From 639b8bfe27ed294e72daf89290cba9bcf7ad3835 Mon Sep 17 00:00:00 2001 From: 5andu Date: Fri, 22 Dec 2023 02:15:58 +0100 Subject: [PATCH] devise pages design improvements --- app/views/devise/passwords/edit.html.erb | 18 ++++++++++-------- app/views/devise/passwords/new.html.erb | 4 ++-- app/views/devise/registrations/new.html.erb | 14 ++++++++++---- app/views/devise/sessions/new.html.erb | 18 ++++++++++++------ .../devise/shared/_devise_sub_heading.html.erb | 5 +++++ 5 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 app/views/devise/shared/_devise_sub_heading.html.erb diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index 023b0576..a61fa37e 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -1,30 +1,32 @@ -<%= render 'devise/shared/devise_heading', title: 'Change your password' %>
+ <%= render 'devise/shared/devise_heading', title: 'Change your password' %> + <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { class: "mt-8", method: :put }) do |f| %> <%= render "devise/shared/error_messages", resource: resource %> <%= f.hidden_field :reset_password_token %> -
+
<%= f.label :password, "New password" %>
<% if @minimum_password_length %> (<%= @minimum_password_length %> characters minimum)
<% end %> - <%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: "appearance-none rounded-b-md rounded-t-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:border-primary-300 focus:ring-primary-500 focus:z-10 sm:text-sm sm:leading-5" %> + <%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: "my-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-primary-500 focus:ring focus:ring-primary-500 focus:ring-opacity-50" %>
-
+
<%= f.label :password_confirmation, "Confirm new password" %>
- <%= f.password_field :password_confirmation, autocomplete: "new-password", class: "appearance-none rounded-b-md rounded-t-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:border-primary-300 focus:ring-primary-500 focus:z-10 sm:text-sm sm:leading-5" %> + <%= f.password_field :password_confirmation, autocomplete: "new-password", class: "my-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-primary-500 focus:ring focus:ring-primary-500 focus:ring-opacity-50" %>
- <%= f.submit "Change my password", class: "group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-primary-600 hover:bg-primary-700 focus:outline-none transition duration-150 ease-in-out cursor-pointer" %> + <%= f.submit "Change my password", class: "group relative w-full flex justify-center py-2.5 px-4 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-primary-600 hover:bg-primary-700 focus:outline-none cursor-pointer" %>
<% end %> -
- <%= render "devise/shared/links" %> +
+ <%= link_to "Log in", new_user_session_path, class: "text-sm leading-5 font-medium text-gray-600 hover:text-gray-500 focus:outline-none focus:underline transition ease-in-out duration-150" %> + <%= link_to "Sign up", new_user_registration_path, class: "text-sm leading-5 font-medium text-gray-600 hover:text-gray-500 focus:outline-none focus:underline transition ease-in-out duration-150" %>
diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index f09de441..24bdbf48 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -6,11 +6,11 @@ <%= render "devise/shared/error_messages", resource: resource %>
- +
-
<% end %> + +
+ Already have an account? + <%= link_to 'Log in', new_user_session_path, class: 'font-medium text-gray text-gray-500 hover:text-gray-600 focus:outline-none focus:underline transition ease-in-out duration-150' %> +
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 265f97c1..8b876eba 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,32 +1,33 @@
- <%= render 'devise/shared/devise_heading', title: 'Log In' %> + <%= render 'devise/shared/devise_heading', title: 'Log in to your account' %> + <%= render "devise/shared/devise_sub_heading", subtitle: "Welcome back! Please enter your details." %> <%= form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: "mt-8"}) do |f| %> <%= render "devise/shared/error_messages", resource: resource %>
- +
- +
- +
- <%= link_to 'Forgot password?', new_user_password_path, class: 'font-medium text-primary hover:text-primary-500 focus:outline-none focus:underline transition ease-in-out duration-150' %> + <%= link_to 'Forgot password?', new_user_password_path, class: 'font-medium hover:text-gray-500 focus:outline-none focus:underline transition ease-in-out duration-150' %>
-
<% end %> + +
+ Don't have an account? + <%= link_to 'Sign up', new_user_registration_path, class: 'font-medium text-gray-500 hover:text-gray-600 focus:outline-none focus:underline transition ease-in-out duration-150' %> +
diff --git a/app/views/devise/shared/_devise_sub_heading.html.erb b/app/views/devise/shared/_devise_sub_heading.html.erb new file mode 100644 index 00000000..652cc32d --- /dev/null +++ b/app/views/devise/shared/_devise_sub_heading.html.erb @@ -0,0 +1,5 @@ +
+

+ <%= subtitle %> +

+