2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-22 17:01:43 -04:00
|
|
|
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",
|
2022-07-25 09:41:43 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "category_page_style.categories_and_latest_topics_created_date",
|
|
|
|
value: "categories_and_latest_topics_created_date",
|
2016-08-22 17:01:43 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "category_page_style.categories_and_latest_topics",
|
|
|
|
value: "categories_and_latest_topics",
|
2023-01-09 07:20:10 -05:00
|
|
|
},
|
2018-03-02 21:53:29 -05:00
|
|
|
{ name: "category_page_style.categories_and_top_topics", value: "categories_and_top_topics" },
|
2018-10-11 03:59:37 -04:00
|
|
|
{ name: "category_page_style.categories_boxes", value: "categories_boxes" },
|
2018-10-08 18:42:09 -04:00
|
|
|
{
|
|
|
|
name: "category_page_style.categories_boxes_with_topics",
|
|
|
|
value: "categories_boxes_with_topics",
|
2022-03-04 16:11:59 -05:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "category_page_style.subcategories_with_featured_topics",
|
|
|
|
value: "subcategories_with_featured_topics",
|
2023-01-09 07:20:10 -05:00
|
|
|
},
|
2016-08-22 17:01:43 -04:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.translate_names?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|