2013-02-22 15:41:12 -05:00
|
|
|
/**
|
|
|
|
Handles routes related to users in the admin section.
|
2013-02-20 13:15:50 -05:00
|
|
|
|
2013-05-07 13:30:12 -04:00
|
|
|
@class AdminUserRoute
|
2013-02-22 15:41:12 -05:00
|
|
|
@extends Discourse.Route
|
|
|
|
@namespace Discourse
|
|
|
|
@module Discourse
|
|
|
|
**/
|
2013-06-13 13:46:50 -04:00
|
|
|
Discourse.AdminUserRoute = Discourse.Route.extend(Discourse.ModelReady, {
|
2013-06-05 12:40:06 -04:00
|
|
|
|
2013-05-07 13:30:12 -04:00
|
|
|
serialize: function(params) {
|
|
|
|
return { username: Em.get(params, 'username').toLowerCase() };
|
|
|
|
},
|
|
|
|
|
2013-06-05 12:40:06 -04:00
|
|
|
model: function(params) {
|
|
|
|
return Discourse.AdminUser.find(Em.get(params, 'username').toLowerCase());
|
2013-05-14 12:03:15 -04:00
|
|
|
},
|
|
|
|
|
2013-06-05 12:40:06 -04:00
|
|
|
renderTemplate: function() {
|
2013-06-03 16:12:24 -04:00
|
|
|
this.render({into: 'admin/templates/admin'});
|
2013-06-13 13:46:50 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
modelReady: function(controller, adminUser) {
|
|
|
|
adminUser.loadDetails();
|
|
|
|
controller.set('model', adminUser);
|
2013-05-14 12:49:15 -04:00
|
|
|
}
|
2013-05-14 12:03:15 -04:00
|
|
|
|
2013-02-22 15:41:12 -05:00
|
|
|
});
|