1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/routes/editor/new.js
Kevin Ansfield 604fda4348 Update package.json details, rename module to ghost-admin
no issue
- updates `package.json` details to better reflect the separation from the `Ghost` package
- update ember config and all import statements to reflect the new `ghost-admin` module name in `package.json`
2016-06-03 16:12:54 +01:00

51 lines
1.3 KiB
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
});
this.render('post-settings-menu', {
model,
into: 'application',
outlet: 'settings-menu'
});
},
setupController() {
let psm = this.controllerFor('post-settings-menu');
// make sure there are no titleObserver functions hanging around
// from previous posts
psm.removeObserver('titleScratch', psm, 'titleObserver');
// Ensure that the PSM Publish Date selector resets
psm.send('resetPubDate');
this._super(...arguments);
},
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);
}
}
});