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:
Régis Hanol
2016-04-13 23:02:51 +02:00
parent b0803f7035
commit e808f7f41e
6 changed files with 143 additions and 23 deletions

View File

@ -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