Ghost-Admin/app/routes/settings/general.js

29 lines
804 B
JavaScript

import AuthenticatedRoute from 'ghost/routes/authenticated';
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
import styleBody from 'ghost/mixins/style-body';
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
titleToken: 'Settings - General',
classNames: ['settings-view-general'],
beforeModel() {
this._super(...arguments);
return this.get('session.user')
.then(this.transitionAuthor())
.then(this.transitionEditor());
},
model() {
return this.store.query('setting', {type: 'blog,theme,private'}).then((records) => {
return records.get('firstObject');
});
},
actions: {
save() {
this.get('controller').send('save');
}
}
});