mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +03:00
679dc3c0d6
* Separated theme and design settings
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
|
import RSVP from 'rsvp';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default AuthenticatedRoute.extend(CurrentUserSettings, {
|
|
settings: service(),
|
|
|
|
beforeModel() {
|
|
this._super(...arguments);
|
|
return this.get('session.user')
|
|
.then(this.transitionAuthor());
|
|
},
|
|
|
|
model() {
|
|
return RSVP.hash({
|
|
settings: this.settings.reload(),
|
|
themes: this.store.findAll('theme')
|
|
});
|
|
},
|
|
|
|
setupController(controller) {
|
|
controller.set('themes', this.store.peekAll('theme'));
|
|
this.controller.send('reset');
|
|
},
|
|
|
|
deactivate() {
|
|
this._super(...arguments);
|
|
this.controller.set('leaveSettingsTransition', null);
|
|
this.controller.set('showLeaveSettingsModal', false);
|
|
},
|
|
|
|
actions: {
|
|
activateTheme(theme) {
|
|
return this.controller.send('activateTheme', theme);
|
|
}
|
|
},
|
|
|
|
buildRouteInfoMetadata() {
|
|
return {
|
|
titleToken: 'Settings - Theme'
|
|
};
|
|
}
|
|
});
|