framework/js/forum/src/initializers/routes.js

22 lines
950 B
JavaScript
Raw Normal View History

2015-04-25 20:58:39 +08:00
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()]
};
}