mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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;
|
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")
|
@computed("model.allow_title", "model.has_badge", "model")
|
||||||
canSelectTitle(hasTitleBadges, hasBadge) {
|
canSelectTitle(hasTitleBadges, hasBadge) {
|
||||||
return this.siteSettings.enable_badges && hasTitleBadges && hasBadge;
|
return this.siteSettings.enable_badges && hasTitleBadges && hasBadge;
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
{{#unless canLoadMore}}
|
{{#unless canLoadMore}}
|
||||||
{{#if canShowOthers}}
|
{{#if canShowOthers}}
|
||||||
<div class='clearfix'>
|
<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>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
Loading…
Reference in New Issue
Block a user