2019-11-07 16:38:28 -05:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2019-10-29 13:31:44 -04:00
|
|
|
import { inject } from "@ember/controller";
|
2019-10-23 13:06:54 -04:00
|
|
|
import Controller from "@ember/controller";
|
2018-05-16 09:37:40 -04:00
|
|
|
|
2019-10-23 13:06:54 -04:00
|
|
|
export default Controller.extend({
|
2013-11-14 12:37:41 -05:00
|
|
|
categoryNameKey: null,
|
2019-10-29 13:13:31 -04:00
|
|
|
adminSiteSettings: inject(),
|
2013-11-14 12:37:41 -05:00
|
|
|
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("adminSiteSettings.visibleSiteSettings", "categoryNameKey")
|
2018-05-16 09:37:40 -04:00
|
|
|
category(categories, nameKey) {
|
|
|
|
return (categories || []).findBy("nameKey", nameKey);
|
|
|
|
},
|
2013-11-14 12:37:41 -05:00
|
|
|
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("category")
|
2018-05-16 09:37:40 -04:00
|
|
|
filteredContent(category) {
|
|
|
|
return category ? category.siteSettings : [];
|
|
|
|
}
|
2013-11-14 12:37:41 -05:00
|
|
|
});
|