FIX: Impersonate was hidden when navigating to user details page in admin from list.
This commit is contained in:
parent
4db8204a15
commit
cb6774a895
|
@ -216,6 +216,17 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
loadDetails: function() {
|
||||
var model = this;
|
||||
if (model.get('loadedDetails')) { return; }
|
||||
|
||||
Discourse.AdminUser.find(model.get('username_lower')).then(function (result) {
|
||||
console.log("loaded details");
|
||||
model.setProperties(result);
|
||||
model.set('loadedDetails', true);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -243,6 +254,7 @@ Discourse.AdminUser.reopenClass({
|
|||
|
||||
find: function(username) {
|
||||
return Discourse.ajax("/admin/users/" + username).then(function (result) {
|
||||
result.loadedDetails = true;
|
||||
return Discourse.AdminUser.create(result);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminUserRoute = Discourse.Route.extend({
|
||||
Discourse.AdminUserRoute = Discourse.Route.extend(Discourse.ModelReady, {
|
||||
|
||||
serialize: function(params) {
|
||||
return { username: Em.get(params, 'username').toLowerCase() };
|
||||
|
@ -18,6 +18,11 @@ Discourse.AdminUserRoute = Discourse.Route.extend({
|
|||
|
||||
renderTemplate: function() {
|
||||
this.render({into: 'admin/templates/admin'});
|
||||
},
|
||||
|
||||
modelReady: function(controller, adminUser) {
|
||||
adminUser.loadDetails();
|
||||
controller.set('model', adminUser);
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue