FEATURE: clean up badges admin

This commit is contained in:
Sam 2014-07-30 08:56:46 +10:00
parent ebf385aedc
commit 5c72297695
4 changed files with 8 additions and 5 deletions

View File

@ -6,7 +6,10 @@
{{#each}}
<li>
<a {{action selectBadge this}} {{bind-attr class="selected:active"}}>
<span {{bind-attr class=":user-badge badgeTypeClassName" data-badge-name="name" title="displayDescription"}}>
<i {{bind-attr class=":fa icon"}}></i>
{{displayName}}
</span>
{{#if newBadge}}
<span class="list-badge">{{i18n filters.new.lower_title}}</span>
{{/if}}

View File

@ -1,10 +1,6 @@
export default Ember.Component.extend({
tagName: 'span',
badgeTypeClassName: function() {
return "badge-type-" + this.get('badge.badge_type.name').toLowerCase();
}.property('badge.badge_type.name'),
showGrantCount: function() {
return this.get('count') && this.get('count') > 1;
}.property('count'),

View File

@ -99,6 +99,10 @@ Discourse.Badge = Discourse.Model.extend({
}
},
badgeTypeClassName: function() {
return "badge-type-" + this.get('badge_type.name').toLowerCase();
}.property('badge_type.name'),
/**
Save and update the badge from the server's response.

View File

@ -1,5 +1,5 @@
{{#link-to 'badges.show' badge}}
<span {{bind-attr class=":user-badge badgeTypeClassName" data-badge-name="badge.name" title="badge.displayDescription"}}>
<span {{bind-attr class=":user-badge badge.badgeTypeClassName" data-badge-name="badge.name" title="badge.displayDescription"}}>
{{#if isIcon}}
<i {{bind-attr class=":fa badge.icon"}}></i>
{{else}}