2019-02-22 06:17:33 +03:00
|
|
|
import PostsController from './posts';
|
|
|
|
|
|
|
|
const TYPES = [{
|
|
|
|
name: 'All pages',
|
|
|
|
value: null
|
|
|
|
}, {
|
|
|
|
name: 'Draft pages',
|
|
|
|
value: 'draft'
|
|
|
|
}, {
|
|
|
|
name: 'Published pages',
|
|
|
|
value: 'published'
|
|
|
|
}, {
|
|
|
|
name: 'Scheduled pages',
|
|
|
|
value: 'scheduled'
|
|
|
|
}, {
|
|
|
|
name: 'Featured pages',
|
|
|
|
value: 'featured'
|
|
|
|
}];
|
|
|
|
|
2020-12-04 13:30:03 +03:00
|
|
|
const ORDERS = [{
|
|
|
|
name: 'Newest',
|
|
|
|
value: null
|
|
|
|
}, {
|
|
|
|
name: 'Oldest',
|
|
|
|
value: 'published_at asc'
|
|
|
|
}, {
|
|
|
|
name: 'Recently updated',
|
|
|
|
value: 'updated_at desc'
|
|
|
|
}];
|
|
|
|
|
2019-02-22 06:17:33 +03:00
|
|
|
/* eslint-disable ghost/ember/alias-model-in-controller */
|
|
|
|
export default PostsController.extend({
|
|
|
|
init() {
|
|
|
|
this._super(...arguments);
|
|
|
|
this.availableTypes = TYPES;
|
2020-12-04 13:30:03 +03:00
|
|
|
this.availableOrders = ORDERS;
|
2019-02-22 06:17:33 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
openEditor(page) {
|
|
|
|
this.transitionToRoute('editor.edit', 'page', page.get('id'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|