2017-10-12 17:42:10 +02:00
|
|
|
import EmberRouter from '@ember/routing/router';
|
2020-08-03 10:21:42 +02:00
|
|
|
import config from 'ghost-admin/config/environment';
|
2017-05-29 20:50:03 +02:00
|
|
|
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
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
|
2019-03-06 18:15:44 +01:00
|
|
|
rootURL: ghostPaths().adminRoot // admin interface lives under sub-directory /ghost
|
2014-03-02 15:30:35 +01:00
|
|
|
});
|
|
|
|
|
2017-10-12 17:42:10 +02:00
|
|
|
Router.map(function () {
|
2019-03-21 10:33:14 +01:00
|
|
|
this.route('home', {path: '/'});
|
|
|
|
|
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'});
|
2021-01-18 10:02:44 +01:00
|
|
|
|
2019-03-05 18:34:00 +01:00
|
|
|
this.route('about');
|
2019-03-21 10:33:14 +01:00
|
|
|
this.route('site');
|
2020-05-22 04:44:37 +02:00
|
|
|
|
|
|
|
this.route('billing', function () {
|
|
|
|
this.route('billing-sub', {path: '/*sub'});
|
|
|
|
});
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2019-06-18 12:47:21 +02:00
|
|
|
this.route('posts');
|
|
|
|
this.route('pages');
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2015-05-25 20:17:10 +02:00
|
|
|
this.route('editor', function () {
|
2019-02-22 04:17:33 +01:00
|
|
|
this.route('new', {path: ':type'});
|
|
|
|
this.route('edit', {path: ':type/:post_id'});
|
2014-06-10 06:44:29 +02:00
|
|
|
});
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2019-03-05 18:34:00 +01:00
|
|
|
this.route('staff', 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
|
|
|
|
2019-12-09 18:44:16 +01:00
|
|
|
this.route('tags');
|
|
|
|
this.route('tag.new', {path: '/tags/new'});
|
|
|
|
this.route('tag', {path: '/tags/:tag_slug'});
|
2019-06-18 12:47:21 +02:00
|
|
|
|
|
|
|
this.route('settings.general', {path: '/settings/general'});
|
2015-05-25 20:17:10 +02:00
|
|
|
this.route('settings.labs', {path: '/settings/labs'});
|
2020-10-22 12:39:00 +02:00
|
|
|
this.route('settings.labs.members', {path: '/settings/labs/members'});
|
2015-05-25 20:17:10 +02:00
|
|
|
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');
|
|
|
|
});
|
2018-10-18 01:18:29 +02: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 18:34:53 +02:00
|
|
|
this.route('webhooks.edit', {path: 'webhooks/:webhook_id'});
|
2018-10-18 01:18:29 +02:00
|
|
|
});
|
2018-10-04 00:08:00 +02:00
|
|
|
this.route('settings.integrations.slack', {path: '/settings/integrations/slack'});
|
|
|
|
this.route('settings.integrations.amp', {path: '/settings/integrations/amp'});
|
2021-01-15 15:31:40 +01:00
|
|
|
this.route('settings.integrations.firstpromoter', {path: '/settings/integrations/firstpromoter'});
|
2018-10-04 00:08:00 +02:00
|
|
|
this.route('settings.integrations.unsplash', {path: '/settings/integrations/unsplash'});
|
|
|
|
this.route('settings.integrations.zapier', {path: '/settings/integrations/zapier'});
|
2014-06-24 01:52:10 +02:00
|
|
|
|
2020-05-28 14:35:53 +02:00
|
|
|
this.route('members', function () {
|
2019-10-04 11:33:10 +02:00
|
|
|
this.route('import');
|
|
|
|
});
|
2020-05-28 14:35:53 +02:00
|
|
|
this.route('member.new', {path: '/members/new'});
|
|
|
|
this.route('member', {path: '/members/:member_id'});
|
2020-05-19 17:18:14 +02:00
|
|
|
|
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;
|