Before this change, two important things depend on the format of each key, where to render it in the administration panel and which kind of interface to use for each setting. Following this strategy led us to a very complex code, very difficult to maintain or modify. So, we do not want to depend on the setting key structure anymore to decide how or where to render each setting. With this commit, we get rid of the key format-based rules. Now we render each setting explicitly passing to it the type and the tab where it belongs.
19 lines
673 B
Plaintext
19 lines
673 B
Plaintext
<tr>
|
|
<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>
|
|
<% if content_type_setting? %>
|
|
<%= render Admin::Settings::ContentTypesFormComponent.new(setting, tab: tab) %>
|
|
<% elsif featured_setting? %>
|
|
<%= render Admin::Settings::FeaturedSettingsFormComponent.new(setting, tab: tab) %>
|
|
<% else %>
|
|
<%= render Admin::Settings::TextFormComponent.new(setting, tab: tab) %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|