2024-03-05 19:24:29 -05:00
|
|
|
import Route from "@ember/routing/route";
|
|
|
|
|
|
|
|
export default class AdminCustomizeThemesShowSchemaRoute extends Route {
|
2024-07-05 16:25:42 -04:00
|
|
|
async model(params) {
|
2024-03-05 19:24:29 -05:00
|
|
|
const theme = this.modelFor("adminCustomizeThemesShow");
|
|
|
|
const setting = theme.settings.findBy("setting", params.setting_name);
|
|
|
|
|
2024-07-05 16:25:42 -04:00
|
|
|
await setting.loadMetadata(theme.id);
|
|
|
|
|
|
|
|
return {
|
|
|
|
theme,
|
|
|
|
setting,
|
|
|
|
};
|
2024-03-05 19:24:29 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
setupController() {
|
|
|
|
super.setupController(...arguments);
|
|
|
|
this.controllerFor("adminCustomizeThemes").set("editingTheme", true);
|
|
|
|
|
|
|
|
this.controllerFor("adminCustomizeThemes.show").set(
|
|
|
|
"editingThemeSetting",
|
|
|
|
true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
deactivate() {
|
|
|
|
this.controllerFor("adminCustomizeThemes").set("editingTheme", false);
|
|
|
|
|
|
|
|
this.controllerFor("adminCustomizeThemes.show").set(
|
|
|
|
"editingThemeSetting",
|
|
|
|
false
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|