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