From cbdeece9e28591694fce47f56b21a8d8ae5b5a5f Mon Sep 17 00:00:00 2001 From: Matt Levy Date: Thu, 8 Aug 2024 11:37:48 -0700 Subject: [PATCH 1/5] Fix to usability on password changes from existing users --- .../registrations/_change_password.html.haml | 14 +++++++++++--- app/views/devise/shared/_register.html.haml | 11 ++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/views/devise/registrations/_change_password.html.haml b/app/views/devise/registrations/_change_password.html.haml index 482e1f2d..d5308cc4 100644 --- a/app/views/devise/registrations/_change_password.html.haml +++ b/app/views/devise/registrations/_change_password.html.haml @@ -2,7 +2,9 @@ .col-12 .vertical-20 - if existing - %small.nowrap NOTE: leave these fields blank if you don't want to change your password. + %strong= "Change Password" + %br + %small.fst-italic.nowrap Leave blank if you don't want to change your password. - else %h5 Please enter and confirm your new password. NOTE: Passwords must be at least 6 characters long. @@ -10,7 +12,10 @@ .row .col-5 = f.label :password do - %strong= "Password:" + - if existing + %strong= "New Password:" + - else + %strong= "Password:" - if @minimum_password_length %br %small.text-nowrap @@ -20,7 +25,10 @@ .col-7 = f.label :password_confirmation do - %strong= "Password Confirmation:" + - if existing + %strong= "New Password Confirmation:" + - else + %strong= "Password Confirmation:" - if @minimum_password_length %br %br diff --git a/app/views/devise/shared/_register.html.haml b/app/views/devise/shared/_register.html.haml index c34f7a79..38ad5e01 100644 --- a/app/views/devise/shared/_register.html.haml +++ b/app/views/devise/shared/_register.html.haml @@ -1,10 +1,11 @@ -%h2 Register New Account - http_method = existing ? :put : :post = form_for(resource, as: resource_name, url: user_registration_path, html: { method: http_method }, data: { turbo: false } ) do |f| = hidden_field_tag :authenticity_token, form_authenticity_token = render "devise/shared/error_messages", resource: resource + - unless existing + %h2 Register New Account .container-fluid .row @@ -24,18 +25,18 @@ - if defined?(redirect_to) = hidden_field_tag :redirect_to, redirect_to + %br + %hr = render partial: 'devise/registrations/change_password', locals: { existing: existing, f: f } %br %hr - if existing .row .col-md-6.col-sm-12 - %p.lead - We need your current password to confirm your changes + %strong= "Your current password is required in order to make any changes to your account" %strong = f.label :current_password - %br - = f.password_field :current_password, autocomplete: "current-password" + = f.password_field :current_password, autocomplete: "current-password", required: true .row From a96b818a3ad88f32e6ec095b51cf7e8ad8d236f3 Mon Sep 17 00:00:00 2001 From: Matt Levy Date: Thu, 8 Aug 2024 11:49:22 -0700 Subject: [PATCH 2/5] cleanup usability --- app/views/devise/passwords/edit.html.haml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index ee01a040..9eb9b2c0 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,21 +1,19 @@ -%h2 Change your password +%h3 Change your password = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }, data: { turbo: false } ) do |f| = render "devise/shared/error_messages", resource: resource = f.hidden_field :reset_password_token .field - %p= f.label :password, "New password" - - if @minimum_password_length - %p - %em - (#{@minimum_password_length} characters minimum) + %br + %strong= "New Password" + %small.fst-italic.text-nowrap + = " (#{@minimum_password_length} characters minimum)" %p= f.password_field :password, autofocus: true, autocomplete: "new-password" .field - %p= f.label :password_confirmation, "Confirm new password" - - if @minimum_password_length - %p - %em - (#{@minimum_password_length} characters minimum) - %p= f.password_field :password_confirmation, autocomplete: "new-password" + %br + %strong= "New Password Confirmation" + %small.fst-italic.text-nowrap + = " (#{@minimum_password_length} characters minimum)" + %p= f.password_field :password_confirmation, autocomplete: "new-password", required: true .actions = f.submit "Change my password", class: 'btn btn-primary btn-large' = render "devise/shared/links" From c3ddf03ad19f969b5745a41c58ff353b871eb919 Mon Sep 17 00:00:00 2001 From: Matt Levy Date: Thu, 8 Aug 2024 12:16:05 -0700 Subject: [PATCH 3/5] more cleanup --- .../devise/registrations/_change_password.html.haml | 11 +++++------ app/views/devise/shared/_register.html.haml | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/views/devise/registrations/_change_password.html.haml b/app/views/devise/registrations/_change_password.html.haml index d5308cc4..e62e89b3 100644 --- a/app/views/devise/registrations/_change_password.html.haml +++ b/app/views/devise/registrations/_change_password.html.haml @@ -7,7 +7,7 @@ %small.fst-italic.nowrap Leave blank if you don't want to change your password. - else %h5 Please enter and confirm your new password. - NOTE: Passwords must be at least 6 characters long. + %strong.fst-italic.text-nowrap Passwords must be at least 6 characters long. .row .col-5 @@ -18,10 +18,8 @@ %strong= "Password:" - if @minimum_password_length %br - %small.text-nowrap - NOTE: - = "#{@minimum_password_length} characters minimum" - = f.password_field :password, autocomplete: "new-password" + %normal.fst-italic.nowrap (#{@minimum_password_length} characters minimum) + = f.password_field :password, autocomplete: "new-password", min_length: @minimum_password_length .col-7 = f.label :password_confirmation do @@ -31,6 +29,7 @@ %strong= "Password Confirmation:" - if @minimum_password_length %br + %normal.fst-italic.nowrap (#{@minimum_password_length} characters minimum) %br - %p= f.password_field :password_confirmation, autocomplete: "new-password" + %p= f.password_field :password_confirmation, autocomplete: "new-password", min_length: @minimum_password_length diff --git a/app/views/devise/shared/_register.html.haml b/app/views/devise/shared/_register.html.haml index 38ad5e01..44c48640 100644 --- a/app/views/devise/shared/_register.html.haml +++ b/app/views/devise/shared/_register.html.haml @@ -33,7 +33,7 @@ - if existing .row .col-md-6.col-sm-12 - %strong= "Your current password is required in order to make any changes to your account" + %strong= "Your current password is required make changes to your account" %strong = f.label :current_password = f.password_field :current_password, autocomplete: "current-password", required: true @@ -45,12 +45,11 @@ = f.submit "Update", class: 'btn btn-primary btn-large w-1' - unless existing - .row .col-12 .actions.btn-group-md = f.submit "Register", class: 'btn btn-primary btn-lg' - - if controller_name != 'ticket_requests' - = link_to "Go Back ↩".html_safe, :back, class: 'btn btn-warning btn-md' - %p= link_to "Forgot your password?", new_password_path(resource_name) + + - if controller_name != 'ticket_requests' + = link_to "Go Back ↩".html_safe, :back, class: 'btn btn-warning btn-md' From 0a1199238cf280dbe90b24c1e57f87622d91f431 Mon Sep 17 00:00:00 2001 From: Matt Levy Date: Thu, 8 Aug 2024 14:11:39 -0700 Subject: [PATCH 4/5] text --- app/views/ticket_requests/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/ticket_requests/_form.html.haml b/app/views/ticket_requests/_form.html.haml index 44dd95f3..1bfb9622 100644 --- a/app/views/ticket_requests/_form.html.haml +++ b/app/views/ticket_requests/_form.html.haml @@ -7,7 +7,7 @@ - if signed_in? && @user.present? %h4 Ticket Request for #{@user.name} - else - %h5 Please sign-in or register to request tickets. + %h5 Please log-in or register to request tickets .card-body = render 'shared/form_errors', resource: @ticket_request From 99e28fc42ae2bfaf1173e6a860dd75cafe426cb9 Mon Sep 17 00:00:00 2001 From: Matt Levy Date: Thu, 8 Aug 2024 14:30:36 -0700 Subject: [PATCH 5/5] clean up text --- app/models/ticket_request_event_addon.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ticket_request_event_addon.rb b/app/models/ticket_request_event_addon.rb index 1fcaee00..f7ee5f72 100644 --- a/app/models/ticket_request_event_addon.rb +++ b/app/models/ticket_request_event_addon.rb @@ -52,6 +52,6 @@ def purchase_category(category) end def name_category_price_each - "#{name} #{purchase_category(category)} @ #{price} each" + "#{name} #{purchase_category(category)} @ $#{price} each" end end