discourse/app/models/navigation_menu_site_setting.rb
Alan Guo Xiang Tan fde9e6bc25
DEV: Migrate sidebar site settings (#19336)
This new site setting replaces the
`enable_experimental_sidebar_hamburger` and `enable_sidebar` site
settings as the sidebar feature exits the experimental phase.

Note that we're replacing this without depreciation since the previous
site setting was considered experimental.

Internal Ref: /t/86563
2022-12-08 09:44:29 +08:00

24 lines
543 B
Ruby

# frozen_string_literal: true
class NavigationMenuSiteSetting < EnumSiteSetting
SIDEBAR = "sidebar"
HEADER_DROPDOWN = "header dropdown"
LEGACY = "legacy"
def self.valid_value?(val)
values.any? { |v| v[:value] == val }
end
def self.values
@values ||= [
{ name: "admin.navigation_menu.sidebar", value: SIDEBAR },
{ name: "admin.navigation_menu.header_dropdown", value: HEADER_DROPDOWN },
{ name: "admin.navigation_menu.legacy", value: LEGACY }
]
end
def self.translate_names?
true
end
end