From 3ea9f3cecf7c7f3547444fe85c1aa55ca82399fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 2 Oct 2019 23:27:48 +0200 Subject: [PATCH] Simplify generating form fields with labels Instead of generating the label and then a field without a label, we can directly generate a field with a label. --- app/helpers/documents_helper.rb | 21 +++++------ app/helpers/images_helper.rb | 22 +++++------- app/views/admin/banners/_form.html.erb | 9 ++--- .../admin/budget_investments/edit.html.erb | 3 +- app/views/admin/budget_phases/_form.html.erb | 6 ++-- .../admin/dashboard/actions/_form.html.erb | 12 +++---- .../legislation/draft_versions/_form.html.erb | 6 ++-- .../admin/local_census_records/_form.html.erb | 13 +++---- app/views/admin/newsletters/_form.html.erb | 3 +- app/views/admin/poll/shifts/_form.html.erb | 4 +-- .../_form_content_block.html.erb | 9 ++--- .../site_customization/pages/_form.html.erb | 4 +-- app/views/admin/tags/index.html.erb | 3 +- app/views/admin/valuator_groups/edit.html.erb | 3 +- app/views/admin/valuator_groups/new.html.erb | 3 +- app/views/budgets/investments/_form.html.erb | 3 +- app/views/comments/_form.html.erb | 8 +++-- .../devise/password_expired/show.html.erb | 5 +-- app/views/direct_messages/new.html.erb | 7 ++-- .../legislation/proposals/_form.html.erb | 16 +++++---- app/views/management/users/new.html.erb | 3 +- app/views/proposal_notifications/new.html.erb | 8 ++--- app/views/proposals/_form.html.erb | 4 +-- app/views/proposals/retire_form.html.erb | 5 +-- app/views/shared/_map.html.erb | 3 +- app/views/topics/_form.html.erb | 7 ++-- app/views/tracking/milestones/_form.html.erb | 3 +- app/views/users/registrations/edit.html.erb | 12 ++++--- .../budget_investments/_dossier_form.html.erb | 35 ++++++++++--------- app/views/verification/residence/new.html.erb | 7 ++-- app/views/verification/sms/edit.html.erb | 3 +- 31 files changed, 109 insertions(+), 141 deletions(-) diff --git a/app/helpers/documents_helper.rb b/app/helpers/documents_helper.rb index d8de03389..6403bd440 100644 --- a/app/helpers/documents_helper.rb +++ b/app/helpers/documents_helper.rb @@ -33,18 +33,15 @@ module DocumentsHelper def render_attachment(builder, document) klass = document.persisted? || document.cached_attachment.present? ? " hide" : "" - html = builder.label :attachment, - t("documents.form.attachment_label"), - class: "button hollow #{klass}" - html += builder.file_field :attachment, - label: false, - accept: accepted_content_types_extensions(document.documentable_type.constantize), - class: "js-document-attachment", - data: { - url: document_direct_upload_url(document), - nested_document: true - } - html + builder.file_field :attachment, + label: t("documents.form.attachment_label"), + label_options: { class: "button hollow #{klass}" }, + accept: accepted_content_types_extensions(document.documentable_type.constantize), + class: "js-document-attachment", + data: { + url: document_direct_upload_url(document), + nested_document: true + } end def document_direct_upload_url(document) diff --git a/app/helpers/images_helper.rb b/app/helpers/images_helper.rb index c865c6937..0fbe1dd2f 100644 --- a/app/helpers/images_helper.rb +++ b/app/helpers/images_helper.rb @@ -47,19 +47,15 @@ module ImagesHelper def render_image_attachment(builder, imageable, image) klass = image.persisted? || image.cached_attachment.present? ? " hide" : "" - html = builder.label :attachment, - t("images.form.attachment_label"), - class: "button hollow #{klass}" - html += builder.file_field :attachment, - label: false, - accept: imageable_accepted_content_types_extensions, - class: "js-image-attachment", - data: { - url: image_direct_upload_url(imageable), - nested_image: true - } - - html + builder.file_field :attachment, + label: t("images.form.attachment_label"), + label_options: { class: "button hollow #{klass}" }, + accept: imageable_accepted_content_types_extensions, + class: "js-image-attachment", + data: { + url: image_direct_upload_url(imageable), + nested_image: true + } end def render_image(image, version, show_caption = true) diff --git a/app/views/admin/banners/_form.html.erb b/app/views/admin/banners/_form.html.erb index 0195d8e52..5e7d6e56b 100644 --- a/app/views/admin/banners/_form.html.erb +++ b/app/views/admin/banners/_form.html.erb @@ -7,9 +7,8 @@
<% date_started_at = @banner.post_started_at.present? ? I18n.localize(@banner.post_started_at) : "" %>
- <%= f.label :post_started_at, t("admin.banners.banner.post_started_at") %> <%= f.text_field :post_started_at, - label: false, + label: t("admin.banners.banner.post_started_at"), placeholder: t("admin.banners.banner.post_started_at"), value: date_started_at, class: "js-calendar-full", @@ -17,9 +16,8 @@
<% date_ended_at = @banner.post_ended_at.present? ? I18n.localize(@banner.post_ended_at) : "" %>
- <%= f.label :post_ended_at, t("admin.banners.banner.post_ended_at") %> <%= f.text_field :post_ended_at, - label: false, + label: t("admin.banners.banner.post_ended_at"), placeholder: t("admin.banners.banner.post_ended_at"), value: date_ended_at, class: "js-calendar-full", @@ -47,9 +45,8 @@
- <%= f.label :target_url, t("admin.banners.banner.target_url") %> <%= f.text_field :target_url, - label: false, + label: t("admin.banners.banner.target_url"), placeholder: t("admin.banners.banner.target_url") %>
diff --git a/app/views/admin/budget_investments/edit.html.erb b/app/views/admin/budget_investments/edit.html.erb index 8051783c7..851b43789 100644 --- a/app/views/admin/budget_investments/edit.html.erb +++ b/app/views/admin/budget_investments/edit.html.erb @@ -29,10 +29,9 @@ <% end %>
- <%= f.label :tag_list, t("admin.budget_investments.edit.user_tags") %> <%= f.text_field :tag_list, value: @investment.tag_list.sort.join(","), - label: false %> + label: t("admin.budget_investments.edit.user_tags") %>
diff --git a/app/views/admin/budget_phases/_form.html.erb b/app/views/admin/budget_phases/_form.html.erb index 4bb746219..8a3e94c4c 100644 --- a/app/views/admin/budget_phases/_form.html.erb +++ b/app/views/admin/budget_phases/_form.html.erb @@ -6,20 +6,18 @@
- <%= f.label :starts_at, t("admin.budget_phases.edit.start_date") %> <%= f.text_field :starts_at, value: format_date_for_calendar_form(@phase.starts_at), class: "js-calendar-full", id: "start_date", - label: false %> + label: t("admin.budget_phases.edit.start_date") %>
- <%= f.label :ends_at, t("admin.budget_phases.edit.end_date") %> <%= f.text_field :ends_at, value: format_date_for_calendar_form(@phase.ends_at), class: "js-calendar-full", id: "end_date", - label: false %> + label: t("admin.budget_phases.edit.end_date") %>
diff --git a/app/views/admin/dashboard/actions/_form.html.erb b/app/views/admin/dashboard/actions/_form.html.erb index 59e74690a..5e7499451 100644 --- a/app/views/admin/dashboard/actions/_form.html.erb +++ b/app/views/admin/dashboard/actions/_form.html.erb @@ -5,9 +5,9 @@ <%= f.label :action_type %> <% ::Dashboard::Action.action_types.keys.each do |action_type_value| %> - <%= f.radio_button :action_type, action_type_value, label: false, - data: { toggle: "request_to_administrators short_description" } %> - <%= f.label "action_type_#{action_type_value}", t("admin.dashboard.actions.action_type.#{action_type_value}") %> + <%= f.radio_button :action_type, action_type_value, + label: t("admin.dashboard.actions.action_type.#{action_type_value}"), + data: { toggle: "request_to_administrators short_description" } %> <% end %>
@@ -26,12 +26,10 @@
- <%= f.label :title %> - <%= f.text_field :title, label: false %> + <%= f.text_field :title %>
- <%= f.label :short_description %> - <%= f.text_field :short_description, label: false %> + <%= f.text_field :short_description %>
diff --git a/app/views/admin/legislation/draft_versions/_form.html.erb b/app/views/admin/legislation/draft_versions/_form.html.erb index d0cf4f317..6e2395ebb 100644 --- a/app/views/admin/legislation/draft_versions/_form.html.erb +++ b/app/views/admin/legislation/draft_versions/_form.html.erb @@ -71,16 +71,14 @@
<%= f.label :status %> <% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %> - <%= f.radio_button :status, status, label: false %> - <%= f.label "status_#{status}", t("admin.legislation.draft_versions.statuses.#{status}") %> + <%= f.radio_button :status, status, label: t("admin.legislation.draft_versions.statuses.#{status}") %> <%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %>
<% end %>
- <%= f.label :final_version %> - <%= f.check_box :final_version, label: false %> + <%= f.check_box :final_version %> <%= t("admin.legislation.draft_versions.form.hints.final_version") %>
diff --git a/app/views/admin/local_census_records/_form.html.erb b/app/views/admin/local_census_records/_form.html.erb index 959b365cd..5b1dcd9ea 100644 --- a/app/views/admin/local_census_records/_form.html.erb +++ b/app/views/admin/local_census_records/_form.html.erb @@ -15,17 +15,14 @@
- <%= f.label :date_of_birth, t("admin.local_census_records.form.date_of_birth") %> -
- <%= f.date_select :date_of_birth, - prompt: true, - start_year: 1900, end_year: minimum_required_age.years.ago.year, - label: false %> -
+ <%= f.date_select :date_of_birth, + prompt: true, + start_year: 1900, end_year: minimum_required_age.years.ago.year, + label: t("admin.local_census_records.form.date_of_birth") %>
-
+
<%= f.text_field :postal_code %>
diff --git a/app/views/admin/newsletters/_form.html.erb b/app/views/admin/newsletters/_form.html.erb index 37a153fab..c68d3cb37 100644 --- a/app/views/admin/newsletters/_form.html.erb +++ b/app/views/admin/newsletters/_form.html.erb @@ -4,8 +4,7 @@ <%= f.select :segment_recipient, options_for_select(user_segments_options, @newsletter[:segment_recipient]) %> <%= f.text_field :subject %> - <%= f.label :from, t("admin.newsletters.new.from") %> - <%= f.text_field :from, label: false %> + <%= f.text_field :from, label: t("admin.newsletters.new.from") %> <%= f.cktext_area :body, ckeditor: { language: I18n.locale } %>
diff --git a/app/views/admin/poll/shifts/_form.html.erb b/app/views/admin/poll/shifts/_form.html.erb index 726e0797f..5b0f86e7c 100644 --- a/app/views/admin/poll/shifts/_form.html.erb +++ b/app/views/admin/poll/shifts/_form.html.erb @@ -13,11 +13,9 @@
- <%= f.select :task, Poll::Shift.tasks.map { |k, v| [t("admin.poll_shifts.#{k}"), k] }, - { prompt: t("admin.poll_shifts.new.select_task"), - label: false }, + { prompt: t("admin.poll_shifts.new.select_task"), label: t("admin.poll_shifts.new.task") }, class: "js-poll-shifts" %>
diff --git a/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb b/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb index 897558fe4..0753b075e 100644 --- a/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb +++ b/app/views/admin/site_customization/content_blocks/_form_content_block.html.erb @@ -16,17 +16,14 @@ <% end %>
- <%= f.label :name %> - <%= f.select :name, options_for_select(valid_blocks, @selected_content_block), label: false %> + <%= f.select :name, options_for_select(valid_blocks, @selected_content_block) %>
- <%= f.label :locale %> - <%= f.select :locale, I18n.available_locales, label: false %> + <%= f.select :locale, I18n.available_locales %>
- <%= f.label :body %> - <%= f.text_area :body, label: false, rows: 10 %> + <%= f.text_area :body, rows: 10 %>
<%= f.submit class: "button success expanded" %>
diff --git a/app/views/admin/site_customization/pages/_form.html.erb b/app/views/admin/site_customization/pages/_form.html.erb index c253798d8..dbe602451 100644 --- a/app/views/admin/site_customization/pages/_form.html.erb +++ b/app/views/admin/site_customization/pages/_form.html.erb @@ -22,8 +22,8 @@

