Remove unnecessary HTML from forms
This commit is contained in:
parent
45d3500453
commit
f6edb386e8
|
@ -1,12 +1,8 @@
|
|||
<%= simple_form_for contact, url: settings_contacts_path do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.association :contact_network, collection: ContactNetwork.all %>
|
||||
<%= f.input :value %>
|
||||
</div>
|
||||
<%= f.association :contact_network, collection: ContactNetwork.all %>
|
||||
<%= f.input :value %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate(:create) %>
|
||||
</div>
|
||||
<%= f.button :submit, translate(:create) %>
|
||||
<% end %>
|
||||
|
|
|
@ -8,19 +8,16 @@
|
|||
<%= simple_form_for @account, url: settings_profile_path do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :nickname, required: true %>
|
||||
<%= f.input :public_name %>
|
||||
<%= f.input :biography %>
|
||||
<%= f.input :avatar, direct_upload: true %>
|
||||
<% if f.object.avatar.attached? %>
|
||||
<%= image_tag f.object.avatar, class: 'img-thumbnail mb-4' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.input :nickname, required: true %>
|
||||
<%= f.input :public_name %>
|
||||
<%= f.input :biography %>
|
||||
<%= f.input :avatar, direct_upload: true %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate('users.registrations.edit.update') %>
|
||||
</div>
|
||||
<% if f.object.avatar.attached? %>
|
||||
<%= image_tag f.object.avatar, class: 'img-thumbnail mb-4' %>
|
||||
<% end %>
|
||||
|
||||
<%= f.button :submit, translate('users.registrations.edit.update') %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -8,18 +8,14 @@
|
|||
<%= simple_form_for [:staff, @person] do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :last_name %>
|
||||
<%= f.input :first_name %>
|
||||
<%= f.input :middle_name %>
|
||||
<%= f.input :sex, collection: Person.sexes.keys.map(&:to_sym) %>
|
||||
<%= f.input :date_of_birth %>
|
||||
<%= f.input :place_of_birth %>
|
||||
<%= f.input :photo, direct_upload: true %>
|
||||
</div>
|
||||
<%= f.input :last_name %>
|
||||
<%= f.input :first_name %>
|
||||
<%= f.input :middle_name %>
|
||||
<%= f.input :sex, collection: Person.sexes.keys.map(&:to_sym) %>
|
||||
<%= f.input :date_of_birth %>
|
||||
<%= f.input :place_of_birth %>
|
||||
<%= f.input :photo, direct_upload: true %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<%= f.button :submit %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -56,14 +56,10 @@
|
|||
<%= simple_form_for [:staff, @person, @person_comment] do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :text %>
|
||||
<%= f.input :attachment, direct_upload: true %>
|
||||
</div>
|
||||
<%= f.input :text %>
|
||||
<%= f.input :attachment, direct_upload: true %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<%= f.button :submit %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,17 +5,13 @@
|
|||
<%= f.error_notification %>
|
||||
<%= f.full_error :confirmation_token %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :email,
|
||||
required: true,
|
||||
autofocus: true,
|
||||
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email),
|
||||
input_html: { autocomplete: 'email' } %>
|
||||
</div>
|
||||
<%= f.input :email,
|
||||
required: true,
|
||||
autofocus: true,
|
||||
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email),
|
||||
input_html: { autocomplete: 'email' } %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate('.resend_confirmation_instructions') %>
|
||||
</div>
|
||||
<%= f.button :submit, translate('.resend_confirmation_instructions') %>
|
||||
<% end %>
|
||||
|
||||
<%= render 'users/shared/links' %>
|
||||
|
|
|
@ -10,22 +10,18 @@
|
|||
<%= f.input :reset_password_token, as: :hidden %>
|
||||
<%= f.full_error :reset_password_token %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :password,
|
||||
label: translate('.new_password'),
|
||||
required: true,
|
||||
autofocus: true,
|
||||
hint: (translate('devise.shared.minimum_password_length', count: @minimum_password_length) if @minimum_password_length),
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
<%= f.input :password,
|
||||
label: translate('.new_password'),
|
||||
required: true,
|
||||
autofocus: true,
|
||||
hint: (translate('devise.shared.minimum_password_length', count: @minimum_password_length) if @minimum_password_length),
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
|
||||
<%= f.input :password_confirmation,
|
||||
label: translate('.confirm_new_password'),
|
||||
required: true %>
|
||||
</div>
|
||||
<%= f.input :password_confirmation,
|
||||
label: translate('.confirm_new_password'),
|
||||
required: true %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate('.change_my_password') %>
|
||||
</div>
|
||||
<%= f.button :submit, translate('.change_my_password') %>
|
||||
<% end %>
|
||||
|
||||
<%= render 'users/shared/links' %>
|
||||
|
|
|
@ -4,16 +4,12 @@
|
|||
<%= simple_form_for resource, as: resource_name, url: password_path(resource_name) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :email,
|
||||
required: true,
|
||||
autofocus: true,
|
||||
input_html: { autocomplete: 'email' } %>
|
||||
</div>
|
||||
<%= f.input :email,
|
||||
required: true,
|
||||
autofocus: true,
|
||||
input_html: { autocomplete: 'email' } %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate('.send_me_reset_password_instructions') %>
|
||||
</div>
|
||||
<%= f.button :submit, translate('.send_me_reset_password_instructions') %>
|
||||
<% end %>
|
||||
|
||||
<%= render 'users/shared/links' %>
|
||||
|
|
|
@ -8,31 +8,27 @@
|
|||
<%= simple_form_for resource, as: resource_name, url: registration_path(resource_name), html: { method: :put } do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :email, required: true, autofocus: true %>
|
||||
<%= f.input :email, required: true, autofocus: true %>
|
||||
|
||||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
||||
<p><%= translate '.currently_waiting_confirmation_for_email', email: resource.unconfirmed_email %></p>
|
||||
<% end %>
|
||||
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
||||
<p><%= translate '.currently_waiting_confirmation_for_email', email: resource.unconfirmed_email %></p>
|
||||
<% end %>
|
||||
|
||||
<%= f.input :password,
|
||||
hint: translate('.leave_blank_if_you_don_t_want_to_change_it'),
|
||||
required: false,
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
<%= f.input :password,
|
||||
hint: translate('.leave_blank_if_you_don_t_want_to_change_it'),
|
||||
required: false,
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
|
||||
<%= f.input :password_confirmation,
|
||||
required: false,
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
<%= f.input :password_confirmation,
|
||||
required: false,
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
|
||||
<%= f.input :current_password,
|
||||
hint: translate('.we_need_your_current_password_to_confirm_your_changes'),
|
||||
required: true,
|
||||
input_html: { autocomplete: 'current-password' } %>
|
||||
</div>
|
||||
<%= f.input :current_password,
|
||||
hint: translate('.we_need_your_current_password_to_confirm_your_changes'),
|
||||
required: true,
|
||||
input_html: { autocomplete: 'current-password' } %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate('.update') %>
|
||||
</div>
|
||||
<%= f.button :submit, translate('.update') %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,27 +4,23 @@
|
|||
<%= simple_form_for resource, as: resource_name, url: registration_path(resource_name) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :email,
|
||||
required: true,
|
||||
autofocus: true ,
|
||||
input_html: { autocomplete: 'email' }%>
|
||||
<%= f.input :password,
|
||||
required: true,
|
||||
hint: (translate('devise.shared.minimum_password_length', count: @minimum_password_length) if @minimum_password_length),
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
<%= f.input :password_confirmation,
|
||||
required: true,
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
<%= f.input :email,
|
||||
required: true,
|
||||
autofocus: true ,
|
||||
input_html: { autocomplete: 'email' }%>
|
||||
<%= f.input :password,
|
||||
required: true,
|
||||
hint: (translate('devise.shared.minimum_password_length', count: @minimum_password_length) if @minimum_password_length),
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
<%= f.input :password_confirmation,
|
||||
required: true,
|
||||
input_html: { autocomplete: 'new-password' } %>
|
||||
|
||||
<div class="mb-3">
|
||||
<%= recaptcha_tags %>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<%= recaptcha_tags %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate('.sign_up') %>
|
||||
</div>
|
||||
<%= f.button :submit, translate('.sign_up') %>
|
||||
<% end %>
|
||||
|
||||
<%= render 'users/shared/links' %>
|
||||
|
|
|
@ -2,26 +2,22 @@
|
|||
<h1><%= translate '.sign_in' %></h1>
|
||||
|
||||
<%= simple_form_for resource, as: resource_name, url: session_path(resource_name) do |f| %>
|
||||
<div class="form-inputs">
|
||||
<%= f.input :email,
|
||||
required: false,
|
||||
autofocus: true,
|
||||
input_html: { autocomplete: 'email' } %>
|
||||
<%= f.input :email,
|
||||
required: false,
|
||||
autofocus: true,
|
||||
input_html: { autocomplete: 'email' } %>
|
||||
|
||||
<%= f.input :password,
|
||||
required: false,
|
||||
input_html: { autocomplete: 'current-password' } %>
|
||||
<%= f.input :password,
|
||||
required: false,
|
||||
input_html: { autocomplete: 'current-password' } %>
|
||||
|
||||
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
|
||||
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
|
||||
|
||||
<div class="mb-3">
|
||||
<%= recaptcha_tags %>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<%= recaptcha_tags %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate('.sign_in') %>
|
||||
</div>
|
||||
<%= f.button :submit, translate('.sign_in') %>
|
||||
<% end %>
|
||||
|
||||
<%= render 'users/shared/links' %>
|
||||
|
|
|
@ -5,16 +5,12 @@
|
|||
<%= f.error_notification %>
|
||||
<%= f.full_error :unlock_token %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :email,
|
||||
required: true,
|
||||
autofocus: true,
|
||||
input_html: { autocomplete: 'email' } %>
|
||||
</div>
|
||||
<%= f.input :email,
|
||||
required: true,
|
||||
autofocus: true,
|
||||
input_html: { autocomplete: 'email' } %>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit, translate('.resend_unlock_instructions') %>
|
||||
</div>
|
||||
<%= f.button :submit, translate('.resend_unlock_instructions') %>
|
||||
<% end %>
|
||||
|
||||
<%= render 'users/shared/links' %>
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
<%# frozen_string_literal: true %>
|
||||
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
|
||||
|
||||
<%%= simple_form_for @<%= singular_table_name %> do |f| %>
|
||||
<%%= f.error_notification %>
|
||||
<%%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%- attributes.each do |attribute| -%>
|
||||
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
||||
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
||||
<%- end -%>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%%= f.button :submit %>
|
||||
</div>
|
||||
<%%= f.button :submit %>
|
||||
<%% end %>
|
||||
|
|
Reference in New Issue