mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Site Setting to determine whether flags defaults to topics
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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}}
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user