]>
Commit | Line | Data |
---|---|---|
1 | import { NgModule } from '@angular/core' | |
2 | import { RouterModule, Routes } from '@angular/router' | |
3 | import { MetaGuard } from '@ngx-meta/core' | |
4 | import { LoginGuard } from '../core' | |
5 | import { MyAccountAbusesListComponent } from './my-account-abuses/my-account-abuses-list.component' | |
6 | import { MyAccountBlocklistComponent } from './my-account-blocklist/my-account-blocklist.component' | |
7 | import { MyAccountServerBlocklistComponent } from './my-account-blocklist/my-account-server-blocklist.component' | |
8 | import { MyAccountNotificationsComponent } from './my-account-notifications/my-account-notifications.component' | |
9 | import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' | |
10 | import { MyAccountComponent } from './my-account.component' | |
11 | import { MyAccountApplicationsComponent } from './my-account-applications/my-account-applications.component' | |
12 | ||
13 | const myAccountRoutes: Routes = [ | |
14 | { | |
15 | path: '', | |
16 | component: MyAccountComponent, | |
17 | canActivateChild: [ MetaGuard, LoginGuard ], | |
18 | children: [ | |
19 | { | |
20 | path: '', | |
21 | redirectTo: 'settings', | |
22 | pathMatch: 'full' | |
23 | }, | |
24 | { | |
25 | path: 'settings', | |
26 | component: MyAccountSettingsComponent, | |
27 | data: { | |
28 | meta: { | |
29 | title: $localize`Account settings` | |
30 | } | |
31 | } | |
32 | }, | |
33 | ||
34 | { | |
35 | path: 'video-channels', | |
36 | redirectTo: '/my-library/video-channels', | |
37 | pathMatch: 'full' | |
38 | }, | |
39 | ||
40 | { | |
41 | path: 'video-playlists', | |
42 | redirectTo: '/my-library/video-playlists', | |
43 | pathMatch: 'full' | |
44 | }, | |
45 | { | |
46 | path: 'video-playlists/create', | |
47 | redirectTo: '/my-library/video-playlists/create', | |
48 | pathMatch: 'full' | |
49 | }, | |
50 | { | |
51 | path: 'video-playlists/:videoPlaylistId', | |
52 | redirectTo: '/my-library/video-playlists/:videoPlaylistId', | |
53 | pathMatch: 'full' | |
54 | }, | |
55 | { | |
56 | path: 'video-playlists/update/:videoPlaylistId', | |
57 | redirectTo: '/my-library/video-playlists/update/:videoPlaylistId', | |
58 | pathMatch: 'full' | |
59 | }, | |
60 | ||
61 | { | |
62 | path: 'videos', | |
63 | redirectTo: '/my-library/videos', | |
64 | pathMatch: 'full' | |
65 | }, | |
66 | { | |
67 | path: 'video-imports', | |
68 | redirectTo: '/my-library/video-imports', | |
69 | pathMatch: 'full' | |
70 | }, | |
71 | { | |
72 | path: 'subscriptions', | |
73 | redirectTo: '/my-library/subscriptions', | |
74 | pathMatch: 'full' | |
75 | }, | |
76 | { | |
77 | path: 'ownership', | |
78 | redirectTo: '/my-library/ownership', | |
79 | pathMatch: 'full' | |
80 | }, | |
81 | { | |
82 | path: 'blocklist/accounts', | |
83 | component: MyAccountBlocklistComponent, | |
84 | data: { | |
85 | meta: { | |
86 | title: $localize`Muted accounts` | |
87 | } | |
88 | } | |
89 | }, | |
90 | { | |
91 | path: 'blocklist/servers', | |
92 | component: MyAccountServerBlocklistComponent, | |
93 | data: { | |
94 | meta: { | |
95 | title: $localize`Muted servers` | |
96 | } | |
97 | } | |
98 | }, | |
99 | { | |
100 | path: 'history/videos', | |
101 | redirectTo: '/my-library/history/videos', | |
102 | pathMatch: 'full' | |
103 | }, | |
104 | { | |
105 | path: 'notifications', | |
106 | component: MyAccountNotificationsComponent, | |
107 | data: { | |
108 | meta: { | |
109 | title: $localize`Notifications` | |
110 | } | |
111 | } | |
112 | }, | |
113 | { | |
114 | path: 'abuses', | |
115 | component: MyAccountAbusesListComponent, | |
116 | data: { | |
117 | meta: { | |
118 | title: $localize`My abuse reports` | |
119 | } | |
120 | } | |
121 | }, | |
122 | { | |
123 | path: 'applications', | |
124 | component: MyAccountApplicationsComponent, | |
125 | data: { | |
126 | meta: { | |
127 | title: $localize`Applications` | |
128 | } | |
129 | } | |
130 | } | |
131 | ] | |
132 | } | |
133 | ] | |
134 | ||
135 | @NgModule({ | |
136 | imports: [ RouterModule.forChild(myAccountRoutes) ], | |
137 | exports: [ RouterModule ] | |
138 | }) | |
139 | export class MyAccountRoutingModule {} |