2017-10-12 18:42:10 +03:00
|
|
|
import EmberRouter from '@ember/routing/router';
|
2020-08-03 11:21:42 +03:00
|
|
|
import config from 'ghost-admin/config/environment';
|
2017-05-29 21:50:03 +03:00
|
|
|
import ghostPaths from 'ghost-admin/utils/ghost-paths';
|
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
|
2019-03-06 20:15:44 +03:00
|
|
|
rootURL: ghostPaths().adminRoot // admin interface lives under sub-directory /ghost
|
2014-03-02 18:30:35 +04:00
|
|
|
});
|
|
|
|
|
2022-08-03 14:21:16 +03:00
|
|
|
// eslint-disable-next-line array-callback-return
|
2017-10-12 18:42:10 +03:00
|
|
|
Router.map(function () {
|
2019-03-21 12:33:14 +03:00
|
|
|
this.route('home', {path: '/'});
|
|
|
|
|
2022-03-08 20:30:46 +03:00
|
|
|
this.route('setup');
|
2022-03-02 15:44:11 +03:00
|
|
|
this.route('setup.done', {path: '/setup/done'});
|
2015-03-29 21:10:53 +03:00
|
|
|
|
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'});
|
2021-01-18 12:02:44 +03:00
|
|
|
|
2021-09-08 15:00:24 +03:00
|
|
|
this.route('whatsnew');
|
2019-03-21 12:33:14 +03:00
|
|
|
this.route('site');
|
2021-01-21 12:11:51 +03:00
|
|
|
this.route('dashboard');
|
2021-01-28 17:25:05 +03:00
|
|
|
this.route('launch');
|
2020-05-22 05:44:37 +03:00
|
|
|
|
2021-03-23 14:59:52 +03:00
|
|
|
this.route('pro', function () {
|
|
|
|
this.route('pro-sub', {path: '/*sub'});
|
2020-05-22 05:44:37 +03:00
|
|
|
});
|
2014-10-25 01:09:50 +04:00
|
|
|
|
2019-06-18 13:47:21 +03:00
|
|
|
this.route('posts');
|
2022-09-13 12:00:45 +03:00
|
|
|
this.route('posts.analytics', {path: '/posts/analytics/:post_id'});
|
2023-02-22 12:48:15 +03:00
|
|
|
this.route('posts.mentions', {path: '/posts/analytics/:post_id/mentions'});
|
2022-12-01 15:28:37 +03:00
|
|
|
this.route('posts.debug', {path: '/posts/analytics/:post_id/debug'});
|
2022-09-13 12:00:45 +03:00
|
|
|
|
2019-06-18 13:47:21 +03:00
|
|
|
this.route('pages');
|
2014-10-25 01:09:50 +04:00
|
|
|
|
2023-10-04 14:22:54 +03:00
|
|
|
this.route('lexical-editor', {path: 'editor'}, function () {
|
2022-08-23 13:45:50 +03:00
|
|
|
this.route('new', {path: ':type'});
|
|
|
|
this.route('edit', {path: ':type/:post_id'});
|
|
|
|
});
|
|
|
|
|
2019-12-09 20:44:16 +03:00
|
|
|
this.route('tags');
|
|
|
|
this.route('tag.new', {path: '/tags/new'});
|
|
|
|
this.route('tag', {path: '/tags/:tag_slug'});
|
2019-06-18 13:47:21 +03:00
|
|
|
|
2023-05-23 08:28:53 +03:00
|
|
|
this.route('collections');
|
2023-06-19 13:07:36 +03:00
|
|
|
this.route('collection.new', {path: '/collections/new'});
|
|
|
|
this.route('collection', {path: '/collections/:collection_slug'});
|
2023-07-24 09:14:28 +03:00
|
|
|
|
2023-11-20 16:30:15 +03:00
|
|
|
this.route('demo-x', function () {
|
|
|
|
this.route('demo-x', {path: '/*sub'});
|
|
|
|
});
|
|
|
|
|
2023-10-09 10:12:46 +03:00
|
|
|
this.route('settings-x', {path: '/settings'}, function () {
|
2023-07-04 17:56:46 +03:00
|
|
|
this.route('settings-x', {path: '/*sub'});
|
|
|
|
});
|
2023-02-22 12:48:15 +03:00
|
|
|
|
2024-04-25 11:44:29 +03:00
|
|
|
this.route('activitypub-x',{path: '/activitypub'}, function () {
|
|
|
|
this.route('activitypub-x', {path: '/*sub'});
|
|
|
|
});
|
|
|
|
|
2022-10-07 16:32:54 +03:00
|
|
|
this.route('explore', function () {
|
|
|
|
// actual Ember route, not rendered in iframe
|
|
|
|
this.route('connect');
|
|
|
|
// iframe sub pages, used for categories
|
|
|
|
this.route('explore-sub', {path: '/*sub'}, function () {
|
|
|
|
// needed to allow search to work, as it uses URL
|
|
|
|
// params for search queries. They don't need to
|
|
|
|
// be visible, but may not be cut off.
|
|
|
|
this.route('explore-query', {path: '/*query'});
|
|
|
|
});
|
|
|
|
});
|
2022-07-27 16:22:45 +03:00
|
|
|
|
2023-12-13 18:25:29 +03:00
|
|
|
this.route('migrate', function () {
|
|
|
|
this.route('migrate', {path: '/*platform'});
|
|
|
|
});
|
2023-03-30 17:40:06 +03:00
|
|
|
|
2020-05-28 15:35:53 +03:00
|
|
|
this.route('members', function () {
|
2019-10-04 12:33:10 +03:00
|
|
|
this.route('import');
|
|
|
|
});
|
2020-05-28 15:35:53 +03:00
|
|
|
this.route('member.new', {path: '/members/new'});
|
|
|
|
this.route('member', {path: '/members/:member_id'});
|
2022-01-17 21:05:10 +03:00
|
|
|
this.route('members-activity');
|
2020-05-19 18:18:14 +03:00
|
|
|
|
2024-01-25 15:41:54 +03:00
|
|
|
// this.route('offers');
|
2021-10-08 06:58:17 +03:00
|
|
|
|
2024-01-25 15:41:54 +03:00
|
|
|
// this.route('offer.new', {path: '/offers/new'});
|
|
|
|
// this.route('offer', {path: '/offers/:offer_id'});
|
2021-10-04 14:01:12 +03:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
this.route('error404', {path: '/*path'});
|
2021-02-05 15:48:38 +03:00
|
|
|
|
2021-02-05 16:00:51 +03:00
|
|
|
this.route('designsandbox');
|
2023-01-17 15:16:18 +03:00
|
|
|
|
|
|
|
this.route('mentions');
|
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;
|