mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 00:11:49 +03:00
ef0178cd06
refs https://github.com/TryGhost/Ghost/issues/14101 - migrated to full native class syntax - removed loading of snippets as they are not needed on post lists (they are needed on the editor screen which does it's own loading) - removed `access` query param definition leftover from earlier development - removed use of `{{action}}` in associated templates
44 lines
857 B
JavaScript
44 lines
857 B
JavaScript
import PostsController from './posts';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
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'
|
|
}];
|
|
|
|
const ORDERS = [{
|
|
name: 'Newest first',
|
|
value: null
|
|
}, {
|
|
name: 'Oldest first',
|
|
value: 'published_at asc'
|
|
}, {
|
|
name: 'Recently updated',
|
|
value: 'updated_at desc'
|
|
}];
|
|
|
|
export default class PagesController extends PostsController {
|
|
@service router;
|
|
|
|
availableTypes = TYPES;
|
|
availableOrders = ORDERS;
|
|
|
|
@action
|
|
openEditor(page) {
|
|
this.router.transitionTo('editor.edit', 'page', page.get('id'));
|
|
}
|
|
}
|