2016-05-24 15:06:59 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
import base from 'ghost-admin/mixins/editor-base-route';
|
2014-03-10 07:44:08 +04:00
|
|
|
|
2015-06-13 17:34:09 +03:00
|
|
|
export default AuthenticatedRoute.extend(base, {
|
2014-11-25 23:56:08 +03:00
|
|
|
titleToken: 'Editor',
|
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
model() {
|
2018-01-05 18:38:23 +03:00
|
|
|
return this.get('session.user').then(user => (
|
|
|
|
this.store.createRecord('post', {
|
2014-07-17 09:54:32 +04:00
|
|
|
author: user
|
2018-01-05 18:38:23 +03:00
|
|
|
})
|
|
|
|
));
|
2014-06-06 05:18:03 +04:00
|
|
|
},
|
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
renderTemplate(controller, model) {
|
2015-06-13 17:34:09 +03:00
|
|
|
this.render('editor/edit', {
|
2015-10-28 14:36:45 +03:00
|
|
|
controller,
|
|
|
|
model
|
2015-06-13 17:34:09 +03:00
|
|
|
});
|
2017-07-22 02:11:24 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
willTransition(transition) {
|
|
|
|
// decorate the transition object so the editor.edit route
|
|
|
|
// knows this was the previous active route
|
|
|
|
transition.data.fromNew = true;
|
|
|
|
|
|
|
|
this._super(...arguments);
|
|
|
|
}
|
2014-03-10 07:44:08 +04:00
|
|
|
}
|
|
|
|
});
|