1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/router.js
Kevin Ansfield b73a3f0b29 New content screen prototype (#503)
refs https://github.com/TryGhost/Ghost/issues/7860

- remove preview pane from content screen
- add basic post status filters
- replace custom infinite scroll with ember-infinity and increase trigger threshold for improved scroll behaviour

Commits:
* basic content list + filter using existing infinite scroll and pagination
* swap our custom pagination + infinite loader for `ember-infinity`
* minor cleanups
* reset scroll position when changing filter
* fix tests
* remove client-side sorting step as we no longer have a live collection
* remove unused `mobile-index-route`
* add acceptance tests for content screen filters
2017-01-25 21:05:28 +01:00

68 lines
2.1 KiB
JavaScript

import Router from 'ember-router';
import injectService from 'ember-service/inject';
import on from 'ember-evented/on';
import ghostPaths from 'ghost-admin/utils/ghost-paths';
import documentTitle from 'ghost-admin/utils/document-title';
import config from './config/environment';
const GhostRouter = Router.extend({
location: config.locationType, // use HTML5 History API instead of hash-tag based URLs
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
notifications: injectService(),
displayDelayedNotifications: on('didTransition', function () {
this.get('notifications').displayDelayed();
})
});
documentTitle();
GhostRouter.map(function () {
this.route('setup', function () {
this.route('one');
this.route('two');
this.route('three');
});
this.route('signin');
this.route('signout');
this.route('signup', {path: '/signup/:token'});
this.route('reset', {path: '/reset/:token'});
this.route('about', {path: '/about'});
this.route('posts', {path: '/'}, function() {});
this.route('editor', function () {
this.route('new', {path: ''});
this.route('edit', {path: ':post_id'});
});
this.route('team', {path: '/team'}, function () {
this.route('user', {path: ':user_slug'});
});
this.route('settings.general', {path: '/settings/general'}, function () {
this.route('uploadtheme');
});
this.route('settings.tags', {path: '/settings/tags'}, function () {
this.route('tag', {path: ':tag_slug'});
this.route('new');
});
this.route('settings.labs', {path: '/settings/labs'});
this.route('settings.code-injection', {path: '/settings/code-injection'});
this.route('settings.navigation', {path: '/settings/navigation'});
this.route('settings.apps', {path: '/settings/apps'}, function () {
this.route('slack', {path: 'slack'});
this.route('amp', {path: 'amp'});
});
this.route('subscribers', function () {
this.route('new');
this.route('import');
});
this.route('error404', {path: '/*path'});
});
export default GhostRouter;