2015-08-11 12:27:07 -04:00
|
|
|
export default Ember.Controller.extend({
|
2013-11-14 12:37:41 -05:00
|
|
|
categoryNameKey: null,
|
|
|
|
needs: ['adminSiteSettings'],
|
|
|
|
|
|
|
|
filteredContent: function() {
|
2014-11-26 18:01:45 -05:00
|
|
|
if (!this.get('categoryNameKey')) { return []; }
|
2013-11-14 12:37:41 -05:00
|
|
|
|
2015-03-02 12:12:19 -05:00
|
|
|
const category = this.get('controllers.adminSiteSettings.content').findProperty('nameKey', this.get('categoryNameKey'));
|
2013-11-14 12:37:41 -05:00
|
|
|
if (category) {
|
|
|
|
return category.siteSettings;
|
|
|
|
} else {
|
2014-11-26 18:01:45 -05:00
|
|
|
return [];
|
2013-11-14 12:37:41 -05:00
|
|
|
}
|
2015-03-02 12:12:19 -05:00
|
|
|
}.property('controllers.adminSiteSettings.content', 'categoryNameKey')
|
2013-11-14 12:37:41 -05:00
|
|
|
|
|
|
|
});
|