2014-06-23 19:38:30 -05:00
|
|
|
import ghostPaths from 'ghost/utils/ghost-paths';
|
2014-11-25 15:56:08 -05:00
|
|
|
import documentTitle from 'ghost/utils/document-title';
|
2014-02-25 23:58:00 -05:00
|
|
|
|
2014-11-27 18:45:34 -05:00
|
|
|
var Router = Ember.Router.extend({
|
2014-05-13 20:52:31 -05:00
|
|
|
location: 'trailing-history', // use HTML5 History API instead of hash-tag based URLs
|
2014-08-10 12:10:29 -05:00
|
|
|
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
|
2014-06-24 05:00:28 -05:00
|
|
|
|
2014-11-27 18:45:34 -05:00
|
|
|
clearNotifications: Ember.on('didTransition', function () {
|
2014-06-29 16:45:03 -05:00
|
|
|
this.notifications.closePassive();
|
2014-06-24 05:00:28 -05:00
|
|
|
this.notifications.displayDelayed();
|
2014-11-27 18:45:34 -05:00
|
|
|
})
|
2014-03-02 09:30:35 -05:00
|
|
|
});
|
|
|
|
|
2014-11-27 18:45:34 -05:00
|
|
|
documentTitle();
|
|
|
|
|
2014-02-26 23:45:45 -05:00
|
|
|
Router.map(function () {
|
2014-06-25 07:12:48 -05:00
|
|
|
this.route('setup');
|
2014-03-09 22:44:08 -05:00
|
|
|
this.route('signin');
|
2014-06-01 14:30:50 -05:00
|
|
|
this.route('signout');
|
2014-10-24 16:09:50 -05:00
|
|
|
this.route('signup', {path: '/signup/:token'});
|
2014-03-09 22:44:08 -05:00
|
|
|
this.route('forgotten');
|
2014-10-24 16:09:50 -05:00
|
|
|
this.route('reset', {path: '/reset/:token'});
|
|
|
|
|
|
|
|
this.resource('posts', {path: '/'}, function () {
|
|
|
|
this.route('post', {path: ':post_id'});
|
2014-03-02 09:30:35 -05:00
|
|
|
});
|
2014-10-24 16:09:50 -05:00
|
|
|
|
2014-06-09 23:44:29 -05:00
|
|
|
this.resource('editor', function () {
|
2014-10-24 16:09:50 -05:00
|
|
|
this.route('new', {path: ''});
|
|
|
|
this.route('edit', {path: ':post_id'});
|
2014-06-09 23:44:29 -05:00
|
|
|
});
|
2014-10-24 16:09:50 -05:00
|
|
|
|
2014-03-09 22:44:08 -05:00
|
|
|
this.resource('settings', function () {
|
|
|
|
this.route('general');
|
2014-10-24 16:09:50 -05:00
|
|
|
|
|
|
|
this.resource('settings.users', {path: '/users'}, function () {
|
|
|
|
this.route('user', {path: '/:slug'});
|
2014-07-01 22:44:39 -05:00
|
|
|
});
|
2014-10-24 16:09:50 -05:00
|
|
|
|
2014-08-02 10:21:38 -05:00
|
|
|
this.route('about');
|
2014-10-13 10:41:03 -05:00
|
|
|
this.route('tags');
|
2014-12-01 06:39:11 -05:00
|
|
|
this.route('labs');
|
2014-07-31 14:36:20 -05:00
|
|
|
this.route('code-injection');
|
2015-01-11 14:55:52 -05:00
|
|
|
this.route('navigation');
|
2013-06-01 18:45:02 -05:00
|
|
|
});
|
2014-10-24 16:09:50 -05:00
|
|
|
|
2014-12-01 06:39:11 -05:00
|
|
|
// Redirect debug to settings labs
|
2014-04-07 17:01:46 -05:00
|
|
|
this.route('debug');
|
2014-06-23 18:52:10 -05:00
|
|
|
|
2014-10-24 16:09:50 -05:00
|
|
|
// Redirect legacy content to posts
|
|
|
|
this.route('content');
|
2014-06-23 18:52:10 -05:00
|
|
|
|
2014-10-24 16:09:50 -05:00
|
|
|
this.route('error404', {path: '/*path'});
|
2014-02-25 23:58:00 -05:00
|
|
|
});
|
2014-02-26 23:45:45 -05:00
|
|
|
|
2014-05-14 19:11:46 -05:00
|
|
|
export default Router;
|