mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 17:55:45 +08:00
FIX: Linking to users on admin dashboard was broken
This commit is contained in:
parent
b9a5a0460d
commit
6237a155e7
app/assets/javascripts/admin/routes
@ -23,9 +23,19 @@ Discourse.AdminDashboardRoute = Discourse.Route.extend({
|
|||||||
_.each(d.reports,function(report){
|
_.each(d.reports,function(report){
|
||||||
c.set(report.type, Discourse.Report.create(report));
|
c.set(report.type, Discourse.Report.create(report));
|
||||||
});
|
});
|
||||||
_.each(['admins', 'moderators', 'blocked', 'banned', 'top_referrers', 'top_traffic_sources', 'top_referred_topics'], function(x) {
|
|
||||||
|
var topReferrers = d.top_referrers;
|
||||||
|
if (topReferrers && topReferrers.data) {
|
||||||
|
d.top_referrers.data = topReferrers.data.map(function (user) {
|
||||||
|
return Discourse.AdminUser.create(user);
|
||||||
|
});
|
||||||
|
c.set('top_referrers', topReferrers);
|
||||||
|
}
|
||||||
|
|
||||||
|
['admins', 'moderators', 'blocked', 'banned', 'top_traffic_sources', 'top_referred_topics'].forEach(function(x) {
|
||||||
c.set(x, d[x]);
|
c.set(x, d[x]);
|
||||||
});
|
});
|
||||||
|
|
||||||
c.set('loading', false);
|
c.set('loading', false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,8 @@ Discourse.AdminUserRoute = Discourse.Route.extend({
|
|||||||
adminUser.loadDetails().then(function () {
|
adminUser.loadDetails().then(function () {
|
||||||
adminUser.setOriginalTrustLevel();
|
adminUser.setOriginalTrustLevel();
|
||||||
controller.set('model', adminUser);
|
controller.set('model', adminUser);
|
||||||
|
window.scrollTo(0, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user