diff --git a/app/assets/javascripts/admin/routes/admin-flags-index.js.es6 b/app/assets/javascripts/admin/routes/admin-flags-index.js.es6 index ae4a2e089d0..32b70b9d30b 100644 --- a/app/assets/javascripts/admin/routes/admin-flags-index.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-flags-index.js.es6 @@ -1,5 +1,6 @@ export default Discourse.Route.extend({ redirect() { - this.replaceWith('adminFlags.postsActive'); + let segment = this.siteSettings.flags_default_topics ? 'topics' : 'postsActive'; + this.replaceWith(`adminFlags.${segment}`); } }); diff --git a/app/assets/javascripts/admin/templates/flags.hbs b/app/assets/javascripts/admin/templates/flags.hbs index e24c12d8ec3..d13ad994bca 100644 --- a/app/assets/javascripts/admin/templates/flags.hbs +++ b/app/assets/javascripts/admin/templates/flags.hbs @@ -1,6 +1,12 @@ {{#admin-nav}} - {{nav-item route='adminFlags.postsActive' label='admin.flags.active_posts'}} - {{nav-item route='adminFlags.topics' label='admin.flags.topics'}} + {{#if siteSettings.flags_default_topics}} + {{nav-item route='adminFlags.topics' label='admin.flags.topics'}} + {{nav-item route='adminFlags.postsActive' label='admin.flags.active_posts'}} + {{else}} + {{nav-item route='adminFlags.postsActive' label='admin.flags.active_posts'}} + {{nav-item route='adminFlags.topics' label='admin.flags.topics'}} + {{/if}} + {{nav-item route='adminFlags.postsOld' label='admin.flags.old_posts' class='right'}} {{/admin-nav}} diff --git a/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 b/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 index b5835b3c198..2058a4b8820 100644 --- a/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 @@ -39,16 +39,21 @@ export default createWidget('hamburger-menu', { }, adminLinks() { - const { currentUser } = this; + const { currentUser, siteSettings } = this; + let flagsPath = siteSettings.flags_default_topics ? 'topics' : 'active'; - const links = [{ route: 'admin', className: 'admin-link', icon: 'wrench', label: 'admin_title' }, - { href: '/admin/flags/active', - className: 'flagged-posts-link', - icon: 'flag', - label: 'flags_title', - badgeClass: 'flagged-posts', - badgeTitle: 'notifications.total_flagged', - badgeCount: 'site_flagged_posts_count' }]; + const links = [ + { route: 'admin', className: 'admin-link', icon: 'wrench', label: 'admin_title' }, + { + href: `/admin/flags/${flagsPath}`, + className: 'flagged-posts-link', + icon: 'flag', + label: 'flags_title', + badgeClass: 'flagged-posts', + badgeTitle: 'notifications.total_flagged', + badgeCount: 'site_flagged_posts_count' + } + ]; if (currentUser.show_queued_posts) { links.push({ route: 'queued-posts', diff --git a/app/views/pending_flags_mailer/notify.html.erb b/app/views/pending_flags_mailer/notify.html.erb index 63e6573f3e8..940fc6c6e64 100644 --- a/app/views/pending_flags_mailer/notify.html.erb +++ b/app/views/pending_flags_mailer/notify.html.erb @@ -1,6 +1,6 @@

<%= t 'flags_reminder.flags_were_submitted', count: @hours %> - <%= t 'flags_reminder.please_review' %> + <%= t 'flags_reminder.please_review' %>

diff --git a/app/views/pending_flags_mailer/notify.text.erb b/app/views/pending_flags_mailer/notify.text.erb index c4564fddc02..ca10b097b4e 100644 --- a/app/views/pending_flags_mailer/notify.text.erb +++ b/app/views/pending_flags_mailer/notify.text.erb @@ -1,6 +1,6 @@ <%=t 'flags_reminder.flags_were_submitted', count: @hours %> <%=t 'flags_reminder.please_review' %> -<%= Discourse.base_url + '/admin/flags/active' %> +<%= Discourse.base_url + '/admin/flags' %> <% @posts.each do |post| %> - <%= post[:title] %>: <%=t 'flags_reminder.post_number' %> <%= post[:post_number] %> - <%= post[:reason_counts] %> diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 0b3f9fb35ff..9190d273d70 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1358,6 +1358,7 @@ en: auto_block_fast_typers_on_first_post: "Automatically block users that do not meet min_first_post_typing_time" auto_block_fast_typers_max_trust_level: "Maximum trust level to auto block fast typers" auto_block_first_post_regex: "Case insensitive regex that if passed will cause first post by user to be blocked and sent to approval queue. Example: raging|a[bc]a , will cause all posts containing raging or aba or aca to be blocked on first. Only applies to first post." + flags_default_topics: "Show flagged topics by default in the admin section" reply_by_email_enabled: "Enable replying to topics via email." reply_by_email_address: "Template for reply by email incoming email address, for example: %{reply_key}@reply.example.com or replies+%{reply_key}@example.com" diff --git a/config/site_settings.yml b/config/site_settings.yml index 3e42c07db8c..e4e8c3adee4 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -997,6 +997,9 @@ spam: auto_block_fast_typers_on_first_post: true auto_block_fast_typers_max_trust_level: 0 auto_block_first_post_regex: "" + flags_default_topics: + default: false + client: true rate_limits: unique_posts_mins: 5