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