From 9cf3cc978753b5a448cc61ec3c81acb842843d5d Mon Sep 17 00:00:00 2001 From: madhums Date: Tue, 5 Mar 2024 15:13:15 +0100 Subject: [PATCH] update user forms --- app/views/users/confirmations/new.html.erb | 6 ++--- app/views/users/invitations/edit.html.erb | 14 +++++------ app/views/users/invitations/new.html.erb | 6 ++--- app/views/users/passwords/edit.html.erb | 10 ++++---- app/views/users/passwords/new.html.erb | 6 ++--- app/views/users/registrations/edit.html.erb | 28 ++++++++++----------- app/views/users/registrations/new.html.erb | 18 ++++++------- app/views/users/sessions/new.html.erb | 14 +++++------ app/views/users/unlocks/new.html.erb | 6 ++--- 9 files changed, 54 insertions(+), 54 deletions(-) diff --git a/app/views/users/confirmations/new.html.erb b/app/views/users/confirmations/new.html.erb index b2747fa7..54ebda8f 100644 --- a/app/views/users/confirmations/new.html.erb +++ b/app/views/users/confirmations/new.html.erb @@ -6,12 +6,12 @@ <%= render "users/shared/error_messages", resource: resource %>
- <%= f.label :email, :class => "form-label" %> - <%= f.email_field :email, autofocus: true, :class => "form-control", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> + <%= f.label :email, class: "form-label" %> + <%= f.email_field :email, autofocus: true, class: "form-control", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
- <%= f.submit t('users.resend_confirmation'), :class => "btn btn-primary", data: { turbo: false } %> + <%= f.submit t('users.resend_confirmation'), class: "btn btn-primary", data: { turbo: false } %>
<% end %> diff --git a/app/views/users/invitations/edit.html.erb b/app/views/users/invitations/edit.html.erb index 615b1304..0aa740a7 100644 --- a/app/views/users/invitations/edit.html.erb +++ b/app/views/users/invitations/edit.html.erb @@ -7,23 +7,23 @@ <%= f.hidden_field :invitation_token, readonly: true %>
- <%= f.label :name, :class => "form-label" %> - <%= f.text_field :name, autofocus: true, :class => "form-control" %> + <%= f.label :name, class: "form-label" %> + <%= f.text_field :name, autofocus: true, class: "form-control", required: true %>
<% if f.object.class.require_password_on_accepting %>
- <%= f.label :password, :class => "form-label" %> - <%= f.password_field :password, :class => "form-control" %> + <%= f.label :password, class: "form-label" %> + <%= f.password_field :password, class: "form-control", required: true %>
- <%= f.label :password_confirmation, :class => "form-label" %> - <%= f.password_field :password_confirmation, :class => "form-control" %> + <%= f.label :password_confirmation, class: "form-label" %> + <%= f.password_field :password_confirmation, class: "form-control", required: true %>
<% end %>
- <%= f.submit t('devise.invitations.edit.submit_button'), :class => "btn btn-primary", data: { turbo: false } %> + <%= f.submit t('devise.invitations.edit.submit_button'), class: "btn btn-primary", data: { turbo: false } %>
<% end %> diff --git a/app/views/users/invitations/new.html.erb b/app/views/users/invitations/new.html.erb index 448e1cae..e7c3e1d1 100644 --- a/app/views/users/invitations/new.html.erb +++ b/app/views/users/invitations/new.html.erb @@ -7,12 +7,12 @@ <% resource.class.invite_key_fields.each do |field| -%>
- <%= f.label field, :class => "form-label" %> - <%= f.text_field field, :class => "form-control" %> + <%= f.label field, class: "form-label" %> + <%= f.email_field field, class: "form-control", required: true %>
<% end -%>
- <%= f.submit t('devise.invitations.new.submit_button'), :class => "btn btn-primary", data: { turbo: false } %> + <%= f.submit t('devise.invitations.new.submit_button'), class: "btn btn-primary", data: { turbo: false } %>
<% end %> diff --git a/app/views/users/passwords/edit.html.erb b/app/views/users/passwords/edit.html.erb index f1bad197..23bc2b63 100644 --- a/app/views/users/passwords/edit.html.erb +++ b/app/views/users/passwords/edit.html.erb @@ -7,20 +7,20 @@ <%= f.hidden_field :reset_password_token %>
- <%= f.label :password, t('users.new_password'), :class => "form-label" %> - <%= f.password_field :password, autofocus: true, :class => "form-control" %> + <%= f.label :password, t('users.new_password'), class: "form-label" %> + <%= f.password_field :password, autofocus: true, class: "form-control", required: true, minlength: @minimum_password_length %> <% if @minimum_password_length %>
(<%= t('users.minimum_password_characters', count: @minimum_password_length) %>)
<% end %>
- <%= f.label :password_confirmation, t('users.confirm_new_password'), :class => "form-label" %> - <%= f.password_field :password_confirmation, :class => "form-control" %> + <%= f.label :password_confirmation, t('users.confirm_new_password'), class: "form-label" %> + <%= f.password_field :password_confirmation, class: "form-control", required: true, minlength: @minimum_password_length %>
- <%= f.submit t('users.change_password'), :class => "btn btn-primary", data: { turbo: false } %> + <%= f.submit t('users.change_password'), class: "btn btn-primary", data: { turbo: false } %>
<% end %> diff --git a/app/views/users/passwords/new.html.erb b/app/views/users/passwords/new.html.erb index 4c383266..3d10a650 100644 --- a/app/views/users/passwords/new.html.erb +++ b/app/views/users/passwords/new.html.erb @@ -6,14 +6,14 @@ <%= render "users/shared/error_messages", resource: resource %>
- <%= f.label :email, :class => "form-label" %> - <%= f.email_field :email, autofocus: true, :class => "form-control" %> + <%= f.label :email, class: "form-label" %> + <%= f.email_field :email, autofocus: true, class: "form-control", required: true %>
<%= f.invisible_captcha :dummie_hpot_field %>
- <%= f.submit t('users.reset_password'), :class => "btn btn-primary", data: { turbo: false } %> + <%= f.submit t('users.reset_password'), class: "btn btn-primary", data: { turbo: false } %>
<% end %> diff --git a/app/views/users/registrations/edit.html.erb b/app/views/users/registrations/edit.html.erb index 0f04bda0..662d0500 100644 --- a/app/views/users/registrations/edit.html.erb +++ b/app/views/users/registrations/edit.html.erb @@ -6,18 +6,18 @@ <%= render "users/shared/error_messages", resource: resource %>
- <%= f.label :name, :class => "form-label" %> - <%= f.text_field :name, autofocus: true, :class => "form-control" %> + <%= f.label :name, class: "form-label" %> + <%= f.text_field :name, autofocus: true, class: "form-control", required: true %>
- <%= f.label :email, :class => "form-label" %> - <%= f.email_field :email, autofocus: true, :class => "form-control" %> + <%= f.label :email, class: "form-label" %> + <%= f.email_field :email, class: "form-control", required: true %>
- <%= f.label :language, :class => "form-label" %> - <%= f.select :language, I18n.available_locales.map{ |l| [t("locales.#{l}"), l] }, { include_blank: true }, :class => "form-control" %> + <%= f.label :language, class: "form-label" %> + <%= f.select :language, I18n.available_locales.map{ |l| [t("locales.#{l}"), l] }, { include_blank: true }, class: "form-control" %>
<% if resource.pending_reconfirmation? %> @@ -25,28 +25,28 @@ <% end %>
- <%= f.label :password, :class => "form-label" %> (leave blank if you don't want to change it) - <%= f.password_field :password, :class => "form-control" %> + <%= f.label :password, class: "form-label" %> (leave blank if you don't want to change it) + <%= f.password_field :password, class: "form-control" %> <% if @minimum_password_length %>
(<%= t('users.minimum_password_characters', count: @minimum_password_length) %>)
<% end %>
- <%= f.label :password_confirmation, :class => "form-label" %> - <%= f.password_field :password_confirmation, :class => "form-control" %> + <%= f.label :password_confirmation, class: "form-label" %> + <%= f.password_field :password_confirmation, class: "form-control" %>
- <%= f.label :current_password, t('users.current_password'), :class => "form-label" %> - <%= f.password_field :current_password, :class => "form-control" %> + <%= f.label :current_password, t('users.current_password'), class: "form-label" %> + <%= f.password_field :current_password, class: "form-control" %>
(<%= t('users.confirm_current_password') %>)
- <%= f.submit t('form_actions.update'), :class => "btn btn-primary", data: { turbo: false } %> + <%= f.submit t('form_actions.update'), class: "btn btn-primary", data: { turbo: false } %>
<% end %> @@ -54,6 +54,6 @@

