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
@@ -8,11 +8,29 @@ class Admin::Settings::TableComponent < ApplicationComponent
|
||||
@tab = tab
|
||||
end
|
||||
|
||||
def display_setting_name(setting_name)
|
||||
if setting_name == "setting"
|
||||
def key_header
|
||||
if setting_name == "feature"
|
||||
t("admin.settings.setting")
|
||||
elsif setting_name == "setting"
|
||||
t("admin.settings.setting_name")
|
||||
else
|
||||
t("admin.settings.#{setting_name}")
|
||||
end
|
||||
end
|
||||
|
||||
def value_header
|
||||
if setting_name == "feature"
|
||||
t("admin.settings.index.features.enabled")
|
||||
else
|
||||
t("admin.settings.setting_value")
|
||||
end
|
||||
end
|
||||
|
||||
def table_class
|
||||
if settings.all?(&:feature?)
|
||||
"featured-settings-table"
|
||||
else
|
||||
"mixed-settings-table"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user