FIX: If you have a badge, filter to you when clicking on it

This commit is contained in:
Robin Ward 2017-05-03 13:34:18 -04:00
parent c8044c6956
commit b705634ee1
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +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')
url(url, hasBadge) {
return hasBadge ? `${url}?username=${this.currentUser.get('username_lower')}` : url;
},
@computed('count', 'badge.grant_count') @computed('count', 'badge.grant_count')
displayCount(count, grantCount) { displayCount(count, grantCount) {
if (count == null) { return grantCount; } if (count == null) { return grantCount; }

View File

@ -10,7 +10,7 @@
</div> </div>
<div class='badge-info'> <div class='badge-info'>
<div class='badge-info-item'> <div class='badge-info-item'>
<h3><a href={{badge.url}}>{{badge.name}}</a></h3> <h3><a href={{url}}>{{badge.name}}</a></h3>
<div class='badge-summary'>{{{summary}}}</div> <div class='badge-summary'>{{{summary}}}</div>
</div> </div>
</div> </div>