Merge branch 'master' into develop
[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
17 const myAccountRoutes: Routes = [
18   {
19     path: '',
20     component: MyAccountComponent,
21     canActivateChild: [ MetaGuard, LoginGuard ],
22     children: [
23       {
24         path: '',
25         redirectTo: 'settings',
26         pathMatch: 'full'
27       },
28       {
29         path: 'settings',
30         component: MyAccountSettingsComponent,
31         data: {
32           meta: {
33             title: 'Account settings'
34           }
35         }
36       },
37       {
38         path: 'video-channels',
39         component: MyAccountVideoChannelsComponent,
40         data: {
41           meta: {
42             title: 'Account video channels'
43           }
44         }
45       },
46       {
47         path: 'video-channels/create',
48         component: MyAccountVideoChannelCreateComponent,
49         data: {
50           meta: {
51             title: 'Create new video channel'
52           }
53         }
54       },
55       {
56         path: 'video-channels/update/:videoChannelId',
57         component: MyAccountVideoChannelUpdateComponent,
58         data: {
59           meta: {
60             title: 'Update video channel'
61           }
62         }
63       },
64       {
65         path: 'videos',
66         component: MyAccountVideosComponent,
67         data: {
68           meta: {
69             title: 'Account videos'
70           }
71         }
72       },
73       {
74         path: 'video-imports',
75         component: MyAccountVideoImportsComponent,
76         data: {
77           meta: {
78             title: 'Account video imports'
79           }
80         }
81       },
82       {
83         path: 'subscriptions',
84         component: MyAccountSubscriptionsComponent,
85         data: {
86           meta: {
87             title: 'Account subscriptions'
88           }
89         }
90       },
91       {
92         path: 'ownership',
93         component: MyAccountOwnershipComponent,
94         data: {
95           meta: {
96             title: 'Ownership changes'
97           }
98         }
99       },
100       {
101         path: 'blocklist/accounts',
102         component: MyAccountBlocklistComponent,
103         data: {
104           meta: {
105             title: 'Muted accounts'
106           }
107         }
108       },
109       {
110         path: 'blocklist/servers',
111         component: MyAccountServerBlocklistComponent,
112         data: {
113           meta: {
114             title: 'Muted instances'
115           }
116         }
117       }
118     ]
119   }
120 ]
121
122 @NgModule({
123   imports: [ RouterModule.forChild(myAccountRoutes) ],
124   exports: [ RouterModule ]
125 })
126 export class MyAccountRoutingModule {}