UX: Show tags on flags too

This commit is contained in:
Robin Ward
2019-04-05 14:22:27 -04:00
parent 8181ad646b
commit a6f283da30
6 changed files with 42 additions and 34 deletions

View File

@@ -11,11 +11,12 @@ class ReviewableSerializer < ApplicationSerializer
:type,
:topic_id,
:topic_url,
:topic_tags,
:category_id,
:created_at,
:can_edit,
:score,
:version
:version,
)
has_one :created_by, serializer: BasicUserSerializer, root: 'users'
@@ -87,6 +88,14 @@ class ReviewableSerializer < ApplicationSerializer
data
end
def topic_tags
object.topic.tags.map(&:name)
end
def include_topic_tags?
object.topic.present? && SiteSetting.tagging_enabled?
end
def topic_url
return object.target.url if object.target.is_a?(Post)
return object.topic.url