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