FEATURE: Can click to expand hidden posts to see the good stuff!

This commit is contained in:
Robin Ward
2014-06-20 17:06:44 -04:00
parent 14c1752474
commit 8a4e96645c
8 changed files with 54 additions and 5 deletions

View File

@@ -6,7 +6,8 @@ class BasicPostSerializer < ApplicationSerializer
:avatar_template,
:uploaded_avatar_id,
:created_at,
:cooked
:cooked,
:cooked_hidden
def name
object.user.try(:name)
@@ -24,8 +25,15 @@ class BasicPostSerializer < ApplicationSerializer
object.user.try(:uploaded_avatar_id)
end
def cooked_hidden
object.hidden && !scope.is_staff?
end
def include_cooked_hidden?
cooked_hidden
end
def cooked
if object.hidden && !scope.is_staff?
if cooked_hidden
if scope.current_user && object.user_id == scope.current_user.id
I18n.t('flagging.you_must_edit')
else