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-26 19:24:32 +01:00
|
|
|
var SettingsCodeInjectionRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
2014-07-31 21:36:20 +02:00
|
|
|
classNames: ['settings-view-code'],
|
|
|
|
|
|
|
|
beforeModel: function () {
|
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
|
|
|
},
|
|
|
|
|
2015-05-12 07:35:23 -06:00
|
|
|
renderTemplate: function () {
|
|
|
|
this.render('settings/code-injection', {into: 'application'});
|
|
|
|
},
|
|
|
|
|
2014-11-28 11:09:45 +00:00
|
|
|
actions: {
|
|
|
|
save: function () {
|
|
|
|
this.get('controller').send('save');
|
|
|
|
}
|
2014-07-31 21:36:20 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default SettingsCodeInjectionRoute;
|