]>
Commit | Line | Data |
---|---|---|
1 | import { NgModule } from '@angular/core' | |
2 | import { RouterModule, Routes } from '@angular/router' | |
3 | import { LoginGuard } from '../core' | |
4 | import { MyHistoryComponent } from './my-history/my-history.component' | |
5 | import { MyLibraryComponent } from './my-library.component' | |
6 | import { MyOwnershipComponent } from './my-ownership/my-ownership.component' | |
7 | import { MySubscriptionsComponent } from './my-subscriptions/my-subscriptions.component' | |
8 | import { MyVideoImportsComponent } from './my-video-imports/my-video-imports.component' | |
9 | import { MyVideoPlaylistCreateComponent } from './my-video-playlists/my-video-playlist-create.component' | |
10 | import { MyVideoPlaylistElementsComponent } from './my-video-playlists/my-video-playlist-elements.component' | |
11 | import { MyVideoPlaylistUpdateComponent } from './my-video-playlists/my-video-playlist-update.component' | |
12 | import { MyVideoPlaylistsComponent } from './my-video-playlists/my-video-playlists.component' | |
13 | import { MyVideosComponent } from './my-videos/my-videos.component' | |
14 | ||
15 | const myLibraryRoutes: Routes = [ | |
16 | { | |
17 | path: '', | |
18 | component: MyLibraryComponent, | |
19 | canActivateChild: [ LoginGuard ], | |
20 | children: [ | |
21 | { | |
22 | path: '', | |
23 | redirectTo: 'video-channels', | |
24 | pathMatch: 'full' | |
25 | }, | |
26 | ||
27 | { | |
28 | path: 'video-channels', | |
29 | loadChildren: () => { | |
30 | return import('./+my-video-channels/my-video-channels.module').then(m => m.MyVideoChannelsModule) | |
31 | } | |
32 | }, | |
33 | ||
34 | { | |
35 | path: 'video-playlists', | |
36 | component: MyVideoPlaylistsComponent, | |
37 | data: { | |
38 | meta: { | |
39 | title: $localize`My playlists` | |
40 | } | |
41 | } | |
42 | }, | |
43 | { | |
44 | path: 'video-playlists/create', | |
45 | component: MyVideoPlaylistCreateComponent, | |
46 | data: { | |
47 | meta: { | |
48 | title: $localize`Create a new playlist` | |
49 | } | |
50 | } | |
51 | }, | |
52 | { | |
53 | path: 'video-playlists/:videoPlaylistId', | |
54 | component: MyVideoPlaylistElementsComponent, | |
55 | data: { | |
56 | meta: { | |
57 | title: $localize`Playlist elements` | |
58 | } | |
59 | } | |
60 | }, | |
61 | { | |
62 | path: 'video-playlists/update/:videoPlaylistId', | |
63 | component: MyVideoPlaylistUpdateComponent, | |
64 | data: { | |
65 | meta: { | |
66 | title: $localize`Update playlist` | |
67 | } | |
68 | } | |
69 | }, | |
70 | ||
71 | { | |
72 | path: 'videos', | |
73 | component: MyVideosComponent, | |
74 | data: { | |
75 | meta: { | |
76 | title: $localize`My videos` | |
77 | }, | |
78 | reuse: { | |
79 | enabled: true, | |
80 | key: 'my-videos-list' | |
81 | } | |
82 | } | |
83 | }, | |
84 | { | |
85 | path: 'video-imports', | |
86 | component: MyVideoImportsComponent, | |
87 | data: { | |
88 | meta: { | |
89 | title: $localize`My video imports` | |
90 | } | |
91 | } | |
92 | }, | |
93 | { | |
94 | path: 'subscriptions', | |
95 | component: MySubscriptionsComponent, | |
96 | data: { | |
97 | meta: { | |
98 | title: $localize`My subscriptions` | |
99 | } | |
100 | } | |
101 | }, | |
102 | { | |
103 | path: 'ownership', | |
104 | component: MyOwnershipComponent, | |
105 | data: { | |
106 | meta: { | |
107 | title: $localize`Ownership changes` | |
108 | } | |
109 | } | |
110 | }, | |
111 | ||
112 | { | |
113 | path: 'history/videos', | |
114 | component: MyHistoryComponent, | |
115 | data: { | |
116 | meta: { | |
117 | title: $localize`My video history` | |
118 | }, | |
119 | reuse: { | |
120 | enabled: true, | |
121 | key: 'my-videos-history-list' | |
122 | } | |
123 | } | |
124 | } | |
125 | ] | |
126 | } | |
127 | ] | |
128 | ||
129 | @NgModule({ | |
130 | imports: [ RouterModule.forChild(myLibraryRoutes) ], | |
131 | exports: [ RouterModule ] | |
132 | }) | |
133 | export class MyLibraryRoutingModule {} |