mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
ff5af6c29b
closes #2419 - Added blur-text-field component, which fires actions on focusOut - Added utils/date-formatting for moment & date functionality consolidation - Added functionality to PostsPostController - Added fixtures: posts/3 & posts/4, posts/slug/test%20title/ - Added Post model saving - Set posts.post as controller for EditorRoute - Added PostSettingsMenuView and template - Added "showErrors" convenience method to notifications
24 lines
650 B
JavaScript
24 lines
650 B
JavaScript
import ajax from 'ghost/utils/ajax';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import Post from 'ghost/models/post';
|
|
|
|
var PostsRoute = AuthenticatedRoute.extend(styleBody, {
|
|
classNames: ['manage'],
|
|
|
|
model: function () {
|
|
return ajax('/ghost/api/v0.1/posts').then(function (response) {
|
|
return response.posts.map(function (post) {
|
|
return Post.create(post);
|
|
});
|
|
});
|
|
},
|
|
|
|
actions: {
|
|
openEditor: function (post) {
|
|
this.transitionTo('editor', post);
|
|
}
|
|
}
|
|
});
|
|
|
|
export default PostsRoute;
|