2015-02-12 21:22:32 -07:00
|
|
|
import Ember from 'ember';
|
2014-06-24 01:38:30 +01:00
|
|
|
import ghostPaths from 'ghost/utils/ghost-paths';
|
2014-11-25 12:56:08 -08:00
|
|
|
import documentTitle from 'ghost/utils/document-title';
|
2015-10-05 08:07:44 +02:00
|
|
|
import config from './config/environment';
|
2014-02-25 23:58:00 -05:00
|
|
|
|
2014-11-27 23:45:34 +00:00
|
|
|
var Router = Ember.Router.extend({
|
2015-10-05 08:07:44 +02:00
|
|
|
location: config.locationType, // use HTML5 History API instead of hash-tag based URLs
|
2014-08-10 13:10:29 -04:00
|
|
|
rootURL: ghostPaths().adminRoot, // admin interface lives under sub-directory /ghost
|
2014-06-24 10:00:28 +00:00
|
|
|
|
2015-05-25 21:10:50 -05:00
|
|
|
notifications: Ember.inject.service(),
|
|
|
|
|
2015-08-24 15:46:18 +01:00
|
|
|
displayDelayedNotifications: Ember.on('didTransition', function () {
|
|
|
|
this.get('notifications').displayDelayed();
|
2014-11-27 23:45:34 +00:00
|
|
|
})
|
2014-03-02 15:30:35 +01:00
|
|
|
});
|
|
|
|
|
2014-11-27 23:45:34 +00:00
|
|
|
documentTitle();
|
|
|
|
|
2014-02-26 23:45:45 -05:00
|
|
|
Router.map(function () {
|
2015-05-27 15:10:47 -05:00
|
|
|
this.route('setup', function () {
|
2015-03-29 20:10:53 +02:00
|
|
|
this.route('one');
|
|
|
|
this.route('two');
|
|
|
|
this.route('three');
|
|
|
|
});
|
|
|
|
|
2014-03-09 23:44:08 -04:00
|
|
|
this.route('signin');
|
2014-06-01 15:30:50 -04:00
|
|
|
this.route('signout');
|
2014-10-24 21:09:50 +00:00
|
|
|
this.route('signup', {path: '/signup/:token'});
|
|
|
|
this.route('reset', {path: '/reset/:token'});
|
2015-05-25 17:00:42 +01:00
|
|
|
this.route('about', {path: '/about'});
|
2014-10-24 21:09:50 +00:00
|
|
|
|
2015-05-25 13:17:10 -05:00
|
|
|
this.route('posts', {path: '/'}, function () {
|
2014-10-24 21:09:50 +00:00
|
|
|
this.route('post', {path: ':post_id'});
|
2014-03-02 15:30:35 +01:00
|
|
|
});
|
2014-10-24 21:09:50 +00:00
|
|
|
|
2015-05-25 13:17:10 -05:00
|
|
|
this.route('editor', function () {
|
2014-10-24 21:09:50 +00:00
|
|
|
this.route('new', {path: ''});
|
|
|
|
this.route('edit', {path: ':post_id'});
|
2014-06-09 22:44:29 -06:00
|
|
|
});
|
2014-10-24 21:09:50 +00:00
|
|
|
|
2015-06-18 11:59:08 +01:00
|
|
|
this.route('team', {path: '/team'}, function () {
|
2015-05-25 13:17:10 -05:00
|
|
|
this.route('user', {path: ':slug'});
|
2013-06-01 19:45:02 -04:00
|
|
|
});
|
2015-06-18 11:59:08 +01:00
|
|
|
|
|
|
|
this.route('settings.general', {path: '/settings/general'});
|
2015-05-25 13:17:10 -05:00
|
|
|
this.route('settings.tags', {path: '/settings/tags'});
|
|
|
|
this.route('settings.labs', {path: '/settings/labs'});
|
|
|
|
this.route('settings.code-injection', {path: '/settings/code-injection'});
|
|
|
|
this.route('settings.navigation', {path: '/settings/navigation'});
|
2014-06-24 00:52:10 +01:00
|
|
|
|
2014-10-24 21:09:50 +00: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 18:11:46 -06:00
|
|
|
export default Router;
|