2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FEATURE: first pass at user summary page

This commit is contained in:
Sam Saffron 2016-01-20 15:11:52 +11:00
parent 9ad226aaa8
commit 7303f8f309
16 changed files with 292 additions and 7 deletions

View file

@ -0,0 +1,18 @@
class UserSummarySerializer < ApplicationSerializer
class TopicSerializer < BasicTopicSerializer
attributes :like_count, :slug, :created_at
end
class ReplySerializer < ApplicationSerializer
attributes :post_number, :like_count, :created_at
has_one :topic, serializer: TopicSerializer
end
has_many :topics, serializer: TopicSerializer
has_many :replies, serializer: ReplySerializer, embed: :object
has_many :badges, serializer: UserBadgeSerializer, embed: :object
attributes :likes_given, :likes_received, :posts_read_count,
:days_visited, :topic_count, :post_count
end