discourse/app/models/category_page_style.rb
David Taylor eb2e3b510d
FEATURE: Introduce 'Subcategories with featured topics' view (#16083)
This categories view is designed for sites which make heavy use of subcategories, and use top-level categories mainly for grouping
2022-03-04 21:11:59 +00:00

28 lines
998 B
Ruby

# frozen_string_literal: true
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' },
{ name: 'category_page_style.subcategories_with_featured_topics', value: 'subcategories_with_featured_topics' },
]
end
def self.translate_names?
true
end
end