FIX: Using a binding in an `{{avatar}}` was broken
This commit is contained in:
parent
268ea0206e
commit
d35633deab
|
@ -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>
|
||||
|
|
|
@ -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));
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue