2019-11-07 16:38:28 -05:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2020-03-06 11:41:41 -05:00
|
|
|
import Controller, { inject as controller } from "@ember/controller";
|
2018-05-16 09:37:40 -04:00
|
|
|
|
2019-10-23 13:06:54 -04:00
|
|
|
export default Controller.extend({
|
2020-03-06 11:41:41 -05:00
|
|
|
adminSiteSettings: controller(),
|
2013-11-14 12:37:41 -05:00
|
|
|
categoryNameKey: null,
|
|
|
|
|
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
|
|
|
});
|