2014-03-04 00:18:10 +04:00
|
|
|
import ajax from 'ghost/utils/ajax';
|
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-03-11 20:23:32 +04:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-04-20 18:48:34 +04:00
|
|
|
import Post from 'ghost/models/post';
|
2014-03-11 20:23:32 +04:00
|
|
|
var EditorRoute = AuthenticatedRoute.extend(styleBody, {
|
2014-03-04 00:18:10 +04:00
|
|
|
classNames: ['editor'],
|
2014-04-20 18:48:34 +04:00
|
|
|
controllerName: 'posts.post',
|
2014-03-02 18:30:35 +04:00
|
|
|
model: function (params) {
|
2014-04-20 18:48:34 +04:00
|
|
|
return ajax('/ghost/api/v0.1/posts/' + params.post_id).then(function (post) {
|
|
|
|
return Post.create(post);
|
|
|
|
});
|
2014-03-02 18:30:35 +04:00
|
|
|
}
|
2014-03-04 00:18:10 +04:00
|
|
|
});
|
|
|
|
|
2014-04-20 18:48:34 +04:00
|
|
|
export default EditorRoute;
|