This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/user-badge.js.es6
Sam ca3e2b4da3 FEATURE: you can not drill down and see why you have badges
Clicking on badges filters down the list to a particular user.
2016-01-18 17:59:20 +11:00

16 lines
478 B
JavaScript

export default Ember.Component.extend({
tagName: 'span',
showGrantCount: function() {
return this.get('count') && this.get('count') > 1;
}.property('count'),
badgeUrl: function(){
// NOTE: I tried using a link-to helper here but the queryParams mean it fails
var username = this.get('user.username_lower') || '';
username = username !== '' ? "?username=" + username : '';
return this.get('badge.url') + username;
}.property("badge", "user")
});