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'>
|
<td class='user'>
|
||||||
{{#if flaggedPost.postAuthorFlagged}}
|
{{#if flaggedPost.postAuthorFlagged}}
|
||||||
{{#if flaggedPost.user}}
|
{{#if flaggedPost.user}}
|
||||||
{{#with flaggedPost}}
|
{{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="small"}}{{/link-to}}
|
||||||
{{#link-to 'adminUser' user}}
|
{{#if flaggedPost.wasEdited}}<i class="fa fa-pencil" title="{{i18n admin.flags.was_edited}}"></i>{{/if}}
|
||||||
{{avatar user imageSize="small"}}
|
|
||||||
{{/link-to}}
|
|
||||||
{{#if wasEdited}}
|
|
||||||
<i class="fa fa-pencil" title="{{i18n admin.flags.was_edited}}"></i>
|
|
||||||
{{/if}}
|
|
||||||
{{/with}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
export function renderAvatar(user, options) {
|
export function renderAvatar(user, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
if (typeof user === 'string') {
|
|
||||||
user = Ember.Handlebars.get(this, user, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user) {
|
if (user) {
|
||||||
var username = Em.get(user, 'username');
|
var username = Em.get(user, 'username');
|
||||||
if (!username) username = Em.get(user, options.usernamePath);
|
if (!username) username = Em.get(user, options.usernamePath);
|
||||||
|
@ -41,5 +37,8 @@ export function renderAvatar(user, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Handlebars.registerHelper('avatar', function(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));
|
return new Handlebars.SafeString(renderAvatar.call(this, user, options.hash));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue