2017-04-12 22:52:52 +08:00
|
|
|
export default Ember.Route.extend({
|
|
|
|
serialize(model) {
|
2018-06-15 23:03:24 +08:00
|
|
|
return { theme_id: model.get("id") };
|
2017-04-12 22:52:52 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
model(params) {
|
2018-06-15 23:03:24 +08:00
|
|
|
const all = this.modelFor("adminCustomizeThemes");
|
|
|
|
const model = all.findBy("id", parseInt(params.theme_id));
|
|
|
|
return model ? model : this.replaceWith("adminCustomizeTheme.index");
|
2017-04-12 22:52:52 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
controller.set("model", model);
|
|
|
|
const parentController = this.controllerFor("adminCustomizeThemes");
|
|
|
|
parentController.set("editingTheme", false);
|
|
|
|
controller.set("allThemes", parentController.get("model"));
|
2018-06-15 23:03:24 +08:00
|
|
|
controller.set(
|
|
|
|
"colorSchemes",
|
|
|
|
parentController.get("model.extras.color_schemes")
|
|
|
|
);
|
2017-04-12 22:52:52 +08:00
|
|
|
controller.set("colorSchemeId", model.get("color_scheme_id"));
|
|
|
|
}
|
|
|
|
});
|