]>
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 { AccountsComponent } from './accounts.component' | |
5 | import { AccountVideosComponent } from './account-videos/account-videos.component' | |
6 | import { AccountAboutComponent } from './account-about/account-about.component' | |
7 | import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' | |
8 | import { AccountSearchComponent } from './account-search/account-search.component' | |
9 | ||
10 | const accountsRoutes: Routes = [ | |
11 | { | |
12 | path: 'peertube', | |
13 | redirectTo: '/videos/local' | |
14 | }, | |
15 | { | |
16 | path: ':accountId', | |
17 | component: AccountsComponent, | |
18 | canActivateChild: [ MetaGuard ], | |
19 | children: [ | |
20 | { | |
21 | path: '', | |
22 | redirectTo: 'video-channels', | |
23 | pathMatch: 'full' | |
24 | }, | |
25 | { | |
26 | path: 'video-channels', | |
27 | component: AccountVideoChannelsComponent, | |
28 | data: { | |
29 | meta: { | |
30 | title: $localize`Account video channels` | |
31 | } | |
32 | } | |
33 | }, | |
34 | { | |
35 | path: 'about', | |
36 | component: AccountAboutComponent, | |
37 | data: { | |
38 | meta: { | |
39 | title: $localize`About account` | |
40 | } | |
41 | } | |
42 | }, | |
43 | { | |
44 | path: 'videos', | |
45 | component: AccountVideosComponent, | |
46 | data: { | |
47 | meta: { | |
48 | title: $localize`Account videos` | |
49 | }, | |
50 | reuse: { | |
51 | enabled: true, | |
52 | key: 'account-videos-list' | |
53 | } | |
54 | } | |
55 | }, | |
56 | { | |
57 | path: 'search', | |
58 | component: AccountSearchComponent, | |
59 | data: { | |
60 | meta: { | |
61 | title: $localize`Search videos within account` | |
62 | } | |
63 | } | |
64 | } | |
65 | ] | |
66 | } | |
67 | ] | |
68 | ||
69 | @NgModule({ | |
70 | imports: [ RouterModule.forChild(accountsRoutes) ], | |
71 | exports: [ RouterModule ] | |
72 | }) | |
73 | export class AccountsRoutingModule {} |