Skip to content
Snippets Groups Projects
router.js 1.38 KiB
Newer Older
  • Learn to ignore specific revisions
  • import EmberRouter from '@ember/routing/router';
    import config from 'papermerge/config/environment';
    
    export default class Router extends EmberRouter {
      location = config.locationType;
      rootURL = config.rootURL;
    }
    
    
    Router.map(function () {
    
      this.route('authenticated', { path: '' }, function () {
    
        this.route('documents');
        this.route('document', { path: '/document/:document_id' });
    
    
    Eugen Ciur's avatar
    Eugen Ciur committed
        this.route('nodes', { path: '/nodes/:node_id' });
    
    
        this.route('tags');
    
    
    Eugen Ciur's avatar
    Eugen Ciur committed
        this.route('tokens');
    
    
        this.route('automates', function () {
          this.route('add');
          this.route('edit', { path: '/:automate_id/edit' });
          this.route('index', { path: '/' });
        });
    
        this.route('roles', function () {
          this.route('add');
          this.route('edit', { path: '/:role_id/edit' });
          this.route('index', { path: '/' });
        });
    
        this.route('users', function () {
          this.route('add');
          this.route('edit', { path: '/:user_id/edit' });
    
          this.route('change_password', { path: '/:user_id/change-password' });
    
          this.route('index', { path: '/' });
        });
    
        this.route('groups', function () {
          this.route('index', { path: '/' });
        });
    
    Eugen Ciur's avatar
    Eugen Ciur committed
    
        this.route('preferences', function() {
          this.route('index', { path: '/' });
          this.route('section', { path: '/:section_name' });
        });
    
    Eugen Ciur's avatar
    Eugen Ciur committed
    
    
      this.route('login');
    
    Eugen Ciur's avatar
    Eugen Ciur committed
      this.route('not-found', { path: '/*path' });