mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 03:29:31 +08:00
24 lines
763 B
JavaScript
24 lines
763 B
JavaScript
export default Ember.Route.extend({
|
|
serialize(model) {
|
|
return { theme_id: model.get("id") };
|
|
},
|
|
|
|
model(params) {
|
|
const all = this.modelFor("adminCustomizeThemes");
|
|
const model = all.findBy("id", parseInt(params.theme_id));
|
|
return model ? model : this.replaceWith("adminCustomizeTheme.index");
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
controller.set("model", model);
|
|
const parentController = this.controllerFor("adminCustomizeThemes");
|
|
parentController.set("editingTheme", false);
|
|
controller.set("allThemes", parentController.get("model"));
|
|
controller.set(
|
|
"colorSchemes",
|
|
parentController.get("model.extras.color_schemes")
|
|
);
|
|
controller.set("colorSchemeId", model.get("color_scheme_id"));
|
|
}
|
|
});
|