router.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import Ember from 'ember';
  2. import config from './config/environment';
  3. var Router = Ember.Router.extend({
  4. location: config.locationType
  5. });
  6. Router.map(function() {
  7. // Auth
  8. this.route('activation', { path: 'activation/' }, function() {
  9. this.route('activate', { path: ':user_id/:token/' });
  10. });
  11. this.route('forgotten-password', { path: 'forgotten-password/' }, function() {
  12. this.route('change-form', { path: ':user_id/:token/' });
  13. });
  14. // Options
  15. this.route('options', { path: 'options/' }, function() {
  16. this.route('forum', { path: 'forum-options/' });
  17. this.route('signature', { path: 'edit-signature/' });
  18. this.route('username', { path: 'change-username/' });
  19. this.route('password', { path: 'change-password/' }, function() {
  20. this.route('confirm', { path: ':token/' });
  21. });
  22. this.route('email', { path: 'change-email/' }, function() {
  23. this.route('confirm', { path: ':token/' });
  24. });
  25. });
  26. // Users
  27. this.route('users', { path: 'users/' }, function() {
  28. this.route('rank', { path: ':slug/' }, function() {
  29. this.route('index', { path: '/' });
  30. this.route('page', { path: ':page/' });
  31. });
  32. this.route('online', { path: 'online/' }, function() {
  33. this.route('index', { path: '/' });
  34. });
  35. this.route('active', { path: 'active/' }, function() {
  36. this.route('index', { path: '/' });
  37. });
  38. });
  39. // User
  40. this.route('user', { path: 'user/:url_name/' });
  41. // Legal
  42. this.route('terms-of-service', { path: 'terms-of-service/' });
  43. this.route('privacy-policy', { path: 'privacy-policy/' });
  44. // Error
  45. this.route('error-0', { path: 'error-0/' });
  46. this.route('error-403', { path: 'error-403/:reason/' });
  47. this.route('error-404', { path: 'error-404/' });
  48. this.route('error-banned', { path: 'banned/:reason/' });
  49. this.route('not-found', { path: '*path' });
  50. });
  51. export default Router;