]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+videos/videos-routing.module.ts
Move to sass module
[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 { VideoTrendingComponent } from './video-list'
5 import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
6 import { VideoLocalComponent } from './video-list/video-local.component'
7 import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
8 import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
9 import { VideosComponent } from './videos.component'
10
11 const videosRoutes: Routes = [
12 {
13 path: '',
14 component: VideosComponent,
15 children: [
16 {
17 path: 'overview',
18 component: VideoOverviewComponent,
19 data: {
20 meta: {
21 title: $localize`Discover videos`
22 }
23 }
24 },
25 {
26 path: 'trending',
27 component: VideoTrendingComponent,
28 data: {
29 meta: {
30 title: $localize`Trending videos`
31 }
32 }
33 },
34 {
35 path: 'most-liked',
36 redirectTo: 'trending?alg=most-liked'
37 },
38 {
39 path: 'recently-added',
40 component: VideoRecentlyAddedComponent,
41 data: {
42 meta: {
43 title: $localize`Recently added videos`
44 },
45 reuse: {
46 enabled: true,
47 key: 'recently-added-videos-list'
48 }
49 }
50 },
51 {
52 path: 'subscriptions',
53 canActivate: [ LoginGuard ],
54 component: VideoUserSubscriptionsComponent,
55 data: {
56 meta: {
57 title: $localize`Subscriptions`
58 },
59 reuse: {
60 enabled: true,
61 key: 'subscription-videos-list'
62 }
63 }
64 },
65 {
66 path: 'local',
67 component: VideoLocalComponent,
68 data: {
69 meta: {
70 title: $localize`Local videos`
71 },
72 reuse: {
73 enabled: true,
74 key: 'local-videos-list'
75 }
76 }
77 }
78 ]
79 }
80 ]
81
82 @NgModule({
83 imports: [ RouterModule.forChild(videosRoutes) ],
84 exports: [ RouterModule ]
85 })
86 export class VideosRoutingModule {}