discourse/app/models/category_page_style.rb
Robin Ward 31e3bf6d8d FEATURE: New "Categories and Top" homepage style
Select this option if you want to show top topics on the homepage
instead of latest topics.
2018-03-03 14:26:57 -05:00

23 lines
658 B
Ruby

require "enum_site_setting"
class CategoryPageStyle < EnumSiteSetting
def self.valid_value?(val)
values.any? { |v| v[:value].to_s == val.to_s }
end
def self.values
@values ||= [
{ name: 'category_page_style.categories_only', value: 'categories_only' },
{ name: 'category_page_style.categories_with_featured_topics', value: 'categories_with_featured_topics' },
{ name: 'category_page_style.categories_and_latest_topics', value: 'categories_and_latest_topics' },
{ name: 'category_page_style.categories_and_top_topics', value: 'categories_and_top_topics' },
]
end
def self.translate_names?
true
end
end