diff --git a/app/components/admin/dashboard/actions/form_component.html.erb b/app/components/admin/dashboard/actions/form_component.html.erb index 9f0abfa14..67244e9ed 100644 --- a/app/components/admin/dashboard/actions/form_component.html.erb +++ b/app/components/admin/dashboard/actions/form_component.html.erb @@ -3,14 +3,14 @@ <%= render "shared/errors" %>
-
- <%= f.label :action_type %> +
+ <%= attribute_name(:action_type) %> <% ::Dashboard::Action.action_types.keys.each do |action_type_value| %> <%= f.radio_button :action_type, action_type_value %> <% end %> -
+
<%= f.check_box :active %> diff --git a/app/components/admin/dashboard/actions/form_component.rb b/app/components/admin/dashboard/actions/form_component.rb index c64d511b3..18033ba63 100644 --- a/app/components/admin/dashboard/actions/form_component.rb +++ b/app/components/admin/dashboard/actions/form_component.rb @@ -5,4 +5,10 @@ class Admin::Dashboard::Actions::FormComponent < ApplicationComponent @dashboard_action = dashboard_action @url_action = url_action end + + private + + def attribute_name(attribute) + Dashboard::Action.human_attribute_name(attribute) + end end diff --git a/app/components/admin/legislation/draft_versions/form_component.html.erb b/app/components/admin/legislation/draft_versions/form_component.html.erb index 79cc3a4cd..6d468e6d5 100644 --- a/app/components/admin/legislation/draft_versions/form_component.html.erb +++ b/app/components/admin/legislation/draft_versions/form_component.html.erb @@ -60,14 +60,14 @@
-
- <%= f.label :status %> +
+ <%= attribute_name(:status) %> <% ::Legislation::DraftVersion::VALID_STATUSES.each do |status| %> <%= f.radio_button :status, status %> <%= t("admin.legislation.draft_versions.form.hints.status.#{status}") %>
<% end %> -
+
<%= f.check_box :final_version %> diff --git a/app/components/admin/legislation/draft_versions/form_component.rb b/app/components/admin/legislation/draft_versions/form_component.rb index ef90c4ebc..007295478 100644 --- a/app/components/admin/legislation/draft_versions/form_component.rb +++ b/app/components/admin/legislation/draft_versions/form_component.rb @@ -11,6 +11,10 @@ class Admin::Legislation::DraftVersions::FormComponent < ApplicationComponent private + def attribute_name(attribute) + Legislation::DraftVersion.human_attribute_name(attribute) + end + def process draft_version.process end diff --git a/app/components/admin/site_customization/pages/form_component.html.erb b/app/components/admin/site_customization/pages/form_component.html.erb index 9fcabb9de..4f0f97466 100644 --- a/app/components/admin/site_customization/pages/form_component.html.erb +++ b/app/components/admin/site_customization/pages/form_component.html.erb @@ -10,11 +10,13 @@

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

- <%= f.label :status %> - <% ::SiteCustomization::Page::VALID_STATUSES.each do |status| %> - <%= f.radio_button :status, status %> -
- <% end %> +
+ <%= attribute_name(:status) %> + <% ::SiteCustomization::Page::VALID_STATUSES.each do |status| %> + <%= f.radio_button :status, status %> +
+ <% end %> +
<%= f.check_box :more_info_flag, class: "small" %> <%= f.check_box :print_content_flag %> diff --git a/app/components/admin/site_customization/pages/form_component.rb b/app/components/admin/site_customization/pages/form_component.rb index d503d0c79..b4f705107 100644 --- a/app/components/admin/site_customization/pages/form_component.rb +++ b/app/components/admin/site_customization/pages/form_component.rb @@ -6,4 +6,10 @@ class Admin::SiteCustomization::Pages::FormComponent < ApplicationComponent def initialize(page) @page = page end + + private + + def attribute_name(attribute) + SiteCustomization::Page.human_attribute_name(attribute) + end end