]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/videos-routing.module.ts
Add "local" videos in menu
[github/Chocobozzz/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 { VideoSearchComponent } from './video-list'
6 import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
7 import { VideoTrendingComponent } from './video-list/video-trending.component'
8 import { VideosComponent } from './videos.component'
9
10 const videosRoutes: Routes = [
11 {
12 path: 'videos',
13 component: VideosComponent,
14 canActivateChild: [ MetaGuard ],
15 children: [
16 {
17 path: 'list',
18 pathMatch: 'full',
19 redirectTo: 'recently-added'
20 },
21 {
22 path: 'trending',
23 component: VideoTrendingComponent,
24 data: {
25 meta: {
26 title: 'Trending videos'
27 }
28 }
29 },
30 {
31 path: 'recently-added',
32 component: VideoRecentlyAddedComponent,
33 data: {
34 meta: {
35 title: 'Recently added videos'
36 }
37 }
38 },
39 {
40 path: 'local',
41 component: VideoLocalComponent,
42 data: {
43 meta: {
44 title: 'Local videos'
45 }
46 }
47 },
48 {
49 path: 'search',
50 component: VideoSearchComponent,
51 data: {
52 meta: {
53 title: 'Search videos'
54 }
55 }
56 },
57 {
58 path: 'upload',
59 loadChildren: 'app/videos/+video-edit/video-add.module#VideoAddModule',
60 data: {
61 meta: {
62 title: 'Upload a video'
63 }
64 }
65 },
66 {
67 path: 'edit/:uuid',
68 loadChildren: 'app/videos/+video-edit/video-update.module#VideoUpdateModule',
69 data: {
70 meta: {
71 title: 'Edit a video'
72 }
73 }
74 },
75 {
76 path: ':uuid',
77 pathMatch: 'full',
78 redirectTo: 'watch/:uuid'
79 },
80 {
81 path: 'watch/:uuid',
82 loadChildren: 'app/videos/+video-watch/video-watch.module#VideoWatchModule',
83 data: {
84 preload: 3000
85 }
86 }
87 ]
88 }
89 ]
90
91 @NgModule({
92 imports: [ RouterModule.forChild(videosRoutes) ],
93 exports: [ RouterModule ]
94 })
95 export class VideosRoutingModule {}