mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
User Summary improvements
Added "Top Links" list Added "Most Liked By" list Added "Bookmark count" stat UX: Use fa heart icon instead of "like" text in stats Change the order of the user stats
This commit is contained in:
@ -8,9 +8,19 @@ class UserSummarySerializer < ApplicationSerializer
|
||||
has_one :topic, serializer: TopicSerializer
|
||||
end
|
||||
|
||||
class LinkSerializer < ApplicationSerializer
|
||||
attributes :url, :title, :clicks, :domain
|
||||
end
|
||||
|
||||
class MostLikedByUserSerializer < BasicUserSerializer
|
||||
attributes :likes, :name
|
||||
end
|
||||
|
||||
has_many :topics, serializer: TopicSerializer
|
||||
has_many :replies, serializer: ReplySerializer, embed: :object
|
||||
has_many :badges, serializer: UserBadgeSerializer, embed: :object
|
||||
has_many :links, serializer: LinkSerializer, embed: :object
|
||||
has_many :most_liked_by_users, serializer: MostLikedByUserSerializer, embed: :object
|
||||
|
||||
attributes :likes_given,
|
||||
:likes_received,
|
||||
@ -18,7 +28,8 @@ class UserSummarySerializer < ApplicationSerializer
|
||||
:days_visited,
|
||||
:topic_count,
|
||||
:post_count,
|
||||
:time_read
|
||||
:time_read,
|
||||
:bookmark_count
|
||||
|
||||
def include_badges?
|
||||
SiteSetting.enable_badges
|
||||
|
Reference in New Issue
Block a user