2015-02-13 05:22:32 +01:00
|
|
|
import Ember from 'ember';
|
2014-06-24 02:38:30 +02:00
|
|
|
import ghostPaths from 'ghost/utils/ghost-paths';
|
2014-11-25 21:56:08 +01:00
|
|
|
import documentTitle from 'ghost/utils/document-title';
|
2014-02-26 05:58:00 +01:00
|
|
|
|
2014-11-28 00:45:34 +01:00
|
|
|
var Router = Ember.Router.extend({
|
2014-05-14 03:52:31 +02:00
|
|
|
location: 'trailing-history', // 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
|
|
|
|
2014-11-28 00:45:34 +01:00
|
|
|
clearNotifications: Ember.on('didTransition', function () {
|
2014-06-29 23:45:03 +02:00
|
|
|
this.notifications.closePassive();
|
2014-06-24 12:00:28 +02:00
|
|
|
this.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();
|
|
|
|
|
2014-02-27 05:45:45 +01:00
|
|
|
Router.map(function () {
|
2014-06-25 14:12:48 +02:00
|
|
|
this.route('setup');
|
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'});
|
|
|
|
|
|
|
|
this.resource('posts', {path: '/'}, function () {
|
|
|
|
this.route('post', {path: ':post_id'});
|
2014-03-02 15:30:35 +01:00
|
|
|
});
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2014-06-10 06:44:29 +02:00
|
|
|
this.resource('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
|
|
|
|
2014-03-10 04:44:08 +01:00
|
|
|
this.resource('settings', function () {
|
|
|
|
this.route('general');
|
2014-10-24 23:09:50 +02:00
|
|
|
|
|
|
|
this.resource('settings.users', {path: '/users'}, function () {
|
|
|
|
this.route('user', {path: '/:slug'});
|
2014-07-02 05:44:39 +02:00
|
|
|
});
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2014-08-02 17:21:38 +02:00
|
|
|
this.route('about');
|
2014-10-13 17:41:03 +02:00
|
|
|
this.route('tags');
|
2014-12-01 12:39:11 +01:00
|
|
|
this.route('labs');
|
2014-07-31 21:36:20 +02:00
|
|
|
this.route('code-injection');
|
2015-01-11 20:55:52 +01:00
|
|
|
this.route('navigation');
|
2013-07-11 21:02:18 +02:00
|
|
|
});
|
2014-10-24 23:09:50 +02:00
|
|
|
|
2014-12-01 12:39:11 +01:00
|
|
|
// Redirect debug to settings labs
|
2014-04-08 00:01:46 +02:00
|
|
|
this.route('debug');
|
2014-06-24 01:52:10 +02:00
|
|
|
|
2014-10-24 23:09:50 +02:00
|
|
|
// Redirect legacy content to posts
|
|
|
|
this.route('content');
|
2014-06-24 01:52:10 +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
|
|
|
|
2014-05-15 02:11:46 +02:00
|
|
|
export default Router;
|