2014-07-31 23:36:20 +04:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
|
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2014-11-26 01:34:55 +03:00
|
|
|
var SettingsCodeInjectionRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, {
|
2014-07-31 23:36:20 +04:00
|
|
|
classNames: ['settings-view-code'],
|
|
|
|
|
|
|
|
beforeModel: function () {
|
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
|
|
|
},
|
|
|
|
|
|
|
|
model: function () {
|
|
|
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
|
|
|
return records.get('firstObject');
|
|
|
|
});
|
2014-11-28 14:09:45 +03:00
|
|
|
},
|
|
|
|
|
2015-05-12 16:35:23 +03:00
|
|
|
renderTemplate: function () {
|
|
|
|
this.render('settings/code-injection', {into: 'application'});
|
|
|
|
},
|
|
|
|
|
2014-11-28 14:09:45 +03:00
|
|
|
actions: {
|
|
|
|
save: function () {
|
|
|
|
this.get('controller').send('save');
|
|
|
|
}
|
2014-07-31 23:36:20 +04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default SettingsCodeInjectionRoute;
|