Move subscription helper in the account line
[oweals/peertube.git] / client / src / app / videos / videos-routing.module.ts
1 import { NgModule } from '@angular/core'
2 import { RouterModule, Routes } from '@angular/router'
3 import { VideoLocalComponent } from '@app/videos/video-list/video-local.component'
4 import { MetaGuard } from '@ngx-meta/core'
5 import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
6 import { VideoTrendingComponent } from './video-list/video-trending.component'
7 import { VideosComponent } from './videos.component'
8
9 const videosRoutes: Routes = [
10   {
11     path: 'videos',
12     component: VideosComponent,
13     canActivateChild: [ MetaGuard ],
14     children: [
15       {
16         path: 'list',
17         pathMatch: 'full',
18         redirectTo: 'recently-added'
19       },
20       {
21         path: 'trending',
22         component: VideoTrendingComponent,
23         data: {
24           meta: {
25             title: 'Trending videos'
26           }
27         }
28       },
29       {
30         path: 'recently-added',
31         component: VideoRecentlyAddedComponent,
32         data: {
33           meta: {
34             title: 'Recently added videos'
35           }
36         }
37       },
38       {
39         path: 'local',
40         component: VideoLocalComponent,
41         data: {
42           meta: {
43             title: 'Local videos'
44           }
45         }
46       },
47       {
48         path: 'upload',
49         loadChildren: 'app/videos/+video-edit/video-add.module#VideoAddModule',
50         data: {
51           meta: {
52             title: 'Upload a video'
53           }
54         }
55       },
56       {
57         path: 'update/:uuid',
58         loadChildren: 'app/videos/+video-edit/video-update.module#VideoUpdateModule',
59         data: {
60           meta: {
61             title: 'Edit a video'
62           }
63         }
64       },
65       {
66         path: 'watch/:uuid/comments/:commentId',
67         redirectTo: 'watch/:uuid'
68       },
69       {
70         path: 'watch/:uuid',
71         loadChildren: 'app/videos/+video-watch/video-watch.module#VideoWatchModule',
72         data: {
73           preload: 3000
74         }
75       }
76     ]
77   }
78 ]
79
80 @NgModule({
81   imports: [ RouterModule.forChild(videosRoutes) ],
82   exports: [ RouterModule ]
83 })
84 export class VideosRoutingModule {}