mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
ab287848d4
no issue - cleans up some of the render code - aligns things with the "ember way" - move metaTitleScratch and metaDescriptionScratch bindings to post model
32 lines
812 B
JavaScript
32 lines
812 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import base from 'ghost-admin/mixins/editor-base-route';
|
|
|
|
export default AuthenticatedRoute.extend(base, {
|
|
titleToken: 'Editor',
|
|
|
|
model() {
|
|
return this.get('session.user').then((user) => {
|
|
return this.store.createRecord('post', {
|
|
author: user
|
|
});
|
|
});
|
|
},
|
|
|
|
renderTemplate(controller, model) {
|
|
this.render('editor/edit', {
|
|
controller,
|
|
model
|
|
});
|
|
},
|
|
|
|
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);
|
|
}
|
|
}
|
|
});
|