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