mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:52:46 +08:00
Stop showing wrench for non admins on topics
This commit is contained in:
parent
75e8fa3ee0
commit
59c12ce35b
|
@ -11,6 +11,9 @@ export default DButton.extend({
|
||||||
top: position.top
|
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.appEvents.trigger("popup-menu:open", loc);
|
||||||
this.sendAction("action");
|
this.sendAction("action");
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@
|
||||||
{{#if loadedAllPosts}}
|
{{#if loadedAllPosts}}
|
||||||
|
|
||||||
{{view "topic-closing" topic=model}}
|
{{view "topic-closing" topic=model}}
|
||||||
{{show-popup-button action="showTopicAdminMenu" title="topic_admin_menu" icon="wrench" position="absolute"}}
|
|
||||||
{{view "topic-footer-buttons" topic=model}}
|
{{view "topic-footer-buttons" topic=model}}
|
||||||
|
|
||||||
{{#if model.pending_posts_count}}
|
{{#if model.pending_posts_count}}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import ReplyButton from 'discourse/views/reply-button';
|
||||||
import PinnedButton from 'discourse/components/pinned-button';
|
import PinnedButton from 'discourse/components/pinned-button';
|
||||||
import TopicNotificationsButton from 'discourse/components/topic-notifications-button';
|
import TopicNotificationsButton from 'discourse/components/topic-notifications-button';
|
||||||
import DiscourseContainerView from 'discourse/views/container';
|
import DiscourseContainerView from 'discourse/views/container';
|
||||||
|
import ShowPopupButton from 'discourse/components/show-popup-button';
|
||||||
|
|
||||||
const MainPanel = Discourse.ContainerView.extend({
|
const MainPanel = Discourse.ContainerView.extend({
|
||||||
elementId: 'topic-footer-main-buttons',
|
elementId: 'topic-footer-main-buttons',
|
||||||
|
@ -15,6 +16,11 @@ const MainPanel = Discourse.ContainerView.extend({
|
||||||
init() {
|
init() {
|
||||||
this._super();
|
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');
|
const topic = this.get('topic');
|
||||||
if (!topic.get('isPrivateMessage')) {
|
if (!topic.get('isPrivateMessage')) {
|
||||||
// We hide some controls from private messages
|
// We hide some controls from private messages
|
||||||
|
|
Loading…
Reference in New Issue
Block a user