mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
hide bookmarks count in user summary except for yourself
This commit is contained in:
parent
f7e552e131
commit
03605f1b01
3 changed files with 11 additions and 1 deletions
|
@ -8,7 +8,9 @@
|
||||||
</li>
|
</li>
|
||||||
<li>{{user-stat value=model.posts_read_count label="user.summary.posts_read"}}</li>
|
<li>{{user-stat value=model.posts_read_count label="user.summary.posts_read"}}</li>
|
||||||
<li>{{user-stat value=model.likes_given label="user.summary.likes_given"}}</li>
|
<li>{{user-stat value=model.likes_given label="user.summary.likes_given"}}</li>
|
||||||
<li>{{user-stat value=model.bookmark_count label="user.summary.bookmark_count"}}</li>
|
{{#if model.bookmark_count}}
|
||||||
|
<li>{{user-stat value=model.bookmark_count label="user.summary.bookmark_count"}}</li>
|
||||||
|
{{/if}}
|
||||||
<li>{{user-stat value=model.topic_count label="user.summary.topic_count"}}</li>
|
<li>{{user-stat value=model.topic_count label="user.summary.topic_count"}}</li>
|
||||||
<li>{{user-stat value=model.post_count label="user.summary.post_count"}}</li>
|
<li>{{user-stat value=model.post_count label="user.summary.post_count"}}</li>
|
||||||
<li>{{user-stat value=model.likes_received label="user.summary.likes_received"}}</li>
|
<li>{{user-stat value=model.likes_received label="user.summary.likes_received"}}</li>
|
||||||
|
|
|
@ -136,6 +136,10 @@ class UserSummary
|
||||||
@user.featured_user_badges(MAX_BADGES)
|
@user.featured_user_badges(MAX_BADGES)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_id
|
||||||
|
@user.id
|
||||||
|
end
|
||||||
|
|
||||||
def user_stat
|
def user_stat
|
||||||
@user.user_stat
|
@user.user_stat
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,6 +43,10 @@ class UserSummarySerializer < ApplicationSerializer
|
||||||
SiteSetting.enable_badges
|
SiteSetting.enable_badges
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def include_bookmark_count?
|
||||||
|
scope.authenticated? && object.user_id == scope.user.id
|
||||||
|
end
|
||||||
|
|
||||||
def time_read
|
def time_read
|
||||||
AgeWords.age_words(object.time_read)
|
AgeWords.age_words(object.time_read)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue