discourse/app/assets/javascripts/admin/addon/controllers/admin-customize-themes.js
Osama Sayegh d4cbdf3ee0
FIX: Restore old admin themes/components page (#31887)
Follow-up to https://github.com/discourse/discourse/pull/30953

This PR is a partial revert of the linked PR — it changes the "Themes
and components" link in the admin sidebar back to the legacy
`/admin/customize/themes` page and adds the themes list/sidebar back to
the left hand side of the page. The new `/admin/config/customize/` route
is still available, but it's not linked from anywhere. When accessing
the new page and then navigating to a theme, the old components (e.g.
the themes list) of the page are hidden. This allows us to iterate on
the new page and improve until we're more ready to make it available
more widely.
2025-03-19 16:18:26 +03:00

24 lines
701 B
JavaScript
Vendored

import { tracked } from "@glimmer/tracking";
import Controller from "@ember/controller";
import discourseComputed from "discourse/lib/decorators";
import { THEMES } from "admin/models/theme";
export default class AdminCustomizeThemesController extends Controller {
@tracked fromNewConfigPage = false;
currentTab = THEMES;
@discourseComputed("model", "model.@each.component")
fullThemes(themes) {
return themes.filter((t) => !t.get("component"));
}
@discourseComputed("model", "model.@each.component")
childThemes(themes) {
return themes.filter((t) => t.get("component"));
}
@discourseComputed("model.content")
installedThemes(content) {
return content || [];
}
}