mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 11:13:38 +08:00
FIX: Fix badge count of other users. (#6016)
Don't count the current user in "Others with this badge".
This commit is contained in:
parent
969e79d7c6
commit
cb86c5ae1e
|
@ -28,6 +28,11 @@ export default Ember.Controller.extend(BadgeSelectController, {
|
|||
return username ? userCount : modelCount;
|
||||
},
|
||||
|
||||
@computed("model.grant_count", "userBadges.grant_count")
|
||||
othersCount(modelCount, userCount) {
|
||||
return modelCount - userCount;
|
||||
},
|
||||
|
||||
@computed("model.allow_title", "model.has_badge", "model")
|
||||
canSelectTitle(hasTitleBadges, hasBadge) {
|
||||
return this.siteSettings.enable_badges && hasTitleBadges && hasBadge;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
{{#unless canLoadMore}}
|
||||
{{#if canShowOthers}}
|
||||
<div class='clearfix'>
|
||||
<a class='btn' href='{{model.url}}'>{{i18n 'badges.others_count' count=model.grant_count}}</a>
|
||||
<a class='btn' href='{{model.url}}'>{{i18n 'badges.others_count' count=othersCount}}</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user