mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Stop showing wrench for non admins on topics
This commit is contained in:
parent
75e8fa3ee0
commit
59c12ce35b
3 changed files with 9 additions and 1 deletions
|
@ -11,6 +11,9 @@ export default DButton.extend({
|
|||
top: position.top
|
||||
};
|
||||
|
||||
// TODO views/topic-footer-buttons is instansiating this via attachViewWithArgs
|
||||
// attachViewWithArgs
|
||||
this.appEvents = this.appEvents || this.container.lookup('app-events:main');
|
||||
this.appEvents.trigger("popup-menu:open", loc);
|
||||
this.sendAction("action");
|
||||
}
|
||||
|
|
|
@ -86,7 +86,6 @@
|
|||
{{#if loadedAllPosts}}
|
||||
|
||||
{{view "topic-closing" topic=model}}
|
||||
{{show-popup-button action="showTopicAdminMenu" title="topic_admin_menu" icon="wrench" position="absolute"}}
|
||||
{{view "topic-footer-buttons" topic=model}}
|
||||
|
||||
{{#if model.pending_posts_count}}
|
||||
|
|
|
@ -7,6 +7,7 @@ import ReplyButton from 'discourse/views/reply-button';
|
|||
import PinnedButton from 'discourse/components/pinned-button';
|
||||
import TopicNotificationsButton from 'discourse/components/topic-notifications-button';
|
||||
import DiscourseContainerView from 'discourse/views/container';
|
||||
import ShowPopupButton from 'discourse/components/show-popup-button';
|
||||
|
||||
const MainPanel = Discourse.ContainerView.extend({
|
||||
elementId: 'topic-footer-main-buttons',
|
||||
|
@ -15,6 +16,11 @@ const MainPanel = Discourse.ContainerView.extend({
|
|||
init() {
|
||||
this._super();
|
||||
|
||||
if (Discourse.User.currentProp('staff')) {
|
||||
const viewArgs = {action: 'showTopicAdminMenu', title: 'topic_admin_menu', icon: 'wrench', position: 'absolute'};
|
||||
this.attachViewWithArgs(viewArgs, ShowPopupButton);
|
||||
}
|
||||
|
||||
const topic = this.get('topic');
|
||||
if (!topic.get('isPrivateMessage')) {
|
||||
// We hide some controls from private messages
|
||||
|
|
Loading…
Reference in a new issue