]>
Commit | Line | Data |
---|---|---|
df98563e | 1 | import { NgModule } from '@angular/core' |
57c36b27 | 2 | import { RouterModule, Routes } from '@angular/router' |
b2dd58a8 | 3 | import { LoginGuard } from '@app/core' |
8b13c289 | 4 | import { MetaGuard } from '@ngx-meta/core' |
1942f11d C |
5 | import { VideoOverviewComponent } from './video-list/overview/video-overview.component' |
6 | import { VideoLocalComponent } from './video-list/video-local.component' | |
7 | import { VideoMostLikedComponent } from './video-list/video-most-liked.component' | |
9bf9d2a5 C |
8 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' |
9 | import { VideoTrendingComponent } from './video-list/video-trending.component' | |
67ed6552 | 10 | import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component' |
1942f11d | 11 | import { VideosComponent } from './videos.component' |
0629423c | 12 | |
693b1aba | 13 | const videosRoutes: Routes = [ |
0629423c | 14 | { |
1942f11d | 15 | path: '', |
0629423c | 16 | component: VideosComponent, |
8b13c289 | 17 | canActivateChild: [ MetaGuard ], |
0629423c | 18 | children: [ |
2d3741d6 C |
19 | { |
20 | path: 'overview', | |
21 | component: VideoOverviewComponent, | |
22 | data: { | |
23 | meta: { | |
f29f487e | 24 | title: $localize`Discover videos` |
2d3741d6 C |
25 | } |
26 | } | |
27 | }, | |
0629423c | 28 | { |
9bf9d2a5 C |
29 | path: 'trending', |
30 | component: VideoTrendingComponent, | |
31 | data: { | |
32 | meta: { | |
f29f487e | 33 | title: $localize`Trending videos` |
489290b8 C |
34 | }, |
35 | reuse: { | |
36 | enabled: true, | |
37 | key: 'trending-videos-list' | |
9bf9d2a5 C |
38 | } |
39 | } | |
40 | }, | |
c07eb946 JM |
41 | { |
42 | path: 'most-liked', | |
43 | component: VideoMostLikedComponent, | |
44 | data: { | |
45 | meta: { | |
f29f487e | 46 | title: $localize`Most liked videos` |
c07eb946 JM |
47 | }, |
48 | reuse: { | |
49 | enabled: true, | |
50 | key: 'most-liked-videos-list' | |
51 | } | |
52 | } | |
53 | }, | |
9bf9d2a5 C |
54 | { |
55 | path: 'recently-added', | |
56 | component: VideoRecentlyAddedComponent, | |
b58c69a1 C |
57 | data: { |
58 | meta: { | |
f29f487e | 59 | title: $localize`Recently added videos` |
489290b8 C |
60 | }, |
61 | reuse: { | |
62 | enabled: true, | |
63 | key: 'recently-added-videos-list' | |
b58c69a1 C |
64 | } |
65 | } | |
0629423c | 66 | }, |
066e94c5 | 67 | { |
22a16e36 | 68 | path: 'subscriptions', |
b2dd58a8 | 69 | canActivate: [ LoginGuard ], |
22a16e36 C |
70 | component: VideoUserSubscriptionsComponent, |
71 | data: { | |
72 | meta: { | |
f29f487e | 73 | title: $localize`Subscriptions` |
489290b8 C |
74 | }, |
75 | reuse: { | |
76 | enabled: true, | |
77 | key: 'subscription-videos-list' | |
22a16e36 C |
78 | } |
79 | } | |
80 | }, | |
81 | { | |
066e94c5 C |
82 | path: 'local', |
83 | component: VideoLocalComponent, | |
84 | data: { | |
85 | meta: { | |
f29f487e | 86 | title: $localize`Local videos` |
489290b8 C |
87 | }, |
88 | reuse: { | |
89 | enabled: true, | |
90 | key: 'local-videos-list' | |
066e94c5 C |
91 | } |
92 | } | |
93 | }, | |
0629423c | 94 | { |
f47bf2e1 | 95 | path: 'upload', |
1942f11d | 96 | loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule), |
b58c69a1 C |
97 | data: { |
98 | meta: { | |
f29f487e | 99 | title: $localize`Upload a video` |
b58c69a1 C |
100 | } |
101 | } | |
0629423c | 102 | }, |
d8e689b8 | 103 | { |
c663955b | 104 | path: 'update/:uuid', |
1942f11d | 105 | loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule), |
d8e689b8 C |
106 | data: { |
107 | meta: { | |
f29f487e | 108 | title: $localize`Edit a video` |
d8e689b8 C |
109 | } |
110 | } | |
111 | }, | |
91219e66 | 112 | { |
f0a39880 | 113 | path: 'watch', |
1942f11d | 114 | loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule), |
a685e25c C |
115 | data: { |
116 | preload: 3000 | |
117 | } | |
0629423c C |
118 | } |
119 | ] | |
120 | } | |
df98563e | 121 | ] |
693b1aba C |
122 | |
123 | @NgModule({ | |
124 | imports: [ RouterModule.forChild(videosRoutes) ], | |
125 | exports: [ RouterModule ] | |
126 | }) | |
127 | export class VideosRoutingModule {} |