diff --git a/app/assets/javascripts/admin/controllers/admin_controller.js b/app/assets/javascripts/admin/controllers/admin_controller.js index 9bb77a9aae3..c78b14ee06f 100644 --- a/app/assets/javascripts/admin/controllers/admin_controller.js +++ b/app/assets/javascripts/admin/controllers/admin_controller.js @@ -6,4 +6,8 @@ @namespace 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() +}); diff --git a/app/assets/javascripts/admin/templates/admin.js.handlebars b/app/assets/javascripts/admin/templates/admin.js.handlebars index 43f18b5e2c1..930c697b605 100644 --- a/app/assets/javascripts/admin/templates/admin.js.handlebars +++ b/app/assets/javascripts/admin/templates/admin.js.handlebars @@ -14,6 +14,9 @@
  • {{#link-to 'adminSiteContents'}}{{i18n admin.site_content.title}}{{/link-to}}
  • {{/if}}
  • {{#link-to 'adminUsersList'}}{{i18n admin.users.title}}{{/link-to}}
  • + {{#if showBadges}} +
  • {{#link-to 'admin.badges'}}{{i18n admin.badges.title}}{{/link-to}}
  • + {{/if}} {{#if currentUser.admin}}
  • {{#link-to 'admin.groups'}}{{i18n admin.groups.title}}{{/link-to}}
  • {{/if}} @@ -24,7 +27,6 @@
  • {{#link-to 'admin.customize'}}{{i18n admin.customize.title}}{{/link-to}}
  • {{#link-to 'admin.api'}}{{i18n admin.api.title}}{{/link-to}}
  • {{#link-to 'admin.backups'}}{{i18n admin.backups.title}}{{/link-to}}
  • -
  • {{#link-to 'admin.badges'}}{{i18n admin.badges.title}}{{/link-to}}
  • {{/if}}