<%= t("admin.site_customization.pages.form.options") %>

<%= f.label :status %> <% ::SiteCustomization::Page::VALID_STATUSES.each do |status| %> - <%= f.radio_button :status, status, label: false %> - <%= f.label "status_#{status}", t("admin.site_customization.pages.page.status_#{status}") %> + <%= f.radio_button :status, status, + label: t("admin.site_customization.pages.page.status_#{status}") %>
<% end %> diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index b02959059..c40c113d0 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -3,8 +3,7 @@ <%= form_for(@tag, url: admin_tags_path, as: :tag) do |f| %>
- <%= f.label :name, t("admin.tags.name.placeholder") %> - <%= f.text_field :name, placeholder: t("admin.tags.name.placeholder"), label: false %> + <%= f.text_field :name, placeholder: t("admin.tags.name.placeholder"), label: t("admin.tags.name.placeholder") %>
<%= f.submit(t("admin.tags.create"), class: "button success") %> diff --git a/app/views/admin/valuator_groups/edit.html.erb b/app/views/admin/valuator_groups/edit.html.erb index b73095d2e..495750acc 100644 --- a/app/views/admin/valuator_groups/edit.html.erb +++ b/app/views/admin/valuator_groups/edit.html.erb @@ -2,8 +2,7 @@
<%= form_for [:admin, @group] do |f| %> - <%= f.label :name, t("admin.valuator_groups.form.name") %> - <%= f.text_field :name, label: false %> + <%= f.text_field :name, label: t("admin.valuator_groups.form.name") %> <%= f.submit t("admin.valuator_groups.form.edit"), class: "button success" %> <% end %>
diff --git a/app/views/admin/valuator_groups/new.html.erb b/app/views/admin/valuator_groups/new.html.erb index d79f22d85..044c626a7 100644 --- a/app/views/admin/valuator_groups/new.html.erb +++ b/app/views/admin/valuator_groups/new.html.erb @@ -2,8 +2,7 @@
<%= form_for [:admin, @group] do |f| %> - <%= f.label :name, t("admin.valuator_groups.form.name") %> - <%= f.text_field :name, label: false %> + <%= f.text_field :name, label: t("admin.valuator_groups.form.name") %> <%= f.submit t("admin.valuator_groups.form.new"), class: "button success" %> <% end %>
diff --git a/app/views/budgets/investments/_form.html.erb b/app/views/budgets/investments/_form.html.erb index f1b405cc5..4fb08a56b 100644 --- a/app/views/budgets/investments/_form.html.erb +++ b/app/views/budgets/investments/_form.html.erb @@ -59,8 +59,7 @@ <% end %>
- <%= f.label :location, t("budgets.investments.form.location") %> - <%= f.text_field :location, label: false %> + <%= f.text_field :location, label: t("budgets.investments.form.location") %>
diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index 4841e6871..9e828bd08 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -3,8 +3,12 @@ <% css_id = parent_or_commentable_dom_id(parent_id, commentable) %>
class="comment-form"> <%= form_for Comment.new, remote: true do |f| %> - <%= label_tag "comment-body-#{css_id}", leave_comment_text(commentable) %> - <%= f.text_area :body, id: "comment-body-#{css_id}", maxlength: Comment.body_max_length, label: false %> + <%= f.text_area :body, + id: "comment-body-#{css_id}", + maxlength: Comment.body_max_length, + label: leave_comment_text(commentable), + label_options: { for: "comment-body-#{css_id}" } %> + <%= f.hidden_field :commentable_type, value: commentable.class.name %> <%= f.hidden_field :commentable_id, value: commentable.id %> <%= f.hidden_field :parent_id, value: parent_id %> diff --git a/app/views/devise/password_expired/show.html.erb b/app/views/devise/password_expired/show.html.erb index cf008fe35..ac3fd10ae 100644 --- a/app/views/devise/password_expired/show.html.erb +++ b/app/views/devise/password_expired/show.html.erb @@ -3,10 +3,7 @@ <%= form_for(resource, :as => resource_name, :url => [resource_name, :password_expired], :html => { :method => :put }) do |f| %> <%= f.password_field :current_password %>

