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/views/topic-footer-buttons.js.es6

25 lines
771 B
JavaScript

import ContainerView from 'discourse/views/container';
import { on } from 'ember-addons/ember-computed-decorators';
export default ContainerView.extend({
elementId: 'topic-footer-buttons',
@on('init')
createButtons() {
const topic = this.get('topic');
const currentUser = this.get('controller.currentUser');
if (currentUser) {
const viewArgs = { topic, 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');
}
}
});