Extract SDG configuration tab partial to a component
This commit is contained in:
committed by
Javi Martín
parent
f32d7edcf3
commit
047cb2b76c
@@ -2,7 +2,7 @@
|
|||||||
<h2><%= t("admin.settings.index.sdg.title") %></h2>
|
<h2><%= t("admin.settings.index.sdg.title") %></h2>
|
||||||
|
|
||||||
<%= render Admin::Settings::TableComponent.new(setting_name: "feature", table_class: "featured-settings-table") do %>
|
<%= 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") %>
|
<%= render Admin::Settings::RowComponent.new(key, type: :feature, tab: "#tab-sdg-configuration") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -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
|
||||||
@@ -31,6 +31,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tabs-panel" id="tab-sdg-configuration">
|
<div class="tabs-panel" id="tab-sdg-configuration">
|
||||||
<%= render "sdg_configuration_tab" %>
|
<%= render Admin::Settings::SDGConfigurationTabComponent.new %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user