X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fapp%2Fvideos%2Fvideos-routing.module.ts;h=225b6b018abc02bfb50dbf627b2d9f7069846cfe;hb=a685e25ca05f08ad1b3f7fbaccc8744727bd8d27;hp=005e9def6548bf39e41c50935dc67f3c81e17d3c;hpb=55b3394641a764b89132d0057d3fdf656dab2389;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/videos-routing.module.ts b/client/src/app/videos/videos-routing.module.ts index 005e9def6..225b6b018 100644 --- a/client/src/app/videos/videos-routing.module.ts +++ b/client/src/app/videos/videos-routing.module.ts @@ -1,15 +1,16 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; +import { NgModule } from '@angular/core' +import { RouterModule, Routes } from '@angular/router' -import { VideoAddComponent } from './video-add'; -import { VideoListComponent } from './video-list'; -import { VideosComponent } from './videos.component'; -import { VideoWatchComponent } from './video-watch'; +import { MetaGuard } from '@ngx-meta/core' + +import { VideoListComponent } from './video-list' +import { VideosComponent } from './videos.component' const videosRoutes: Routes = [ { path: 'videos', component: VideosComponent, + canActivateChild: [ MetaGuard ], children: [ { path: 'list', @@ -22,7 +23,7 @@ const videosRoutes: Routes = [ }, { path: 'add', - component: VideoAddComponent, + loadChildren: 'app/videos/+video-edit#VideoAddModule', data: { meta: { title: 'Add a video' @@ -30,16 +31,28 @@ const videosRoutes: Routes = [ } }, { - path: ':id', - redirectTo: 'watch/:id' + path: 'edit/:uuid', + loadChildren: 'app/videos/+video-edit#VideoUpdateModule', + data: { + meta: { + title: 'Edit a video' + } + } }, { - path: 'watch/:id', - component: VideoWatchComponent + path: ':uuid', + redirectTo: 'watch/:uuid' + }, + { + path: 'watch/:uuid', + loadChildren: 'app/videos/+video-watch#VideoWatchModule', + data: { + preload: 3000 + } } ] } -]; +] @NgModule({ imports: [ RouterModule.forChild(videosRoutes) ],