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