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

19 lines
510 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();
2014-03-05 07:52:20 -05:00
},
setupController: function(controller, model) {
// TODO build into findAll
Discourse.ajax('/admin/badges/groupings').then(function(json) {
controller.set('badgeGroupings', json.badge_groupings);
});
2014-03-05 07:52:20 -05:00
Discourse.ajax('/admin/badges/types').then(function(json) {
controller.set('badgeTypes', json.badge_types);
});
controller.set('model', model);
}
});