Allow the deleted post indicator on a post to be extended.

This commit is contained in:
Robin Ward 2018-01-03 13:33:39 -05:00
parent e3965b4492
commit dbd2d29abe
1 changed files with 18 additions and 10 deletions

View File

@ -119,6 +119,23 @@ createWidget('actions-summary-item', {
}
});
createWidget('deleted-post', {
tagName: 'div.post-action',
html(attrs) {
return [
iconNode('trash-o'),
' ',
avatarFor.call(this, 'small', {
template: attrs.deletedByAvatarTemplate,
username: attrs.deletedByUsername
}),
' ',
dateNode(attrs.deleted_at)
];
}
});
export default createWidget('actions-summary', {
tagName: 'section.post-actions',
@ -131,16 +148,7 @@ export default createWidget('actions-summary', {
});
if (attrs.deleted_at) {
body.push(h('div.post-action', [
iconNode('trash-o'),
' ',
avatarFor.call(this, 'small', {
template: attrs.deletedByAvatarTemplate,
username: attrs.deletedByUsername
}),
' ',
dateNode(attrs.deleted_at)
]));
body.push(this.attach('deleted-post', attrs));
}
return body;