]>
Commit | Line | Data |
---|---|---|
df98563e | 1 | import { NgModule } from '@angular/core' |
57c36b27 | 2 | import { RouterModule, Routes } from '@angular/router' |
ba5d4a84 | 3 | import { LoginGuard } from '@app/core' |
ba5d4a84 | 4 | import { VideoTrendingComponent } from './video-list' |
1942f11d C |
5 | import { VideoOverviewComponent } from './video-list/overview/video-overview.component' |
6 | import { VideoLocalComponent } from './video-list/video-local.component' | |
9bf9d2a5 | 7 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' |
67ed6552 | 8 | import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component' |
1942f11d | 9 | import { VideosComponent } from './videos.component' |
0629423c | 10 | |
693b1aba | 11 | const videosRoutes: Routes = [ |
0629423c | 12 | { |
1942f11d | 13 | path: '', |
0629423c C |
14 | component: VideosComponent, |
15 | children: [ | |
2d3741d6 C |
16 | { |
17 | path: 'overview', | |
18 | component: VideoOverviewComponent, | |
19 | data: { | |
20 | meta: { | |
f29f487e | 21 | title: $localize`Discover videos` |
2d3741d6 C |
22 | } |
23 | } | |
24 | }, | |
0629423c | 25 | { |
9bf9d2a5 | 26 | path: 'trending', |
ba5d4a84 | 27 | component: VideoTrendingComponent, |
9bf9d2a5 C |
28 | data: { |
29 | meta: { | |
ba5d4a84 | 30 | title: $localize`Trending videos` |
5bcbcbe3 RK |
31 | } |
32 | } | |
33 | }, | |
c07eb946 JM |
34 | { |
35 | path: 'most-liked', | |
ba5d4a84 | 36 | redirectTo: 'trending?alg=most-liked' |
c07eb946 | 37 | }, |
9bf9d2a5 C |
38 | { |
39 | path: 'recently-added', | |
40 | component: VideoRecentlyAddedComponent, | |
b58c69a1 C |
41 | data: { |
42 | meta: { | |
f29f487e | 43 | title: $localize`Recently added videos` |
489290b8 C |
44 | }, |
45 | reuse: { | |
46 | enabled: true, | |
47 | key: 'recently-added-videos-list' | |
b58c69a1 C |
48 | } |
49 | } | |
0629423c | 50 | }, |
066e94c5 | 51 | { |
22a16e36 | 52 | path: 'subscriptions', |
b2dd58a8 | 53 | canActivate: [ LoginGuard ], |
22a16e36 C |
54 | component: VideoUserSubscriptionsComponent, |
55 | data: { | |
56 | meta: { | |
f29f487e | 57 | title: $localize`Subscriptions` |
489290b8 C |
58 | }, |
59 | reuse: { | |
60 | enabled: true, | |
61 | key: 'subscription-videos-list' | |
22a16e36 C |
62 | } |
63 | } | |
64 | }, | |
65 | { | |
066e94c5 C |
66 | path: 'local', |
67 | component: VideoLocalComponent, | |
68 | data: { | |
69 | meta: { | |
f29f487e | 70 | title: $localize`Local videos` |
489290b8 C |
71 | }, |
72 | reuse: { | |
73 | enabled: true, | |
74 | key: 'local-videos-list' | |
066e94c5 C |
75 | } |
76 | } | |
0629423c C |
77 | } |
78 | ] | |
79 | } | |
df98563e | 80 | ] |
693b1aba C |
81 | |
82 | @NgModule({ | |
83 | imports: [ RouterModule.forChild(videosRoutes) ], | |
84 | exports: [ RouterModule ] | |
85 | }) | |
86 | export class VideosRoutingModule {} |