FIX: Using a binding in an `{{avatar}}` was broken

This commit is contained in:
Robin Ward 2014-08-20 15:12:18 -04:00
parent 268ea0206e
commit d35633deab
2 changed files with 5 additions and 12 deletions

View File

@ -28,14 +28,8 @@
<td class='user'>
{{#if flaggedPost.postAuthorFlagged}}
{{#if flaggedPost.user}}
{{#with flaggedPost}}
{{#link-to 'adminUser' user}}
{{avatar user imageSize="small"}}
{{/link-to}}
{{#if wasEdited}}
<i class="fa fa-pencil" title="{{i18n admin.flags.was_edited}}"></i>
{{/if}}
{{/with}}
{{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="small"}}{{/link-to}}
{{#if flaggedPost.wasEdited}}<i class="fa fa-pencil" title="{{i18n admin.flags.was_edited}}"></i>{{/if}}
{{/if}}
{{/if}}
</td>

View File

@ -1,10 +1,6 @@
export function renderAvatar(user, options) {
options = options || {};
if (typeof user === 'string') {
user = Ember.Handlebars.get(this, user, options);
}
if (user) {
var username = Em.get(user, 'username');
if (!username) username = Em.get(user, options.usernamePath);
@ -41,5 +37,8 @@ export function renderAvatar(user, options) {
}
Handlebars.registerHelper('avatar', function(user, options) {
if (typeof user === 'string') {
user = Ember.Handlebars.get(this, user, options);
}
return new Handlebars.SafeString(renderAvatar.call(this, user, options.hash));
});