Ghost/core/client/router.js
Kevin Ansfield 7e2e8b3376 Persistent notifications
closes #3057
- add Notification model
- update injected Notifications object to handle persistent notifications
- load server notifications on setup if logged in otherwise on successful sign-in
- changed all existing notifications.closeAll calls to closePassive
- fixed dismissable/dismissible spelling in server API & tests
- add notifications.closeNotification method so DELETE calls can be made for server-originating notifications
2014-07-01 11:36:21 +02:00

45 lines
1.3 KiB
JavaScript

/*global Ember */
import ghostPaths from 'ghost/utils/ghost-paths';
// ensure we don't share routes between all Router instances
var Router = Ember.Router.extend();
Router.reopen({
location: 'trailing-history', // use HTML5 History API instead of hash-tag based URLs
rootURL: ghostPaths().subdir + '/ghost/', // admin interface lives under sub-directory /ghost
clearNotifications: function () {
this.notifications.closePassive();
this.notifications.displayDelayed();
}.on('didTransition')
});
Router.map(function () {
this.route('setup');
this.route('signin');
this.route('signout');
this.route('signup');
this.route('forgotten');
this.route('reset', { path: '/reset/:token' });
this.resource('posts', { path: '/' }, function () {
this.route('post', { path: ':post_id' });
});
this.resource('editor', function () {
this.route('new', { path: '' });
this.route('edit', { path: ':post_id' });
});
this.resource('settings', function () {
this.route('general');
this.route('user');
this.route('apps');
});
this.route('debug');
//Redirect legacy content to posts
this.route('content');
this.route('error404', { path: '/*path' });
});
export default Router;