2014-03-11 20:23:32 +04:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-06-19 23:44:44 +04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
import ShortcutsRoute from 'ghost/mixins/shortcuts-route';
|
2014-03-02 18:30:35 +04:00
|
|
|
|
2014-05-24 07:25:20 +04:00
|
|
|
var paginationSettings = {
|
|
|
|
status: 'all',
|
|
|
|
staticPages: 'all',
|
2014-06-20 14:40:32 +04:00
|
|
|
page: 1
|
2014-05-24 07:25:20 +04:00
|
|
|
};
|
|
|
|
|
2014-06-19 23:44:44 +04:00
|
|
|
var PostsRoute = AuthenticatedRoute.extend(ShortcutsRoute, 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
|
|
|
},
|
|
|
|
|
2014-06-19 23:44:44 +04:00
|
|
|
shortcuts: {
|
|
|
|
'up': 'moveUp',
|
|
|
|
'down': 'moveDown'
|
|
|
|
},
|
2014-03-02 18:30:35 +04:00
|
|
|
actions: {
|
|
|
|
openEditor: function (post) {
|
|
|
|
this.transitionTo('editor', post);
|
2014-06-19 23:44:44 +04:00
|
|
|
},
|
|
|
|
moveUp: function () {
|
|
|
|
window.alert('@todo keyboard post navigation: up');
|
|
|
|
},
|
|
|
|
moveDown: function () {
|
|
|
|
window.alert('@todo keyboard post navigation: down');
|
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 PostsRoute;
|