2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

FIX: Only enabled badges can be granted

FIX: Sort badges by displayName
This commit is contained in:
Gerhard Schlager 2015-09-24 01:20:44 +02:00
parent 4d6c99cb3d
commit 7d5e2d46c5
2 changed files with 9 additions and 6 deletions

View file

@ -56,12 +56,12 @@ export default Ember.ArrayController.extend({
var badges = [];
this.get('badges').forEach(function(badge) {
if (badge.get('multiple_grant') || !granted[badge.get('id')]) {
if (badge.get('enabled') && (badge.get('multiple_grant') || !granted[badge.get('id')])) {
badges.push(badge);
}
});
return _.sortBy(badges, "name");
return _.sortBy(badges, badge => badge.get('displayName'));
}.property('badges.@each', 'model.@each'),
/**