FIX: admin user page for suspended user was busted

This commit is contained in:
Neil Lalonde 2014-03-24 10:19:15 -04:00
parent 6715786630
commit e823558742
2 changed files with 10 additions and 3 deletions

View File

@ -355,7 +355,13 @@ Discourse.AdminUser = Discourse.User.extend({
if (this.get('leader_requirements')) { if (this.get('leader_requirements')) {
return Discourse.LeaderRequirements.create(this.get('leader_requirements')); return Discourse.LeaderRequirements.create(this.get('leader_requirements'));
} }
}.property('leader_requirements') }.property('leader_requirements'),
suspendedBy: function() {
if (this.get('suspended_by')) {
return Discourse.User.create(this.get('suspended_by'));
}
}.property('suspended_by')
}); });

View File

@ -260,8 +260,9 @@
<div class='display-row highlight-danger'> <div class='display-row highlight-danger'>
<div class='field'>{{i18n admin.user.suspended_by}}</div> <div class='field'>{{i18n admin.user.suspended_by}}</div>
<div class='value'> <div class='value'>
{{#link-to 'adminUser' suspended_by}}{{avatar suspended_by imageSize="tiny"}}{{/link-to}} <!-- TODO: Why don't these links work? -->
{{#link-to 'adminUser' suspended_by}}{{suspended_by.username}}{{/link-to}} {{#link-to 'adminUser' suspendedBy}}{{avatar suspendedBy imageSize="tiny"}}{{/link-to}}
{{#link-to 'adminUser' suspendedBy}}{{suspendedBy.username}}{{/link-to}}
</div> </div>
<div class='controls'> <div class='controls'>
<b>{{i18n admin.user.suspend_reason}}</b>: <b>{{i18n admin.user.suspend_reason}}</b>: