diff --git a/app/assets/javascripts/discourse/components/category_group_component.js b/app/assets/javascripts/discourse/components/category_group_component.js index 40ea90878..9fae6cc23 100644 --- a/app/assets/javascripts/discourse/components/category_group_component.js +++ b/app/assets/javascripts/discourse/components/category_group_component.js @@ -11,7 +11,8 @@ Discourse.CategoryGroupComponent = Ember.Component.extend({ return Discourse.Category.list().filter(function(category){ var regex = new RegExp(term, "i"); return category.get("name").match(regex) && - !_.contains(self.get('categories'), category); + !_.contains(self.get('blacklist') || [], category) && + !_.contains(self.get('categories'), category) ; }); }, onChangeItems: function(items) { diff --git a/app/assets/javascripts/discourse/controllers/preferences_controller.js b/app/assets/javascripts/discourse/controllers/preferences_controller.js index fa800b0a1..c5f6c1430 100644 --- a/app/assets/javascripts/discourse/controllers/preferences_controller.js +++ b/app/assets/javascripts/discourse/controllers/preferences_controller.js @@ -15,6 +15,10 @@ Discourse.PreferencesController = Discourse.ObjectController.extend({ return Discourse.SiteSettings.allow_user_locale; }.property(), + selectedCategories: function(){ + return [].concat(this.get("watchedCategories"), this.get("trackedCategories"), this.get("mutedCategories")); + }.property("watchedCategories", "trackedCategories", "mutedCategories"), + // By default we haven't saved anything saved: false, diff --git a/app/assets/javascripts/discourse/templates/user/preferences.js.handlebars b/app/assets/javascripts/discourse/templates/user/preferences.js.handlebars index d87c2f7c9..be9d804b6 100644 --- a/app/assets/javascripts/discourse/templates/user/preferences.js.handlebars +++ b/app/assets/javascripts/discourse/templates/user/preferences.js.handlebars @@ -187,17 +187,17 @@
- {{category-group categories=watchedCategories}} + {{category-group categories=watchedCategories blacklist=selectedCategories}}
{{i18n user.watched_categories_instructions}}
- {{category-group categories=trackedCategories}} + {{category-group categories=trackedCategories blacklist=selectedCategories}}
{{i18n user.tracked_categories_instructions}}
- {{category-group categories=mutedCategories}} + {{category-group categories=mutedCategories blacklist=selectedCategories}}
{{i18n user.muted_categories_instructions}}