mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
trust level 0 is highlighted in light gray as opposed to having special semantics around account age.
This commit is contained in:
13
app/serializers/post_serializer.rb
Normal file → Executable file
13
app/serializers/post_serializer.rb
Normal file → Executable 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,
|
||||
|
||||
Reference in New Issue
Block a user