Users can see their pending posts

This commit is contained in:
Robin Ward
2015-04-21 14:36:46 -04:00
parent 26693c16ac
commit 5bf8c31af4
17 changed files with 225 additions and 101 deletions

View File

@ -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