- - <%= f.label t("devise.password_expired.new_password") %> - <%= f.password_field :password, label: false %>

- + <%= f.password_field :password, label: t("devise.password_expired.new_password") %>

<%= f.password_field :password_confirmation %>

<%= f.submit t("devise.password_expired.change_password") %>

diff --git a/app/views/direct_messages/new.html.erb b/app/views/direct_messages/new.html.erb index fef4d84dc..202dff6c8 100644 --- a/app/views/direct_messages/new.html.erb +++ b/app/views/direct_messages/new.html.erb @@ -23,11 +23,8 @@ <%= form_for [@receiver, @direct_message] do |f| %> <%= render "shared/errors", resource: @direct_message %> - <%= f.label :title, t("users.direct_messages.new.title_label") %> - <%= f.text_field :title, label: false %> - - <%= f.label :body, t("users.direct_messages.new.body_label") %> - <%= f.text_area :body, label: false, rows: "3" %> + <%= f.text_field :title, label: t("users.direct_messages.new.title_label") %> + <%= f.text_area :body, label: t("users.direct_messages.new.body_label"), rows: "3" %>
<%= f.submit t("users.direct_messages.new.submit_button"), class: "button expanded" %> diff --git a/app/views/legislation/proposals/_form.html.erb b/app/views/legislation/proposals/_form.html.erb index e48f149ec..95e15ae21 100644 --- a/app/views/legislation/proposals/_form.html.erb +++ b/app/views/legislation/proposals/_form.html.erb @@ -5,8 +5,10 @@
- <%= f.label :title, t("proposals.form.proposal_title") %> - <%= f.text_field :title, maxlength: Legislation::Proposal.title_max_length, placeholder: t("proposals.form.proposal_title"), label: false %> + <%= f.text_field :title, + maxlength: Legislation::Proposal.title_max_length, + placeholder: t("proposals.form.proposal_title"), + label: t("proposals.form.proposal_title") %>
<%= f.invisible_captcha :subtitle %> @@ -20,8 +22,10 @@
- <%= f.label :description, t("proposals.form.proposal_text") %> - <%= f.cktext_area :description, maxlength: Legislation::Proposal.description_max_length, ckeditor: { language: I18n.locale }, label: false %> + <%= f.cktext_area :description, + maxlength: Legislation::Proposal.description_max_length, + ckeditor: { language: I18n.locale }, + label: t("proposals.form.proposal_text") %>
@@ -42,8 +46,8 @@
- <%= f.label :geozone_id, t("proposals.form.geozone") %> - <%= f.select :geozone_id, geozone_select_options, { include_blank: t("geozones.none"), label: false } %> + <%= f.select :geozone_id, geozone_select_options, + include_blank: t("geozones.none"), label: t("proposals.form.geozone") %>
diff --git a/app/views/management/users/new.html.erb b/app/views/management/users/new.html.erb index ce5b5a01a..8c8b4c5a4 100644 --- a/app/views/management/users/new.html.erb +++ b/app/views/management/users/new.html.erb @@ -13,11 +13,10 @@ label: t("management.users.email_optional_label"), placeholder: t("management.email_label") %>
- <%= f.label t("management.date_of_birth") %> <%= f.date_select :date_of_birth, prompt: true, start_year: 1900, end_year: 16.years.ago.year, - label: false %> + label: t("management.date_of_birth") %>
<%= f.submit t("management.users.create_user_submit"), class: "button success" %> <% end %> diff --git a/app/views/proposal_notifications/new.html.erb b/app/views/proposal_notifications/new.html.erb index cee18f1d8..408be1404 100644 --- a/app/views/proposal_notifications/new.html.erb +++ b/app/views/proposal_notifications/new.html.erb @@ -20,12 +20,8 @@ <%= form_for @notification do |f| %> <%= render "shared/errors", resource: @notification %> - <%= f.label :title, t("proposal_notifications.new.title_label") %> - <%= f.text_field :title, label: false %> - - <%= f.label :body, t("proposal_notifications.new.body_label") %> - <%= f.text_area :body, label: false, rows: "3" %> - + <%= f.text_field :title, label: t("proposal_notifications.new.title_label") %> + <%= f.text_area :body, label: t("proposal_notifications.new.body_label"), rows: "3" %> <%= f.hidden_field :proposal_id, value: @proposal.id %>
diff --git a/app/views/proposals/_form.html.erb b/app/views/proposals/_form.html.erb index 415536e85..ef5eb2dd7 100644 --- a/app/views/proposals/_form.html.erb +++ b/app/views/proposals/_form.html.erb @@ -58,8 +58,8 @@ <% end %>
- <%= f.label :geozone_id, t("proposals.form.geozone") %> - <%= f.select :geozone_id, geozone_select_options, { include_blank: t("geozones.none"), label: false } %> + <%= f.select :geozone_id, geozone_select_options, + include_blank: t("geozones.none"), label: t("proposals.form.geozone") %>
<% if feature?(:map) %> diff --git a/app/views/proposals/retire_form.html.erb b/app/views/proposals/retire_form.html.erb index 9de4bd3ba..6c1e5e182 100644 --- a/app/views/proposals/retire_form.html.erb +++ b/app/views/proposals/retire_form.html.erb @@ -16,8 +16,9 @@ <%= render "shared/errors", resource: @proposal %>
- <%= f.label :retired_reason, t("proposals.retire_form.retired_reason_label") %> - <%= f.select :retired_reason, retire_proposals_options, { include_blank: t("proposals.retire_form.retired_reason_blank"), label: false } %> + <%= f.select :retired_reason, retire_proposals_options, + include_blank: t("proposals.retire_form.retired_reason_blank"), + label: t("proposals.retire_form.retired_reason_label") %>
diff --git a/app/views/shared/_map.html.erb b/app/views/shared/_map.html.erb index 499b1e47e..e2112e7a5 100644 --- a/app/views/shared/_map.html.erb +++ b/app/views/shared/_map.html.erb @@ -31,9 +31,8 @@ <%= form_for(@resource, url: new_url_path, method: :get) do |f| %>
- <%= f.label :geozone_id, t("map.select_district") %> <%= f.select :geozone_id, geozone_select_options, - { include_blank: t("geozones.none"), label: false } %> + include_blank: t("geozones.none"), label: t("map.select_district") %>
diff --git a/app/views/topics/_form.html.erb b/app/views/topics/_form.html.erb index 3ec5982d1..2119ee5b6 100644 --- a/app/views/topics/_form.html.erb +++ b/app/views/topics/_form.html.erb @@ -4,11 +4,8 @@
- <%= f.label :title, t("community.topic.form.topic_title") %> - <%= f.text_field :title, label: false %> - - <%= f.label :description, t("community.topic.form.topic_text") %> - <%= f.text_area :description, label: false, rows: "5" %> + <%= f.text_field :title, label: t("community.topic.form.topic_title") %> + <%= f.text_area :description, label: t("community.topic.form.topic_text"), rows: "5" %> <%= f.submit(class: "button", value: t("community.topic.form.#{action_name}.submit_button")) %>
diff --git a/app/views/tracking/milestones/_form.html.erb b/app/views/tracking/milestones/_form.html.erb index a6fd6687a..e56e69682 100644 --- a/app/views/tracking/milestones/_form.html.erb +++ b/app/views/tracking/milestones/_form.html.erb @@ -27,10 +27,9 @@
- <%= f.label :publication_date, t("tracking.milestones.new.date") %> <%= f.text_field :publication_date, value: @milestone.publication_date.present? ? l(@milestone.publication_date.to_date) : nil, - label: false, + label: t("tracking.milestones.new.date"), class: "js-calendar-full" %> <%= render "images/admin_image", imageable: @milestone, f: f %> diff --git a/app/views/users/registrations/edit.html.erb b/app/views/users/registrations/edit.html.erb index c4abc987d..105a8ca5a 100644 --- a/app/views/users/registrations/edit.html.erb +++ b/app/views/users/registrations/edit.html.erb @@ -6,8 +6,10 @@ <%= render "shared/errors", resource: resource %>
- <%= f.label :email, t("devise_views.users.registrations.edit.email_label") %> - <%= f.email_field :email, label: false, autofocus: true, placeholder: t("devise_views.users.registrations.edit.email_label") %> + <%= f.email_field :email, + label: t("devise_views.users.registrations.edit.email_label"), + autofocus: true, + placeholder: t("devise_views.users.registrations.edit.email_label") %>
@@ -25,8 +27,10 @@
- <%= f.label :password_confirmation, t("devise_views.users.registrations.edit.password_confirmation_label") %> - <%= f.password_field :password_confirmation, label: false, autocomplete: "off", placeholder: t("devise_views.users.registrations.edit.password_confirmation_label") %> + <%= f.password_field :password_confirmation, + label: t("devise_views.users.registrations.edit.password_confirmation_label"), + autocomplete: "off", + placeholder: t("devise_views.users.registrations.edit.password_confirmation_label") %>
diff --git a/app/views/valuation/budget_investments/_dossier_form.html.erb b/app/views/valuation/budget_investments/_dossier_form.html.erb index 469fce699..60ec0e2d5 100644 --- a/app/views/valuation/budget_investments/_dossier_form.html.erb +++ b/app/views/valuation/budget_investments/_dossier_form.html.erb @@ -7,22 +7,22 @@ <%= t("valuation.budget_investments.edit.feasibility") %>
- <%= f.radio_button :feasibility, "undecided", label: false %> - <%= f.label :feasibility_undecided, t("valuation.budget_investments.edit.undefined_feasible") %> + <%= f.radio_button :feasibility, "undecided", + label: t("valuation.budget_investments.edit.undefined_feasible") %>
- <%= f.radio_button :feasibility, "feasible", label: false %> - <%= f.label :feasibility_feasible, t("valuation.budget_investments.edit.feasible") %> + <%= f.radio_button :feasibility, "feasible", + label: t("valuation.budget_investments.edit.feasible") %>
- <%= f.radio_button :feasibility, "unfeasible", label: false %> - <%= f.label :feasibility_unfeasible, t("valuation.budget_investments.edit.unfeasible") %> + <%= f.radio_button :feasibility, "unfeasible", + label: t("valuation.budget_investments.edit.unfeasible") %>
@@ -33,8 +33,9 @@
- <%= f.label :unfeasibility_explanation, t("valuation.budget_investments.edit.feasible_explanation_html") %> - <%= f.text_area :unfeasibility_explanation, label: false, rows: 3 %> + <%= f.text_area :unfeasibility_explanation, + label: t("valuation.budget_investments.edit.feasible_explanation_html"), + rows: 3 %>
@@ -44,27 +45,29 @@
- <%= f.label :price, "#{t("valuation.budget_investments.edit.price_html", currency: budget.currency_symbol)}" %> - <%= f.number_field :price, label: false, max: 1000000000000000 %> + <%= f.number_field :price, + label: t("valuation.budget_investments.edit.price_html", currency: budget.currency_symbol), + max: 1000000000000000 %>
- <%= f.label :price_first_year, "#{t("valuation.budget_investments.edit.price_first_year_html", currency: budget.currency_symbol)}" %> - <%= f.number_field :price_first_year, label: false, max: 1000000000000000 %> + <%= f.number_field :price_first_year, + label: t("valuation.budget_investments.edit.price_first_year_html", currency: budget.currency_symbol), + max: 1000000000000000 %>
- <%= f.label :price_explanation, t("valuation.budget_investments.edit.price_explanation_html") %> - <%= f.text_area :price_explanation, label: false, rows: 3 %> + <%= f.text_area :price_explanation, + label: t("valuation.budget_investments.edit.price_explanation_html"), + rows: 3 %>
- <%= f.label :duration, t("valuation.budget_investments.edit.duration_html") %> - <%= f.text_field :duration, label: false %> + <%= f.text_field :duration, label: t("valuation.budget_investments.edit.duration_html") %>
diff --git a/app/views/verification/residence/new.html.erb b/app/views/verification/residence/new.html.erb index b95523a75..6366ab6d5 100644 --- a/app/views/verification/residence/new.html.erb +++ b/app/views/verification/residence/new.html.erb @@ -39,8 +39,8 @@
- <%= f.label t("verification.residence.new.document_type_label") %> - <%= f.select :document_type, document_types, prompt: "", label: false %> + <%= f.select :document_type, document_types, prompt: "", + label: t("verification.residence.new.document_type_label") %>
@@ -64,11 +64,10 @@
- <%= f.label t("verification.residence.new.date_of_birth") %> <%= f.date_select :date_of_birth, prompt: true, start_year: 1900, end_year: minimum_required_age.years.ago.year, - label: false %> + label: t("verification.residence.new.date_of_birth") %>
diff --git a/app/views/verification/sms/edit.html.erb b/app/views/verification/sms/edit.html.erb index 51189f2bc..af9c70e1f 100644 --- a/app/views/verification/sms/edit.html.erb +++ b/app/views/verification/sms/edit.html.erb @@ -33,8 +33,7 @@ <% end %>
- <%= f.label t("verification.sms.edit.confirmation_code") %> - <%= f.text_field :confirmation_code, label: false %> + <%= f.text_field :confirmation_code, label: t("verification.sms.edit.confirmation_code") %>
<%= f.submit t("verification.sms.edit.submit_button"), class: "button success" %>