2021-09-14 21:32:07 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
2021-10-04 18:34:13 +03:00
|
|
|
export default class SettingsDesignRoute extends AuthenticatedRoute {
|
2021-09-14 21:32:07 +03:00
|
|
|
@service feature;
|
|
|
|
@service modals;
|
2021-09-16 22:26:49 +03:00
|
|
|
@service settings;
|
2021-10-11 17:24:46 +03:00
|
|
|
@service ui;
|
2021-09-14 21:32:07 +03:00
|
|
|
|
|
|
|
beforeModel() {
|
|
|
|
super.beforeModel(...arguments);
|
|
|
|
|
|
|
|
if (!this.session.user.isAdmin) {
|
|
|
|
return this.transitionTo('site');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.feature.customThemeSettings) {
|
|
|
|
return this.transitionTo('settings');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-04 18:34:13 +03:00
|
|
|
model() {
|
|
|
|
return this.settings.reload();
|
|
|
|
}
|
|
|
|
|
2021-09-14 21:32:07 +03:00
|
|
|
activate() {
|
2021-10-11 17:24:46 +03:00
|
|
|
this.ui.contextualNavMenu = 'design';
|
2021-09-14 21:32:07 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
deactivate() {
|
2021-10-11 17:24:46 +03:00
|
|
|
this.ui.contextualNavMenu = null;
|
2021-09-16 22:26:49 +03:00
|
|
|
}
|
|
|
|
|
2021-10-18 18:43:02 +03:00
|
|
|
buildRouteInfoMetadata() {
|
|
|
|
return {
|
|
|
|
mainClasses: ['gh-main-fullwidth']
|
|
|
|
};
|
|
|
|
}
|
2021-10-19 18:25:37 +03:00
|
|
|
}
|