]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/videos-routing.module.ts
Design signup and login pages
[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 { MetaGuard } from '@ngx-meta/core'
4 import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
5 import { VideoTrendingComponent } from './video-list/video-trending.component'
6 import { VideosComponent } from './videos.component'
7
8 const videosRoutes: Routes = [
9 {
10 path: 'videos',
11 component: VideosComponent,
12 canActivateChild: [ MetaGuard ],
13 children: [
14 {
15 path: 'list',
16 pathMatch: 'full',
17 redirectTo: 'recently-added'
18 },
19 {
20 path: 'trending',
21 component: VideoTrendingComponent,
22 data: {
23 meta: {
24 title: 'Trending videos'
25 }
26 }
27 },
28 {
29 path: 'recently-added',
30 component: VideoRecentlyAddedComponent,
31 data: {
32 meta: {
33 title: 'Recently added videos'
34 }
35 }
36 },
37 {
38 path: 'upload',
39 loadChildren: 'app/videos/+video-edit#VideoAddModule',
40 data: {
41 meta: {
42 title: 'Upload a video'
43 }
44 }
45 },
46 {
47 path: 'edit/:uuid',
48 loadChildren: 'app/videos/+video-edit#VideoUpdateModule',
49 data: {
50 meta: {
51 title: 'Edit a video'
52 }
53 }
54 },
55 {
56 path: ':uuid',
57 redirectTo: 'watch/:uuid'
58 },
59 {
60 path: 'watch/:uuid',
61 loadChildren: 'app/videos/+video-watch#VideoWatchModule',
62 data: {
63 preload: 3000
64 }
65 }
66 ]
67 }
68 ]
69
70 @NgModule({
71 imports: [ RouterModule.forChild(videosRoutes) ],
72 exports: [ RouterModule ]
73 })
74 export class VideosRoutingModule {}