2019-10-24 01:06:54 +08:00
|
|
|
import Controller from "@ember/controller";
|
2018-08-31 03:23:15 +08:00
|
|
|
import { THEMES } from "admin/models/theme";
|
2020-01-17 01:56:53 +08:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2017-04-18 03:56:13 +08:00
|
|
|
|
2023-03-15 17:42:12 +08:00
|
|
|
export default class AdminCustomizeThemesController extends Controller {
|
|
|
|
currentTab = THEMES;
|
2018-08-31 03:23:15 +08:00
|
|
|
|
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"));
|
2023-03-15 17:42:12 +08:00
|
|
|
}
|
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"));
|
2023-03-15 17:42:12 +08:00
|
|
|
}
|
2019-02-21 03:58:31 +08:00
|
|
|
|
2021-02-25 05:10:17 +08:00
|
|
|
@discourseComputed("model.content")
|
|
|
|
installedThemes(content) {
|
|
|
|
return content || [];
|
2023-03-15 17:42:12 +08:00
|
|
|
}
|
|
|
|
}
|