mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Impersonate was hidden when navigating to user details page in admin from list.
This commit is contained in:
parent
4db8204a15
commit
cb6774a895
2 changed files with 18 additions and 1 deletions
|
@ -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 a new issue