2019-10-24 01:06:54 +08:00
|
|
|
import Controller from "@ember/controller";
|
2019-11-08 05:38:28 +08:00
|
|
|
import { default as discourseComputed } from "discourse-common/utils/decorators";
|
2018-08-31 03:23:15 +08:00
|
|
|
import { THEMES } from "admin/models/theme";
|
2017-04-18 03:56:13 +08:00
|
|
|
|
2019-10-24 01:06:54 +08:00
|
|
|
export default Controller.extend({
|
2018-08-31 03:23:15 +08:00
|
|
|
currentTab: THEMES,
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("model", "model.@each.component")
|
2018-08-24 09:30:00 +08:00
|
|
|
fullThemes(themes) {
|
2018-08-31 03:23:15 +08:00
|
|
|
return themes.filter(t => !t.get("component"));
|
2018-08-24 09:30:00 +08:00
|
|
|
},
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("model", "model.@each.component")
|
2018-08-24 09:30:00 +08:00
|
|
|
childThemes(themes) {
|
|
|
|
return themes.filter(t => t.get("component"));
|
2019-02-21 03:58:31 +08:00
|
|
|
},
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("model", "model.@each.component")
|
2019-02-21 03:58:31 +08:00
|
|
|
installedThemes(themes) {
|
|
|
|
return themes.map(t => t.name);
|
2017-04-18 03:56:13 +08:00
|
|
|
}
|
|
|
|
});
|