How to move topic-notifications-button and invite-reply-button from footer?


(Steven Slade) #1

There are two special buttons in discourse/app/assets/javascripts/discourse/views/topic-footer-buttons.js.es6: topic-notifications-button and invite-reply-button.

I am exploring the possibility of moving these buttons to an area in the first post, probably a widget attached to the post or the post-menu. I am struggling though with how to do this.

One thought I had was to get extend or reopen the ContainerView in my plugin:

const ContainerView = api.container.lookupFactory('view:container');
  ContainerView.reopen({
  //code in here that would at least recreate putting these buttons on the page

However, I can’t 1) Even recreate the logic in my plugin to show these buttons elsewhere and 2) think how to move the logic else where.

Does anyone have any suggestions?


(Steven Slade) #2

It seems as invite-reply-button should be an easy one to create. I will simply add the showInvite action to the button I create.

The more complicated issue is certainly the topic-notifications-button. Unlike the other buttons, it is a component, not a view. Is this an advantage? In Handlebars it would be easy to call the component in the template, how is this done in a widget with virtual-dom?

EDIT: api.container.lookupFactory("component:" + "topic-notifications-button"); …this is about all I have so far. A possible way to get the component I need, but how to included in vdom widget?