2019-02-22 06:17:33 +03:00
|
|
|
import PostsController from './posts';
|
2022-02-01 12:34:03 +03:00
|
|
|
import {action} from '@ember/object';
|
2022-10-07 20:39:34 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2019-02-22 06:17:33 +03:00
|
|
|
|
|
|
|
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 = [{
|
2022-10-06 12:23:49 +03:00
|
|
|
name: 'Newest first',
|
2020-12-04 13:30:03 +03:00
|
|
|
value: null
|
|
|
|
}, {
|
2022-10-06 12:23:49 +03:00
|
|
|
name: 'Oldest first',
|
2020-12-04 13:30:03 +03:00
|
|
|
value: 'published_at asc'
|
|
|
|
}, {
|
|
|
|
name: 'Recently updated',
|
|
|
|
value: 'updated_at desc'
|
|
|
|
}];
|
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
export default class PagesController extends PostsController {
|
2022-10-07 20:39:34 +03:00
|
|
|
@service router;
|
|
|
|
|
|
|
|
availableTypes = TYPES;
|
|
|
|
availableOrders = ORDERS;
|
2019-02-22 06:17:33 +03:00
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
@action
|
|
|
|
openEditor(page) {
|
2022-10-07 20:39:34 +03:00
|
|
|
this.router.transitionTo('editor.edit', 'page', page.get('id'));
|
2019-02-22 06:17:33 +03:00
|
|
|
}
|
2022-02-01 12:34:03 +03:00
|
|
|
}
|