<%= t('users.cancel_account_notice') %>

- <%= link_to t('users.cancel_account'), registration_path(resource_name), :class => "btn btn-danger", data: { turbo_method: :delete, turbo_confirm: t('common.are_you_sure') } %> + <%= link_to t('users.cancel_account'), registration_path(resource_name), class: "btn btn-danger", data: { turbo_method: :delete, turbo_confirm: t('common.are_you_sure') } %>
<%= link_to "Back", :back %> diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb index 8ee767e0..78b54919 100644 --- a/app/views/users/registrations/new.html.erb +++ b/app/views/users/registrations/new.html.erb @@ -6,32 +6,32 @@ <%= render "users/shared/error_messages", resource: resource %>
- <%= f.label :name, :class => "form-label" %> - <%= f.text_field :name, autofocus: true, :class => "form-control" %> + <%= f.label :name, class: "form-label" %> + <%= f.text_field :name, autofocus: true, class: "form-control", required: true %>
- <%= f.label :email, :class => "form-label" %> - <%= f.email_field :email, autofocus: true, :class => "form-control" %> + <%= f.label :email, class: "form-label" %> + <%= f.email_field :email, class: "form-control", required: true %>
- <%= f.label :password, :class => "form-label" %> - <%= f.password_field :password, :class => "form-control" %> + <%= f.label :password, class: "form-label" %> + <%= f.password_field :password, class: "form-control", required: true, minlength: @minimum_password_length %> <% if @minimum_password_length %>
(<%= t('users.minimum_password_characters', count: @minimum_password_length) %>)
<% end %>
- <%= f.label :password_confirmation, :class => "form-label" %> - <%= f.password_field :password_confirmation, :class => "form-control" %> + <%= f.label :password_confirmation, class: "form-label" %> + <%= f.password_field :password_confirmation, class: "form-control", required: true, minlength: @minimum_password_length %>
<%= f.invisible_captcha :dummie_hpot_field %>
- <%= f.submit t('users.signup'), :class => "btn btn-primary", data: { turbo: "false" } %> + <%= f.submit t('users.signup'), class: "btn btn-primary", data: { turbo: "false" } %>
<% end %> diff --git a/app/views/users/sessions/new.html.erb b/app/views/users/sessions/new.html.erb index 6bc9d293..32b76629 100644 --- a/app/views/users/sessions/new.html.erb +++ b/app/views/users/sessions/new.html.erb @@ -4,24 +4,24 @@ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
- <%= f.label :email, :class => "form-label" %> - <%= f.email_field :email, autofocus: true, :class => "form-control" %> + <%= f.label :email, class: "form-label" %> + <%= f.email_field :email, autofocus: true, class: "form-control", required: true %>
- <%= f.label :password, :class => "form-label" %> - <%= f.password_field :password, :class => "form-control" %> + <%= f.label :password, class: "form-label" %> + <%= f.password_field :password, class: "form-control", required: true %>
- <%= f.check_box :remember_me, :class => "form-check-input" %> - <%= f.label :remember_me, t('users.remember_me'), :class => "form-check-label" %> + <%= f.check_box :remember_me, class: "form-check-input" %> + <%= f.label :remember_me, t('users.remember_me'), class: "form-check-label" %>
<%= f.invisible_captcha :dummie_hpot_field %>
- <%= f.submit t('users.login'), :class => "btn btn-primary", data: { turbo: false } %> + <%= f.submit t('users.login'), class: "btn btn-primary", data: { turbo: false } %>
<% end %> diff --git a/app/views/users/unlocks/new.html.erb b/app/views/users/unlocks/new.html.erb index e96edd41..03cec011 100644 --- a/app/views/users/unlocks/new.html.erb +++ b/app/views/users/unlocks/new.html.erb @@ -6,12 +6,12 @@ <%= render "users/shared/error_messages", resource: resource %>
- <%= f.label :email, :class => "form-label" %> - <%= f.email_field :email, autofocus: true, :class => "form-control" %> + <%= f.label :email, class: "form-label" %> + <%= f.email_field :email, autofocus: true, class: "form-control", required: true %>
- <%= f.submit t('users.unlock'), :class => "btn btn-primary", data: { turbo: false } %> + <%= f.submit t('users.unlock'), class: "btn btn-primary", data: { turbo: false } %>
<% end %>