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:
parent
9ad226aaa8
commit
7303f8f309
16 changed files with 292 additions and 7 deletions
18
app/serializers/user_summary_serializer.rb
Normal file
18
app/serializers/user_summary_serializer.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue