2016-05-24 15:06:59 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
|
|
|
import styleBody from 'ghost-admin/mixins/style-body';
|
2014-07-31 23:36:20 +04:00
|
|
|
|
2015-05-25 21:17:10 +03:00
|
|
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
|
|
|
titleToken: 'Settings - Code Injection',
|
2014-07-31 23:36:20 +04:00
|
|
|
classNames: ['settings-view-code'],
|
|
|
|
|
2015-11-15 14:06:49 +03:00
|
|
|
beforeModel() {
|
|
|
|
this._super(...arguments);
|
2015-04-14 18:04:16 +03:00
|
|
|
return this.get('session.user')
|
2014-07-31 23:36:20 +04:00
|
|
|
.then(this.transitionAuthor())
|
2015-04-09 19:52:41 +03:00
|
|
|
.then(this.transitionEditor());
|
2014-07-31 23:36:20 +04:00
|
|
|
},
|
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
model() {
|
2016-05-13 13:24:17 +03:00
|
|
|
return this.store.query('setting', {type: 'blog,theme,private'}).then((records) => {
|
2014-07-31 23:36:20 +04:00
|
|
|
return records.get('firstObject');
|
|
|
|
});
|
2014-11-28 14:09:45 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
2015-10-28 14:36:45 +03:00
|
|
|
save() {
|
2014-11-28 14:09:45 +03:00
|
|
|
this.get('controller').send('save');
|
|
|
|
}
|
2014-07-31 23:36:20 +04:00
|
|
|
}
|
|
|
|
});
|