From 6f6598af759ad99ed6438fe6bf2a623ed6d25a3a Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Sun, 16 Aug 2020 01:02:35 -0400 Subject: [PATCH 1/2] refactor: Redesigns password reset pages --- app/assets/stylesheets/forms/_forms.sass | 2 +- app/views/devise/passwords/_form.html.haml | 21 ++++++++++++--------- app/views/devise/passwords/edit.html.haml | 10 ++++++---- app/views/devise/passwords/new.html.haml | 4 ++-- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/app/assets/stylesheets/forms/_forms.sass b/app/assets/stylesheets/forms/_forms.sass index 2c9f272e0..547db9e6e 100644 --- a/app/assets/stylesheets/forms/_forms.sass +++ b/app/assets/stylesheets/forms/_forms.sass @@ -56,7 +56,7 @@ hr padding-right: 5px // custom styles -.form-container.login, .form-container.signup +.form-container.login, .form-container.signup, .form-container.password max-width: 360px .btn margin-bottom: 30px diff --git a/app/views/devise/passwords/_form.html.haml b/app/views/devise/passwords/_form.html.haml index 346f0177c..0e71d5a12 100644 --- a/app/views/devise/passwords/_form.html.haml +++ b/app/views/devise/passwords/_form.html.haml @@ -1,9 +1,12 @@ -.form-container - = simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| - = f.error_notification - .form-inputs - = f.input :email, required: true, autofocus: true - .center - .form-actions - = f.button :submit, "Send Reset Instructions" - = render "devise/shared/links" += simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| + = f.error_notification + .form-inputs + = f.input :email, required: true, autofocus: true + .form-actions.right + = f.button :submit, "Send Reset Instructions" + %p.session-link + Remembered it? + = link_to "Sign in!".html_safe, new_user_session_path + %p.session-link + No account? + = link_to "Register!".html_safe, new_user_registration_path diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 0a06e95ae..7db0e4b0b 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,6 +1,6 @@ - title 'Change Password' -.form-container - .section-title +.form-container.password + .section-title.center Change Your %span.emphasized Password = simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| @@ -10,6 +10,8 @@ .form-inputs = f.input :password, label: "New Password", required: true, autofocus: true = f.input :password_confirmation, label: "Confirm", required: true - .form-actions + .form-actions.right = f.button :submit, "Change My Password" - = render "devise/shared/links" + %p.session-link + Remembered it? + = link_to "Sign in!".html_safe, new_user_session_path \ No newline at end of file diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 50f8d147b..18281428a 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,6 +1,6 @@ - title 'Password Reset' -.form-container - %h1.section-title +.form-container.password + %h1.section-title.center Reset Your %span.emphasized Password From 3516fdaea877d895adf43e445f6a67631c74dfd6 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Sun, 16 Aug 2020 01:08:56 -0400 Subject: [PATCH 2/2] fix: Hound newline issue --- app/views/devise/passwords/edit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 7db0e4b0b..76f92f72b 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -14,4 +14,4 @@ = f.button :submit, "Change My Password" %p.session-link Remembered it? - = link_to "Sign in!".html_safe, new_user_session_path \ No newline at end of file + = link_to "Sign in!".html_safe, new_user_session_path