framework/js/forum/src/initializers/routes.js
2015-04-25 22:28:39 +09:30

22 lines
950 B
JavaScript

import IndexPage from 'flarum/components/index-page';
import DiscussionPage from 'flarum/components/discussion-page';
import ActivityPage from 'flarum/components/activity-page';
import SettingsPage from 'flarum/components/settings-page';
export default function(app) {
app.routes = {
'index': ['/', IndexPage.component()],
'index.filter': ['/:filter', IndexPage.component()],
'discussion': ['/d/:id/:slug', DiscussionPage.component()],
'discussion.near': ['/d/:id/:slug/:near', DiscussionPage.component()],
'user': ['/u/:username', ActivityPage.component()],
'user.activity': ['/u/:username', ActivityPage.component()],
'user.discussions': ['/u/:username/discussions', ActivityPage.component({filter: 'discussion'})],
'user.posts': ['/u/:username/posts', ActivityPage.component({filter: 'post'})],
'settings': ['/settings', SettingsPage.component()]
};
}