mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
Users can see their pending posts
This commit is contained in:
@ -29,7 +29,8 @@ class UserActionSerializer < ApplicationSerializer
|
||||
:acting_uploaded_avatar_id
|
||||
|
||||
def excerpt
|
||||
PrettyText.excerpt(object.cooked, 300) if object.cooked
|
||||
cooked = object.cooked || PrettyText.cook(object.raw)
|
||||
PrettyText.excerpt(cooked, 300) if cooked
|
||||
end
|
||||
|
||||
def avatar_template
|
||||
@ -40,6 +41,10 @@ class UserActionSerializer < ApplicationSerializer
|
||||
User.avatar_template(object.acting_username, object.acting_uploaded_avatar_id)
|
||||
end
|
||||
|
||||
def include_acting_avatar_template?
|
||||
object.acting_username.present?
|
||||
end
|
||||
|
||||
def include_name?
|
||||
SiteSetting.enable_names?
|
||||
end
|
||||
@ -56,6 +61,10 @@ class UserActionSerializer < ApplicationSerializer
|
||||
Slug.for(object.title)
|
||||
end
|
||||
|
||||
def include_slug?
|
||||
object.title.present?
|
||||
end
|
||||
|
||||
def moderator_action
|
||||
object.post_type == Post.types[:moderator_action]
|
||||
end
|
||||
|
Reference in New Issue
Block a user