Refactor my-subscribe-button to support full account subscription
[oweals/peertube.git] / client / src / app / +my-account / my-account-routing.module.ts
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 { MyAccountComponent } from './my-account.component'
6 import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component'
7 import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component'
8 import { MyAccountVideoChannelsComponent } from '@app/+my-account/my-account-video-channels/my-account-video-channels.component'
9 import { MyAccountVideoChannelCreateComponent } from '@app/+my-account/my-account-video-channels/my-account-video-channel-create.component'
10 import { MyAccountVideoChannelUpdateComponent } from '@app/+my-account/my-account-video-channels/my-account-video-channel-update.component'
11 import { MyAccountVideoImportsComponent } from '@app/+my-account/my-account-video-imports/my-account-video-imports.component'
12 import { MyAccountSubscriptionsComponent } from '@app/+my-account/my-account-subscriptions/my-account-subscriptions.component'
13 import { MyAccountOwnershipComponent } from '@app/+my-account/my-account-ownership/my-account-ownership.component'
14 import { MyAccountBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-blocklist.component'
15 import { MyAccountServerBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-server-blocklist.component'
16 import { MyAccountHistoryComponent } from '@app/+my-account/my-account-history/my-account-history.component'
17 import { MyAccountNotificationsComponent } from '@app/+my-account/my-account-notifications/my-account-notifications.component'
18 import { MyAccountVideoPlaylistsComponent } from '@app/+my-account/my-account-video-playlists/my-account-video-playlists.component'
19 import {
20   MyAccountVideoPlaylistCreateComponent
21 } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component'
22 import {
23   MyAccountVideoPlaylistUpdateComponent
24 } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component'
25 import {
26   MyAccountVideoPlaylistElementsComponent
27 } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component'
28
29 const myAccountRoutes: Routes = [
30   {
31     path: '',
32     component: MyAccountComponent,
33     canActivateChild: [ MetaGuard, LoginGuard ],
34     children: [
35       {
36         path: '',
37         redirectTo: 'settings',
38         pathMatch: 'full'
39       },
40       {
41         path: 'settings',
42         component: MyAccountSettingsComponent,
43         data: {
44           meta: {
45             title: 'Account settings'
46           }
47         }
48       },
49
50       {
51         path: 'video-channels',
52         component: MyAccountVideoChannelsComponent,
53         data: {
54           meta: {
55             title: 'Account video channels'
56           }
57         }
58       },
59       {
60         path: 'video-channels/create',
61         component: MyAccountVideoChannelCreateComponent,
62         data: {
63           meta: {
64             title: 'Create new video channel'
65           }
66         }
67       },
68       {
69         path: 'video-channels/update/:videoChannelId',
70         component: MyAccountVideoChannelUpdateComponent,
71         data: {
72           meta: {
73             title: 'Update video channel'
74           }
75         }
76       },
77
78       {
79         path: 'video-playlists',
80         component: MyAccountVideoPlaylistsComponent,
81         data: {
82           meta: {
83             title: 'Account playlists'
84           }
85         }
86       },
87       {
88         path: 'video-playlists/create',
89         component: MyAccountVideoPlaylistCreateComponent,
90         data: {
91           meta: {
92             title: 'Create new playlist'
93           }
94         }
95       },
96       {
97         path: 'video-playlists/:videoPlaylistId',
98         component: MyAccountVideoPlaylistElementsComponent,
99         data: {
100           meta: {
101             title: 'Playlist elements'
102           }
103         }
104       },
105       {
106         path: 'video-playlists/update/:videoPlaylistId',
107         component: MyAccountVideoPlaylistUpdateComponent,
108         data: {
109           meta: {
110             title: 'Update playlist'
111           }
112         }
113       },
114
115       {
116         path: 'videos',
117         component: MyAccountVideosComponent,
118         data: {
119           meta: {
120             title: 'Account videos'
121           },
122           reuse: {
123             enabled: true,
124             key: 'my-account-videos-list'
125           }
126         }
127       },
128       {
129         path: 'video-imports',
130         component: MyAccountVideoImportsComponent,
131         data: {
132           meta: {
133             title: 'Account video imports'
134           }
135         }
136       },
137       {
138         path: 'subscriptions',
139         component: MyAccountSubscriptionsComponent,
140         data: {
141           meta: {
142             title: 'Account subscriptions'
143           }
144         }
145       },
146       {
147         path: 'ownership',
148         component: MyAccountOwnershipComponent,
149         data: {
150           meta: {
151             title: 'Ownership changes'
152           }
153         }
154       },
155       {
156         path: 'blocklist/accounts',
157         component: MyAccountBlocklistComponent,
158         data: {
159           meta: {
160             title: 'Muted accounts'
161           }
162         }
163       },
164       {
165         path: 'blocklist/servers',
166         component: MyAccountServerBlocklistComponent,
167         data: {
168           meta: {
169             title: 'Muted instances'
170           }
171         }
172       },
173       {
174         path: 'history/videos',
175         component: MyAccountHistoryComponent,
176         data: {
177           meta: {
178             title: 'Videos history'
179           },
180           reuse: {
181             enabled: true,
182             key: 'my-videos-history-list'
183           }
184         }
185       },
186       {
187         path: 'notifications',
188         component: MyAccountNotificationsComponent,
189         data: {
190           meta: {
191             title: 'Notifications'
192           }
193         }
194       }
195     ]
196   }
197 ]
198
199 @NgModule({
200   imports: [ RouterModule.forChild(myAccountRoutes) ],
201   exports: [ RouterModule ]
202 })
203 export class MyAccountRoutingModule {}