2015-01-06 16:59:33 -05:00
|
|
|
export default function() {
|
2014-06-16 14:25:33 -04:00
|
|
|
// Error page
|
|
|
|
this.route('exception', { path: '/exception' });
|
|
|
|
|
2014-08-11 16:59:00 -04:00
|
|
|
this.resource('about', { path: '/about' });
|
|
|
|
|
2013-02-22 15:41:12 -05:00
|
|
|
// Topic routes
|
|
|
|
this.resource('topic', { path: '/t/:slug/:id' }, function() {
|
|
|
|
this.route('fromParams', { path: '/' });
|
2013-08-29 12:26:05 -04:00
|
|
|
this.route('fromParamsNear', { path: '/:nearPost' });
|
2013-02-22 15:41:12 -05:00
|
|
|
});
|
2014-09-17 11:18:41 -04:00
|
|
|
this.resource('topicBySlug', { path: '/t/:slug' });
|
2013-02-22 10:20:23 -05:00
|
|
|
|
2014-01-14 12:48:57 -05:00
|
|
|
this.resource('discovery', { path: '/' }, function() {
|
2014-01-13 19:02:14 -05:00
|
|
|
// top
|
|
|
|
this.route('top');
|
2014-10-16 12:15:31 -04:00
|
|
|
this.route('topCategory', { path: '/c/:slug/l/top' });
|
|
|
|
this.route('topCategoryNone', { path: '/c/:slug/none/l/top' });
|
|
|
|
this.route('topCategory', { path: '/c/:parentSlug/:slug/l/top' });
|
2013-03-28 09:01:13 -04:00
|
|
|
|
2014-01-13 19:02:14 -05:00
|
|
|
// top by periods
|
2015-01-06 16:59:33 -05:00
|
|
|
var self = this;
|
2014-01-14 12:48:57 -05:00
|
|
|
Discourse.Site.currentProp('periods').forEach(function(period) {
|
2014-01-13 19:02:14 -05:00
|
|
|
var top = 'top' + period.capitalize();
|
2015-01-06 16:59:33 -05:00
|
|
|
self.route(top, { path: '/top/' + period });
|
|
|
|
self.route(top + 'Category', { path: '/c/:slug/l/top/' + period });
|
|
|
|
self.route(top + 'CategoryNone', { path: '/c/:slug/none/l/top/' + period });
|
|
|
|
self.route(top + 'Category', { path: '/c/:parentSlug/:slug/l/top/' + period });
|
2014-01-13 19:02:14 -05:00
|
|
|
});
|
2013-12-23 18:50:36 -05:00
|
|
|
|
2014-01-20 08:41:11 -05:00
|
|
|
// filters
|
2014-01-14 12:48:57 -05:00
|
|
|
Discourse.Site.currentProp('filters').forEach(function(filter) {
|
2015-01-06 16:59:33 -05:00
|
|
|
self.route(filter, { path: '/' + filter });
|
|
|
|
self.route(filter + 'Category', { path: '/c/:slug/l/' + filter });
|
|
|
|
self.route(filter + 'CategoryNone', { path: '/c/:slug/none/l/' + filter });
|
|
|
|
self.route(filter + 'Category', { path: '/c/:parentSlug/:slug/l/' + filter });
|
2014-01-13 19:02:14 -05:00
|
|
|
});
|
|
|
|
|
2014-01-14 12:48:57 -05:00
|
|
|
this.route('categories');
|
|
|
|
|
2014-01-13 19:02:14 -05:00
|
|
|
// default filter for a category
|
2014-10-16 12:15:31 -04:00
|
|
|
this.route('parentCategory', { path: '/c/:slug' });
|
|
|
|
this.route('categoryNone', { path: '/c/:slug/none' });
|
|
|
|
this.route('category', { path: '/c/:parentSlug/:slug' });
|
|
|
|
|
2014-01-13 19:02:14 -05:00
|
|
|
// homepage
|
2014-04-21 12:43:44 -04:00
|
|
|
this.route(Discourse.Utilities.defaultHomepage(), { path: '/' });
|
2013-02-22 15:41:12 -05:00
|
|
|
});
|
|
|
|
|
2014-02-06 16:14:32 -05:00
|
|
|
this.resource('group', { path: '/groups/:name' }, function() {
|
2014-02-06 13:06:19 -05:00
|
|
|
this.route('members');
|
|
|
|
});
|
2014-01-30 17:10:36 -05:00
|
|
|
|
2013-02-22 15:41:12 -05:00
|
|
|
// User routes
|
2015-03-19 11:48:16 -04:00
|
|
|
this.resource('users');
|
2013-02-22 15:41:12 -05:00
|
|
|
this.resource('user', { path: '/users/:username' }, function() {
|
2013-07-16 16:16:37 -04:00
|
|
|
this.resource('userActivity', { path: '/activity' }, function() {
|
2015-01-06 16:59:33 -05:00
|
|
|
var self = this;
|
2014-01-13 19:02:14 -05:00
|
|
|
_.map(Discourse.UserAction.TYPES, function (id, userAction) {
|
2015-01-06 16:59:33 -05:00
|
|
|
self.route(userAction, { path: userAction.replace('_', '-') });
|
2013-07-16 16:16:37 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-04-16 14:49:28 -04:00
|
|
|
this.route('badges');
|
2014-09-02 21:32:27 -04:00
|
|
|
this.route('notifications');
|
2014-07-16 15:04:55 -04:00
|
|
|
this.route('flaggedPosts', { path: '/flagged-posts' });
|
|
|
|
this.route('deletedPosts', { path: '/deleted-posts' });
|
2014-04-16 14:49:28 -04:00
|
|
|
|
2013-07-16 16:16:37 -04:00
|
|
|
this.resource('userPrivateMessages', { path: '/private-messages' }, function() {
|
2014-01-13 19:02:14 -05:00
|
|
|
this.route('mine');
|
|
|
|
this.route('unread');
|
2013-07-16 16:16:37 -04:00
|
|
|
});
|
|
|
|
|
2014-01-13 19:02:14 -05:00
|
|
|
this.resource('preferences', function() {
|
|
|
|
this.route('username');
|
|
|
|
this.route('email');
|
2013-07-22 16:52:46 -04:00
|
|
|
this.route('about', { path: '/about-me' });
|
2014-04-17 23:10:53 -04:00
|
|
|
this.route('badgeTitle', { path: '/badge_title' });
|
2014-10-20 13:15:58 -04:00
|
|
|
this.route('card-badge', { path: '/card-badge' });
|
2013-02-20 13:15:50 -05:00
|
|
|
});
|
2013-07-16 16:16:37 -04:00
|
|
|
|
2014-01-13 19:02:14 -05:00
|
|
|
this.route('invited');
|
2013-02-20 13:15:50 -05:00
|
|
|
});
|
2014-02-18 17:18:42 -05:00
|
|
|
|
|
|
|
this.route('signup', {path: '/signup'});
|
|
|
|
this.route('login', {path: '/login'});
|
2015-03-23 15:13:55 -04:00
|
|
|
this.route('forgot-password', {path: '/password-reset'});
|
2014-07-29 14:24:16 -04:00
|
|
|
this.route('faq', {path: '/faq'});
|
|
|
|
this.route('tos', {path: '/tos'});
|
|
|
|
this.route('privacy', {path: '/privacy'});
|
|
|
|
this.route('guidelines', {path: '/guidelines'});
|
2014-04-16 09:12:06 -04:00
|
|
|
|
2014-04-16 10:56:11 -04:00
|
|
|
this.resource('badges', function() {
|
|
|
|
this.route('show', {path: '/:id/:slug'});
|
|
|
|
});
|
2015-04-10 17:00:50 -04:00
|
|
|
|
|
|
|
this.resource('queued-posts', { path: '/queued-posts' });
|
2015-01-06 16:59:33 -05:00
|
|
|
}
|