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) {
|
find: function(username) {
|
||||||
return Discourse.ajax("/admin/users/" + username).then(function (result) {
|
return Discourse.ajax("/admin/users/" + username).then(function (result) {
|
||||||
|
result.loadedDetails = true;
|
||||||
return Discourse.AdminUser.create(result);
|
return Discourse.AdminUser.create(result);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
@namespace Discourse
|
@namespace Discourse
|
||||||
@module Discourse
|
@module Discourse
|
||||||
**/
|
**/
|
||||||
Discourse.AdminUserRoute = Discourse.Route.extend({
|
Discourse.AdminUserRoute = Discourse.Route.extend(Discourse.ModelReady, {
|
||||||
|
|
||||||
serialize: function(params) {
|
serialize: function(params) {
|
||||||
return { username: Em.get(params, 'username').toLowerCase() };
|
return { username: Em.get(params, 'username').toLowerCase() };
|
||||||
|
@ -18,6 +18,11 @@ Discourse.AdminUserRoute = Discourse.Route.extend({
|
||||||
|
|
||||||
renderTemplate: function() {
|
renderTemplate: function() {
|
||||||
this.render({into: 'admin/templates/admin'});
|
this.render({into: 'admin/templates/admin'});
|
||||||
|
},
|
||||||
|
|
||||||
|
modelReady: function(controller, adminUser) {
|
||||||
|
adminUser.loadDetails();
|
||||||
|
controller.set('model', adminUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue