This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/topic-footer-buttons.js.es6
Robin Ward 1643ff0f3c
FEATURE: Move topic admin button into timeline
Also includes converting the topic admin menu to the widget framework.
2016-05-31 10:51:46 -04:00

24 lines
685 B
JavaScript

import ContainerView from 'discourse/views/container';
export default ContainerView.extend({
elementId: 'topic-footer-buttons',
init() {
this._super();
if (this.currentUser) {
const viewArgs = this.getProperties('topic', 'topicDelegated');
viewArgs.currentUser = this.currentUser;
this.attachViewWithArgs(viewArgs, 'topic-footer-main-buttons');
this.attachViewWithArgs(viewArgs, 'pinned-button');
this.attachViewWithArgs(viewArgs, 'topic-notifications-button');
this.trigger('additionalButtons', this);
} else {
// If not logged in give them a login control
this.attachViewClass('login-reply-button');
}
}
});