From dbd2d29abe6d345df7fcba1add487a1ccff309c7 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 3 Jan 2018 13:33:39 -0500 Subject: [PATCH] Allow the deleted post indicator on a post to be extended. --- .../discourse/widgets/actions-summary.js.es6 | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/actions-summary.js.es6 b/app/assets/javascripts/discourse/widgets/actions-summary.js.es6 index c784fea47a5..ec6f389fef5 100644 --- a/app/assets/javascripts/discourse/widgets/actions-summary.js.es6 +++ b/app/assets/javascripts/discourse/widgets/actions-summary.js.es6 @@ -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;