diff --git a/app/views/admin/settings/_sdg_configuration_tab.html.erb b/app/components/admin/settings/sdg_configuration_tab_component.html.erb similarity index 77% rename from app/views/admin/settings/_sdg_configuration_tab.html.erb rename to app/components/admin/settings/sdg_configuration_tab_component.html.erb index 795798c18..73ddbe987 100644 --- a/app/views/admin/settings/_sdg_configuration_tab.html.erb +++ b/app/components/admin/settings/sdg_configuration_tab_component.html.erb @@ -2,7 +2,7 @@

<%= t("admin.settings.index.sdg.title") %>

<%= render Admin::Settings::TableComponent.new(setting_name: "feature", table_class: "featured-settings-table") do %> - <% %w[sdg.process.debates sdg.process.proposals sdg.process.polls sdg.process.budgets sdg.process.legislation].each do |key| %> + <% settings.each do |key| %> <%= render Admin::Settings::RowComponent.new(key, type: :feature, tab: "#tab-sdg-configuration") %> <% end %> <% end %> diff --git a/app/components/admin/settings/sdg_configuration_tab_component.rb b/app/components/admin/settings/sdg_configuration_tab_component.rb new file mode 100644 index 000000000..975570375 --- /dev/null +++ b/app/components/admin/settings/sdg_configuration_tab_component.rb @@ -0,0 +1,11 @@ +class Admin::Settings::SDGConfigurationTabComponent < ApplicationComponent + def settings + %w[ + sdg.process.debates + sdg.process.proposals + sdg.process.polls + sdg.process.budgets + sdg.process.legislation + ] + end +end diff --git a/app/views/admin/settings/index.html.erb b/app/views/admin/settings/index.html.erb index 9055019eb..7eadd3e52 100644 --- a/app/views/admin/settings/index.html.erb +++ b/app/views/admin/settings/index.html.erb @@ -31,6 +31,6 @@
- <%= render "sdg_configuration_tab" %> + <%= render Admin::Settings::SDGConfigurationTabComponent.new %>