discourse/app/models/category_page_style.rb
Jeff Wong b5b382dcd6 Feature: add boxes with subcategories option for desktop categories page (#6471)
* Feature: add boxes with subcategories option for desktop categories page

* only add subclass div when subclasses exist
2018-10-11 15:59:37 +08:00

25 lines
848 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' },
{ name: 'category_page_style.categories_boxes', value: 'categories_boxes' },
{ name: 'category_page_style.categories_boxes_with_topics', value: 'categories_boxes_with_topics' },
]
end
def self.translate_names?
true
end
end