Extract SDG configuration tab partial to a component
This commit is contained in:
committed by
Javi Martín
parent
f32d7edcf3
commit
047cb2b76c
@@ -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 %>
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user