]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+videos/videos-routing.module.ts
b6850b436fd8d17b896befc51b73b070c8ff5db0
[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 { LoginGuard } from '@app/core'
4 import { MetaGuard } from '@ngx-meta/core'
5 import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
6 import { VideoHotComponent } from './video-list/trending/video-hot.component'
7 import { VideoMostLikedComponent } from './video-list/trending/video-most-liked.component'
8 import { VideoTrendingComponent } from './video-list/trending/video-trending.component'
9 import { VideoLocalComponent } from './video-list/video-local.component'
10 import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
11 import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
12 import { VideosComponent } from './videos.component'
13
14 const videosRoutes: Routes = [
15 {
16 path: '',
17 component: VideosComponent,
18 canActivateChild: [ MetaGuard ],
19 children: [
20 {
21 path: 'overview',
22 component: VideoOverviewComponent,
23 data: {
24 meta: {
25 title: $localize`Discover videos`
26 }
27 }
28 },
29 {
30 path: 'trending',
31 component: VideoTrendingComponent,
32 data: {
33 meta: {
34 title: $localize`Trending videos`
35 },
36 reuse: {
37 enabled: true,
38 key: 'trending-videos-list'
39 }
40 }
41 },
42 {
43 path: 'hot',
44 component: VideoHotComponent,
45 data: {
46 meta: {
47 title: $localize`Hot videos`
48 },
49 reuse: {
50 enabled: true,
51 key: 'hot-videos-list'
52 }
53 }
54 },
55 {
56 path: 'most-liked',
57 component: VideoMostLikedComponent,
58 data: {
59 meta: {
60 title: $localize`Most liked videos`
61 },
62 reuse: {
63 enabled: true,
64 key: 'most-liked-videos-list'
65 }
66 }
67 },
68 {
69 path: 'recently-added',
70 component: VideoRecentlyAddedComponent,
71 data: {
72 meta: {
73 title: $localize`Recently added videos`
74 },
75 reuse: {
76 enabled: true,
77 key: 'recently-added-videos-list'
78 }
79 }
80 },
81 {
82 path: 'subscriptions',
83 canActivate: [ LoginGuard ],
84 component: VideoUserSubscriptionsComponent,
85 data: {
86 meta: {
87 title: $localize`Subscriptions`
88 },
89 reuse: {
90 enabled: true,
91 key: 'subscription-videos-list'
92 }
93 }
94 },
95 {
96 path: 'local',
97 component: VideoLocalComponent,
98 data: {
99 meta: {
100 title: $localize`Local videos`
101 },
102 reuse: {
103 enabled: true,
104 key: 'local-videos-list'
105 }
106 }
107 },
108 {
109 path: 'upload',
110 loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule),
111 data: {
112 meta: {
113 title: $localize`Upload a video`
114 }
115 }
116 },
117 {
118 path: 'update/:uuid',
119 loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule),
120 data: {
121 meta: {
122 title: $localize`Edit a video`
123 }
124 }
125 },
126 {
127 path: 'watch',
128 loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule),
129 data: {
130 preload: 3000
131 }
132 }
133 ]
134 }
135 ]
136
137 @NgModule({
138 imports: [ RouterModule.forChild(videosRoutes) ],
139 exports: [ RouterModule ]
140 })
141 export class VideosRoutingModule {}