Skip to content

Commit

Permalink
update user forms
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Mar 5, 2024
1 parent d55c504 commit 9cf3cc9
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 54 deletions.
6 changes: 3 additions & 3 deletions app/views/users/confirmations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<%= render "users/shared/error_messages", resource: resource %>

<div class="mb-3">
<%= 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) %>
</div>

<div class="actions">
<%= 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 } %>
</div>
<% end %>

Expand Down
14 changes: 7 additions & 7 deletions app/views/users/invitations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
<%= f.hidden_field :invitation_token, readonly: true %>

<div class="mb-3">
<%= 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 %>
</div>

<% if f.object.class.require_password_on_accepting %>
<div class="mb-3">
<%= 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 %>
</div>

<div class="mb-3">
<%= 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 %>
</div>
<% end %>

<div class="actions">
<%= 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 } %>
</div>
<% end %>
6 changes: 3 additions & 3 deletions app/views/users/invitations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<% resource.class.invite_key_fields.each do |field| -%>
<div class="mb-3">
<%= 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 %>
</div>
<% end -%>

<div class="actions">
<%= 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 } %>
</div>
<% end %>
10 changes: 5 additions & 5 deletions app/views/users/passwords/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
<%= f.hidden_field :reset_password_token %>

<div class="mb-3">
<%= 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 %>
<div class="form-text">(<%= t('users.minimum_password_characters', count: @minimum_password_length) %>)</div>
<% end %>
</div>

<div class="mb-3">
<%= 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 %>
</div>

<div class="actions">
<%= 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 } %>
</div>
<% end %>

Expand Down
6 changes: 3 additions & 3 deletions app/views/users/passwords/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<%= render "users/shared/error_messages", resource: resource %>

<div class="mb-3">
<%= 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 %>
</div>

<%= f.invisible_captcha :dummie_hpot_field %>

<div class="actions">
<%= 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 } %>
</div>
<% end %>

Expand Down
28 changes: 14 additions & 14 deletions app/views/users/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,54 @@
<%= render "users/shared/error_messages", resource: resource %>

<div class="mb-3">
<%= 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 %>
</div>

<div class="mb-3">
<%= 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 %>
</div>

<div class="mb-3">
<%= 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" %>
</div>

<% if resource.pending_reconfirmation? %>
<div><%= t('users.awaiting_confirmation', email: resource.unconfirmed_email) %></div>
<% end %>

<div class="mb-3">
<%= f.label :password, :class => "form-label" %> <i>(leave blank if you don't want to change it)</i>
<%= f.password_field :password, :class => "form-control" %>
<%= f.label :password, class: "form-label" %> <i>(leave blank if you don't want to change it)</i>
<%= f.password_field :password, class: "form-control" %>
<% if @minimum_password_length %>
<div class="form-text">(<%= t('users.minimum_password_characters', count: @minimum_password_length) %>)</div>
<% end %>
</div>

<div class="mb-3">
<%= 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" %>
</div>

<div class="mb-3">
<%= 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" %>
<div class="form-text">
<i>(<%= t('users.confirm_current_password') %>)</i>
</div>
</div>

<div class="actions">
<%= 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 } %>
</div>
<% end %>

<h3 class="mt-5"><%= t('users.cancel_account') %></h3>

<div class="mb-3">
<p><%= t('users.cancel_account_notice') %></p>
<%= 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') } %>
</div>
<%= link_to "Back", :back %>
18 changes: 9 additions & 9 deletions app/views/users/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
<%= render "users/shared/error_messages", resource: resource %>

<div class="mb-3">
<%= 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 %>
</div>

<div class="mb-3">
<%= 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 %>
</div>

<div class="mb-3">
<%= 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 %>
<div class="form-text">(<%= t('users.minimum_password_characters', count: @minimum_password_length) %>)</div>
<% end %>
</div>

<div class="mb-3">
<%= 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 %>
</div>

<%= f.invisible_captcha :dummie_hpot_field %>

<div class="actions">
<%= f.submit t('users.signup'), :class => "btn btn-primary", data: { turbo: "false" } %>
<%= f.submit t('users.signup'), class: "btn btn-primary", data: { turbo: "false" } %>
</div>
<% end %>

Expand Down
14 changes: 7 additions & 7 deletions app/views/users/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="mb-3">
<%= 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 %>
</div>

<div class="mb-3">
<%= 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 %>
</div>

<div class="mb-3 form-check">
<%= 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" %>
</div>

<%= f.invisible_captcha :dummie_hpot_field %>

<div class="actions">
<%= f.submit t('users.login'), :class => "btn btn-primary", data: { turbo: false } %>
<%= f.submit t('users.login'), class: "btn btn-primary", data: { turbo: false } %>
</div>
<% end %>

Expand Down
6 changes: 3 additions & 3 deletions app/views/users/unlocks/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<%= render "users/shared/error_messages", resource: resource %>

<div class="mb-3">
<%= 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 %>
</div>

<div class="actions">
<%= f.submit t('users.unlock'), :class => "btn btn-primary", data: { turbo: false } %>
<%= f.submit t('users.unlock'), class: "btn btn-primary", data: { turbo: false } %>
</div>
<% end %>

Expand Down

0 comments on commit 9cf3cc9

Please sign in to comment.