diff --git a/app/assets/javascripts/discourse/controllers/discovery/categories.js.es6 b/app/assets/javascripts/discourse/controllers/discovery/categories.js.es6 index 37078d492..ebda2c04a 100644 --- a/app/assets/javascripts/discourse/controllers/discovery/categories.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery/categories.js.es6 @@ -3,7 +3,7 @@ import DiscoveryController from 'discourse/controllers/discovery'; export default DiscoveryController.extend({ needs: ['modal', 'discovery'], - withLogo: Em.computed.filterBy('categories', 'logo_url'), + withLogo: Em.computed.filterBy('model.categories', 'logo_url'), showPostsColumn: Em.computed.empty('withLogo'), actions: { @@ -35,7 +35,7 @@ export default DiscoveryController.extend({ }.property(), latestTopicOnly: function() { - return this.get('categories').find(function(c) { return c.get('featuredTopics.length') > 1; }) === undefined; - }.property('categories.@each.featuredTopics.length') + return this.get('model.categories').find(function(c) { return c.get('featuredTopics.length') > 1; }) === undefined; + }.property('model.categories.@each.featuredTopics.length') }); diff --git a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 index 462f87439..15c8d66c2 100644 --- a/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 +++ b/app/assets/javascripts/discourse/controllers/discovery/topics.js.es6 @@ -14,6 +14,7 @@ var controllerOpts = { order: 'default', ascending: false, expandGloballyPinned: false, + expandAllPinned: false, actions: { @@ -86,12 +87,12 @@ var controllerOpts = { }, showDismissRead: function() { - return this.isFilterPage(this.get('filter'), 'unread') && this.get('topics.length') > 0; - }.property('filter', 'topics.length'), + return this.isFilterPage(this.get('model.filter'), 'unread') && this.get('model.topics.length') > 0; + }.property('model.filter', 'model.topics.length'), showResetNew: function() { - return this.get('filter') === 'new' && this.get('topics.length') > 0; - }.property('filter', 'topics.length'), + return this.get('model.filter') === 'new' && this.get('model.topics.length') > 0; + }.property('model.filter', 'model.topics.length'), showDismissAtTop: function() { return (this.isFilterPage(this.get('model.filter'), 'new') || @@ -117,7 +118,7 @@ var controllerOpts = { return I18n.t('topics.bottom.category', {category: category.get('name')}); } else { var split = (this.get('model.filter') || '').split('/'); - if (this.get('topics.length') === 0) { + if (this.get('model.topics.length') === 0) { return I18n.t("topics.none." + split[0], { category: split[1] }); @@ -127,19 +128,19 @@ var controllerOpts = { }); } } - }.property('allLoaded', 'topics.length'), + }.property('allLoaded', 'model.topics.length'), footerEducation: function() { - if (!this.get('allLoaded') || this.get('topics.length') > 0 || !Discourse.User.current()) { return; } + if (!this.get('allLoaded') || this.get('model.topics.length') > 0 || !Discourse.User.current()) { return; } - var split = (this.get('filter') || '').split('/'); + var split = (this.get('model.filter') || '').split('/'); if (split[0] !== 'new' && split[0] !== 'unread') { return; } return I18n.t("topics.none.educate." + split[0], { userPrefsUrl: Discourse.getURL("/users/") + (Discourse.User.currentProp("username_lower")) + "/preferences" }); - }.property('allLoaded', 'topics.length'), + }.property('allLoaded', 'model.topics.length'), loadMoreTopics() { return this.get('model').loadMore(); diff --git a/app/assets/javascripts/discourse/helpers/border-color.js.es6 b/app/assets/javascripts/discourse/helpers/border-color.js.es6 new file mode 100644 index 000000000..eda61b6ae --- /dev/null +++ b/app/assets/javascripts/discourse/helpers/border-color.js.es6 @@ -0,0 +1,4 @@ +export default Ember.Handlebars.makeBoundHelper(function(value) { + return ("border-color: #" + value).htmlSafe(); +}); + diff --git a/app/assets/javascripts/discourse/models/topic-list.js.es6 b/app/assets/javascripts/discourse/models/topic-list.js.es6 index c4d77f050..7f158b924 100644 --- a/app/assets/javascripts/discourse/models/topic-list.js.es6 +++ b/app/assets/javascripts/discourse/models/topic-list.js.es6 @@ -41,7 +41,7 @@ const TopicList = RestModel.extend({ refreshSort: function(order, ascending) { const self = this, - params = this.get('params'); + params = this.get('params') || {}; params.order = order || params.order; diff --git a/app/assets/javascripts/discourse/templates/discovery/categories.hbs b/app/assets/javascripts/discourse/templates/discovery/categories.hbs index 3fdfdafd9..0aa789da0 100644 --- a/app/assets/javascripts/discourse/templates/discovery/categories.hbs +++ b/app/assets/javascripts/discourse/templates/discovery/categories.hbs @@ -1,4 +1,4 @@ -{{#if categories}} +{{#if model.categories}}
@@ -9,9 +9,9 @@ - {{#each c in categories}} + {{#each c in model.categories}} -