discourse/app/assets/javascripts/admin/routes/admin_badges_route.js

19 lines
459 B
JavaScript
Raw Normal View History

2014-03-05 07:52:20 -05:00
Discourse.AdminBadgesRoute = Discourse.Route.extend({
model: function() {
return Discourse.Badge.findAll().then(function(badges) {
return badges.filter(function(badge) {
return badge.id >= 100;
});
});
2014-03-05 07:52:20 -05:00
},
setupController: function(controller, model) {
Discourse.ajax('/admin/badges/types').then(function(json) {
controller.set('badgeTypes', json.badge_types);
});
controller.set('model', model);
}
});