trust level 0 is highlighted in light gray as opposed to having special semantics around account age.

This commit is contained in:
Sam
2013-04-04 12:24:10 +11:00
parent 9068fdae99
commit 86cf7b1524
18 changed files with 21 additions and 28 deletions

13
app/serializers/post_serializer.rb Normal file → Executable file
View File

@@ -37,21 +37,16 @@ class PostSerializer < ApplicationSerializer
:bookmarked,
:raw,
:actions_summary,
:new_user?,
:moderator?,
:avatar_template,
:user_id,
:draft_sequence,
:hidden,
:hidden_reason_id,
:deleted_at
:deleted_at,
:trust_level
def new_user?
# 21 calls = 5ms ... if there was a proper date in the RHS it would be 1ms
object.user.created_at > SiteSetting.new_user_period_days.days.ago
end
def moderator?
object.user.moderator?
end
@@ -128,6 +123,10 @@ class PostSerializer < ApplicationSerializer
object.user.name
end
def trust_level
object.user.trust_level
end
def reply_to_user
{
username: object.reply_to_user.username,