2017-10-12 17:42:10 +02:00
|
|
|
import EmberRouter from '@ember/routing/router';
|
2017-05-29 20:50:03 +02:00
|
|
|
import config from './config/environment';
|
|
|
|
import documentTitle from 'ghost-admin/utils/document-title';
|
|
|
|
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
2017-08-22 09:53:26 +02:00
|
|
|
import {on} from '@ember/object/evented';
|
2017-10-30 10:38:01 +01:00
|
|
|
import {inject as service} from '@ember/service';
|
2014-02-26 05:58:00 +01:00
|
|
|
|
2017-10-12 17:42:10 +02:00
|
|
|
const Router = EmberRouter.extend({
|
2015-10-05 08:07:44 +02:00
|
|
|
location: config.locationType, // use HTML5 History API instead of hash-tag based URLs
|
2014-08-10 19:10:29 +02:00
|
|
|
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
|
2014-06-24 12:00:28 +02:00
|
|
|
|
2017-10-30 10:38:01 +01:00
|
|
|
notifications: service(),
|
2015-05-26 04:10:50 +02:00
|
|
|
|
2015-10-28 12:36:45 +01:00
|
|
|
displayDelayedNotifications: on('didTransition', function () {
|
2015-08-24 16:46:18 +02:00
|
|
|
this.get('notifications').displayDelayed();
|
2014-11-28 00:45:34 +01:00
|
|
|
})
|
2014-03-02 15:30:35 +01:00
|
|
|
});
|
|
|
|
|
2014-11-28 00:45:34 +01:00
|
|
|
documentTitle();
|
|
|
|
|
2017-10-12 17:42:10 +02:00
|
|
|
Router.map(function () {
|
2015-05-27 22:10:47 +02:00
|
|
|
this.route('setup', function () {
|
2015-03-29 20:10:53 +02:00
|
|
|
this.route('one');
|
|
|
|
this.route('two');
|
|
|
|
this.route('three');
|
|
|
|
});
|
|
|
|
|
2014-03-10 04:44:08 +01:00
|
|
|
this.route('signin');
|
2014-06-01 21:30:50 +02:00
|
|
|
this.route('signout');
|
2014-10-24 23:09:50 +02:00
|
|
|
this.route('signup', {path: '/signup/:token'});
|
|
|
|
this.route('reset', {path: '/reset/:token'});
|
2015-05-25 18:00:42 +02:00
|
|
|
this.route('about', {path: '/about'});
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2017-01-25 21:05:28 +01:00
|
|
|
this.route('posts', {path: '/'}, function() {});
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2015-05-25 20:17:10 +02:00
|
|
|
this.route('editor', function () {
|
2014-10-24 23:09:50 +02:00
|
|
|
this.route('new', {path: ''});
|
|
|
|
this.route('edit', {path: ':post_id'});
|
2014-06-10 06:44:29 +02:00
|
|
|
});
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2015-06-18 12:59:08 +02:00
|
|
|
this.route('team', {path: '/team'}, function () {
|
2015-11-23 14:48:08 +01:00
|
|
|
this.route('user', {path: ':user_slug'});
|
2013-07-11 21:02:18 +02:00
|
|
|
});
|
2015-06-18 12:59:08 +02:00
|
|
|
|
2017-02-21 20:04:50 +01:00
|
|
|
this.route('settings.general', {path: '/settings/general'});
|
2015-10-15 14:03:26 +02:00
|
|
|
this.route('settings.tags', {path: '/settings/tags'}, function () {
|
2015-10-23 19:18:39 +02:00
|
|
|
this.route('tag', {path: ':tag_slug'});
|
2015-10-15 14:03:26 +02:00
|
|
|
this.route('new');
|
|
|
|
});
|
2015-05-25 20:17:10 +02:00
|
|
|
this.route('settings.labs', {path: '/settings/labs'});
|
|
|
|
this.route('settings.code-injection', {path: '/settings/code-injection'});
|
2017-02-21 20:04:50 +01:00
|
|
|
this.route('settings.design', {path: '/settings/design'}, function () {
|
|
|
|
this.route('uploadtheme');
|
|
|
|
});
|
2016-03-29 10:40:44 +02:00
|
|
|
this.route('settings.apps', {path: '/settings/apps'}, function () {
|
|
|
|
this.route('slack', {path: 'slack'});
|
2017-01-20 10:33:54 +01:00
|
|
|
this.route('amp', {path: 'amp'});
|
2017-08-02 09:05:59 +02:00
|
|
|
this.route('unsplash', {path: 'unsplash'});
|
2018-01-09 11:36:41 +01:00
|
|
|
this.route('zapier', {path: 'zapier'});
|
2016-03-29 10:40:44 +02:00
|
|
|
});
|
2014-06-24 01:52:10 +02:00
|
|
|
|
2017-01-20 10:33:54 +01:00
|
|
|
this.route('subscribers', function () {
|
2016-04-15 16:45:50 +02:00
|
|
|
this.route('new');
|
|
|
|
this.route('import');
|
|
|
|
});
|
|
|
|
|
2014-10-24 23:09:50 +02:00
|
|
|
this.route('error404', {path: '/*path'});
|
2014-02-26 05:58:00 +01:00
|
|
|
});
|
2014-02-27 05:45:45 +01:00
|
|
|
|
2017-10-12 17:42:10 +02:00
|
|
|
export default Router;
|