2014-10-28 08:29:42 -06:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-07-25 00:52:17 -07:00
|
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
2014-09-23 13:04:49 +00:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2015-05-25 13:17:10 -05:00
|
|
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
|
|
|
titleToken: 'Settings - General',
|
2014-11-25 12:56:08 -08:00
|
|
|
|
2014-09-23 13:04:49 +00:00
|
|
|
classNames: ['settings-view-general'],
|
2014-07-25 00:52:17 -07:00
|
|
|
|
2015-06-17 00:24:01 +01:00
|
|
|
beforeModel: function (transition) {
|
|
|
|
this._super(transition);
|
2015-04-14 16:04:16 +01:00
|
|
|
return this.get('session.user')
|
2014-07-25 00:52:17 -07:00
|
|
|
.then(this.transitionAuthor())
|
|
|
|
.then(this.transitionEditor());
|
|
|
|
},
|
2014-03-20 21:55:32 -05:00
|
|
|
|
|
|
|
model: function () {
|
2015-08-24 12:43:26 +01:00
|
|
|
return this.store.find('setting', {type: 'blog,theme,private'}).then(function (records) {
|
2014-06-20 02:29:49 +00:00
|
|
|
return records.get('firstObject');
|
2014-03-20 21:55:32 -05:00
|
|
|
});
|
2014-11-12 21:35:41 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
save: function () {
|
|
|
|
this.get('controller').send('save');
|
|
|
|
}
|
2014-03-20 21:55:32 -05:00
|
|
|
}
|
|
|
|
});
|