diff --git a/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 b/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 index 864e5777410..cdd21a61510 100644 --- a/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences/categories.js.es6 @@ -20,12 +20,12 @@ export default Ember.Controller.extend(PreferencesTabController, { return [].concat(watched, watchedFirst, tracked, muted).filter(t => t); }, - canSave: function() { - return ( - this.get("currentUser.id") === this.get("model.id") || - this.get("currentUser.admin") - ); - }.property(), + @computed + canSee() { + return this.get("currentUser.id") === this.get("model.id"); + }, + + canSave: Ember.computed.or("canSee", "currentUser.admin"), actions: { save() { diff --git a/app/assets/javascripts/discourse/templates/preferences/categories.hbs b/app/assets/javascripts/discourse/templates/preferences/categories.hbs index fa29ec5cd11..6c9740c231c 100644 --- a/app/assets/javascripts/discourse/templates/preferences/categories.hbs +++ b/app/assets/javascripts/discourse/templates/preferences/categories.hbs @@ -6,18 +6,22 @@ {{category-selector categories=model.watchedCategories blacklist=selectedCategories}}
{{i18n 'user.watched_categories_instructions'}}
-
- {{i18n 'user.watched_topics_link'}} -
+ {{#if canSee}} +
+ {{i18n 'user.watched_topics_link'}} +
+ {{/if}}
{{category-selector categories=model.trackedCategories blacklist=selectedCategories}}
{{i18n 'user.tracked_categories_instructions'}}
-
- {{i18n 'user.tracked_topics_link'}} -
+ {{#if canSee}} +
+ {{i18n 'user.tracked_topics_link'}} +
+ {{/if}}
@@ -30,10 +34,11 @@ {{category-selector categories=model.mutedCategories blacklist=selectedCategories}}
{{i18n 'user.muted_categories_instructions'}}
-
- {{i18n 'user.muted_topics_link'}} -
- + {{#if canSee}} +
+ {{i18n 'user.muted_topics_link'}} +
+ {{/if}} {{plugin-outlet name="user-preferences-categories" args=(hash model=model save=(action "save"))}}