Move badges admin tab to after users, show only if enabled.

This commit is contained in:
Vikhyat Korrapati 2014-03-19 09:48:04 +05:30
parent 4f71256542
commit a4461022a3
2 changed files with 8 additions and 2 deletions

View File

@ -6,4 +6,8 @@
@namespace Discourse @namespace Discourse
@module Discourse @module Discourse
**/ **/
Discourse.AdminController = Discourse.Controller.extend({}); Discourse.AdminController = Discourse.Controller.extend({
showBadges: function() {
return this.get('currentUser.admin') && Discourse.SiteSettings.enable_badges;
}.property()
});

View File

@ -14,6 +14,9 @@
<li>{{#link-to 'adminSiteContents'}}{{i18n admin.site_content.title}}{{/link-to}}</li> <li>{{#link-to 'adminSiteContents'}}{{i18n admin.site_content.title}}{{/link-to}}</li>
{{/if}} {{/if}}
<li>{{#link-to 'adminUsersList'}}{{i18n admin.users.title}}{{/link-to}}</li> <li>{{#link-to 'adminUsersList'}}{{i18n admin.users.title}}{{/link-to}}</li>
{{#if showBadges}}
<li>{{#link-to 'admin.badges'}}{{i18n admin.badges.title}}{{/link-to}}</li>
{{/if}}
{{#if currentUser.admin}} {{#if currentUser.admin}}
<li>{{#link-to 'admin.groups'}}{{i18n admin.groups.title}}{{/link-to}}</li> <li>{{#link-to 'admin.groups'}}{{i18n admin.groups.title}}{{/link-to}}</li>
{{/if}} {{/if}}
@ -24,7 +27,6 @@
<li>{{#link-to 'admin.customize'}}{{i18n admin.customize.title}}{{/link-to}}</li> <li>{{#link-to 'admin.customize'}}{{i18n admin.customize.title}}{{/link-to}}</li>
<li>{{#link-to 'admin.api'}}{{i18n admin.api.title}}{{/link-to}}</li> <li>{{#link-to 'admin.api'}}{{i18n admin.api.title}}{{/link-to}}</li>
<li>{{#link-to 'admin.backups'}}{{i18n admin.backups.title}}{{/link-to}}</li> <li>{{#link-to 'admin.backups'}}{{i18n admin.backups.title}}{{/link-to}}</li>
<li>{{#link-to 'admin.badges'}}{{i18n admin.badges.title}}{{/link-to}}</li>
{{/if}} {{/if}}
</ul> </ul>