2014-07-31 21:36:20 +02:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2015-05-25 13:17:10 -05:00
|
|
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
|
|
|
titleToken: 'Settings - Code Injection',
|
2014-07-31 21:36:20 +02:00
|
|
|
classNames: ['settings-view-code'],
|
|
|
|
|
2015-07-22 11:11:42 +01:00
|
|
|
beforeModel: function (transition) {
|
|
|
|
this._super(transition);
|
2015-04-14 16:04:16 +01:00
|
|
|
return this.get('session.user')
|
2014-07-31 21:36:20 +02:00
|
|
|
.then(this.transitionAuthor())
|
2015-04-09 17:52:41 +01:00
|
|
|
.then(this.transitionEditor());
|
2014-07-31 21:36:20 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
model: function () {
|
|
|
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
|
|
|
return records.get('firstObject');
|
|
|
|
});
|
2014-11-28 11:09:45 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
save: function () {
|
|
|
|
this.get('controller').send('save');
|
|
|
|
}
|
2014-07-31 21:36:20 +02:00
|
|
|
}
|
|
|
|
});
|