mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
|
||||
|
||||
@@ -64,7 +64,8 @@ class UserSerializer < BasicUserSerializer
|
||||
:edit_history_public,
|
||||
:custom_fields,
|
||||
:user_fields,
|
||||
:topic_post_count
|
||||
:topic_post_count,
|
||||
:pending_count
|
||||
|
||||
has_one :invited_by, embed: :object, serializer: BasicUserSerializer
|
||||
has_many :custom_groups, embed: :object, serializer: BasicGroupSerializer
|
||||
@@ -312,4 +313,8 @@ class UserSerializer < BasicUserSerializer
|
||||
{}
|
||||
end
|
||||
end
|
||||
|
||||
def pending_count
|
||||
0
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user