2019-08-19 04:40:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class SiteCategorySerializer < BasicCategorySerializer
|
|
|
|
|
|
|
|
attributes :allowed_tags,
|
|
|
|
:allowed_tag_groups,
|
2019-10-30 14:49:00 -04:00
|
|
|
:allow_global_tags,
|
|
|
|
:min_tags_from_required_group,
|
2020-04-30 13:39:11 -04:00
|
|
|
:required_tag_group_name,
|
|
|
|
:read_only_banner
|
2019-08-19 04:40:56 -04:00
|
|
|
|
|
|
|
def include_allowed_tags?
|
|
|
|
SiteSetting.tagging_enabled
|
|
|
|
end
|
|
|
|
|
|
|
|
def allowed_tags
|
|
|
|
object.tags.pluck(:name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_allowed_tag_groups?
|
|
|
|
SiteSetting.tagging_enabled
|
|
|
|
end
|
|
|
|
|
|
|
|
def allowed_tag_groups
|
|
|
|
object.tag_groups.pluck(:name)
|
|
|
|
end
|
|
|
|
|
|
|
|
def include_allow_global_tags?
|
|
|
|
SiteSetting.tagging_enabled
|
|
|
|
end
|
|
|
|
|
2019-10-30 14:49:00 -04:00
|
|
|
def required_tag_group_name
|
|
|
|
object.required_tag_group&.name
|
|
|
|
end
|
|
|
|
|
2019-08-19 04:40:56 -04:00
|
|
|
end
|