mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 01:04:55 +08:00
This commit removes the color palette dropdown from the theme page and replaces it with a new "Colors" tab where the theme's color palette can be edited directly in that tab on the theme page. With this change, a theme's color palette is strongly tied to its theme and can't be linked to other themes and it can't be selected by users without using the theme as well. All of the changes are behind a feature flag. To enable it, turn on the `use_overhauled_theme_color_palette` setting. Co-authored-by: Ella <ella.estigoy@gmail.com>
32 lines
829 B
JavaScript
Vendored
32 lines
829 B
JavaScript
Vendored
import { service } from "@ember/service";
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default class AdminCustomizeThemesShowRoute extends DiscourseRoute {
|
|
@service router;
|
|
|
|
serialize(model) {
|
|
return { theme_id: model.get("id") };
|
|
}
|
|
|
|
model(params) {
|
|
const all = this.modelFor("adminCustomizeThemes");
|
|
const model = all.findBy("id", parseInt(params.theme_id, 10));
|
|
if (model) {
|
|
return model;
|
|
} else {
|
|
this.router.replaceWith("adminCustomizeThemes.index");
|
|
}
|
|
}
|
|
|
|
setupController(controller) {
|
|
super.setupController(...arguments);
|
|
|
|
const parentController = this.controllerFor("adminCustomizeThemes");
|
|
controller.set("allThemes", parentController.get("model"));
|
|
}
|
|
|
|
titleToken() {
|
|
const model = this.controller.model;
|
|
return model.name;
|
|
}
|
|
}
|