FIX: Edge case. Don't show "Others with this badge" when just you

This commit is contained in:
Robin Ward 2016-04-12 14:19:08 -04:00
parent 0396b14b70
commit fd2b8dd12f
No known key found for this signature in database
GPG Key ID: 0E091E2B4ED1B83D
2 changed files with 6 additions and 1 deletions

View File

@ -48,6 +48,11 @@ export default Ember.Controller.extend({
return grantCount > (userBadgeLength || 0);
},
@computed('user', 'model.grant_count')
canShowOthers(user, grantCount) {
return !!user && grantCount > 1;
},
@observes('canLoadMore')
_showFooter() {
this.set("controllers.application.showFooter", !this.get("canLoadMore"));

View File

@ -33,7 +33,7 @@
{{/load-more}}
{{#unless canLoadMore}}
{{#if user}}
{{#if canShowOthers}}
<div class='clearfix'>
<a class='btn' href='{{model.url}}'>{{i18n 'badges.others_count' count=model.grant_count}}</a>
</div>