Extract SDG configuration tab partial to a component

This commit is contained in:
Senén Rodero Rodríguez
2024-01-18 17:04:09 +01:00
committed by Javi Martín
parent f32d7edcf3
commit 047cb2b76c
3 changed files with 13 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
<% if feature?(:sdg) %>
<h2><%= t("admin.settings.index.sdg.title") %></h2>
<%= render Admin::Settings::TableComponent.new(setting_name: "feature", table_class: "featured-settings-table") do %>
<% settings.each do |key| %>
<%= render Admin::Settings::RowComponent.new(key, type: :feature, tab: "#tab-sdg-configuration") %>
<% end %>
<% end %>
<% else %>
<div class="callout primary">
<%= t("admin.settings.index.sdg.how_to_enable") %>
</div>
<% end %>

View File

@@ -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