2014-03-04 00:18:10 +04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-03-11 20:23:32 +04:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-03-02 18:30:35 +04:00
|
|
|
|
2014-05-24 07:25:20 +04:00
|
|
|
var paginationSettings = {
|
|
|
|
status: 'all',
|
|
|
|
staticPages: 'all',
|
|
|
|
page: 1,
|
|
|
|
limit: 15
|
|
|
|
};
|
|
|
|
|
2014-03-11 20:23:32 +04:00
|
|
|
var PostsRoute = AuthenticatedRoute.extend(styleBody, {
|
2014-03-04 00:18:10 +04:00
|
|
|
classNames: ['manage'],
|
2014-03-02 18:30:35 +04:00
|
|
|
|
|
|
|
model: function () {
|
2014-05-24 07:25:20 +04:00
|
|
|
// using `.filter` allows the template to auto-update when new models are pulled in from the server.
|
|
|
|
// we just need to 'return true' to allow all models by default.
|
|
|
|
return this.store.filter('post', paginationSettings, function () {
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController: function (controller, model) {
|
|
|
|
this._super(controller, model);
|
|
|
|
controller.set('paginationSettings', paginationSettings);
|
2014-03-02 18:30:35 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
openEditor: function (post) {
|
|
|
|
this.transitionTo('editor', post);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2014-03-04 00:18:10 +04:00
|
|
|
|
2014-04-20 18:48:34 +04:00
|
|
|
export default PostsRoute;
|