FIX: Filter badges to user on their badges page too
This commit is contained in:
parent
bf322281e3
commit
60693240e1
|
@ -5,9 +5,11 @@ export default Ember.Component.extend({
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
classNameBindings: [':badge-card', 'size', 'badge.slug'],
|
classNameBindings: [':badge-card', 'size', 'badge.slug'],
|
||||||
|
|
||||||
@computed('badge.url', 'badge.has_badge')
|
@computed('badge.url', 'filterUser')
|
||||||
url(url, hasBadge) {
|
url(badgeUrl, filterUser) {
|
||||||
return hasBadge ? `${url}?username=${this.currentUser.get('username_lower')}` : url;
|
return (filterUser) ?
|
||||||
|
`${badgeUrl}?username=${this.currentUser.get('username_lower')}` :
|
||||||
|
badgeUrl;
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed('count', 'badge.grant_count')
|
@computed('count', 'badge.grant_count')
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#each bg.badges as |b|}}
|
{{#each bg.badges as |b|}}
|
||||||
{{badge-card badge=b}}
|
{{badge-card badge=b filterUser=b.has_badge}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{#d-section pageClass="user-badges" class="user-content user-badges-list"}}
|
{{#d-section pageClass="user-badges" class="user-content user-badges-list"}}
|
||||||
{{#each sortedBadges as |ub|}}
|
{{#each sortedBadges as |ub|}}
|
||||||
{{badge-card badge=ub.badge count=ub.count username=username}}
|
{{badge-card badge=ub.badge count=ub.count username=username filterUser="true"}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/d-section}}
|
{{/d-section}}
|
||||||
|
|
Loading…
Reference in New Issue