Use admin table settings component to render featured settings
Now, with the same template we can render all kind of settings.
This commit is contained in:
committed by
Javi Martín
parent
e7223ba865
commit
6a64f38d17
@@ -1,23 +1,25 @@
|
||||
<table>
|
||||
<table class="<%= table_class %>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= display_setting_name(setting_name) %></th>
|
||||
<th><%= t("admin.settings.setting_value") %></th>
|
||||
<th><%= key_header %></th>
|
||||
<th><%= value_header %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% settings.each do |setting| %>
|
||||
<tr>
|
||||
<td class="small-6">
|
||||
<strong><%= t("settings.#{setting.key}") %></strong>
|
||||
<td>
|
||||
<strong id="<%= dom_id(setting, :title) %>"><%= t("settings.#{setting.key}") %></strong>
|
||||
<br>
|
||||
<span id="<%= dom_id(setting, :description) %>" class="small">
|
||||
<%= t("settings.#{setting.key}_description", default: t("admin.settings.no_description")) %>
|
||||
</span>
|
||||
</td>
|
||||
<td class="small-6">
|
||||
<td>
|
||||
<% if setting.content_type? %>
|
||||
<%= render Admin::Settings::ContentTypesFormComponent.new(setting) %>
|
||||
<% elsif setting.feature? %>
|
||||
<%= render Admin::Settings::FeaturedSettingsFormComponent.new(setting, tab: tab) %>
|
||||
<% else %>
|
||||
<%= render Admin::Settings::TextFormComponent.new(setting, tab: tab) %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user