]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Implement video channel views
authorChocobozzz <me@florianbigard.com>
Wed, 25 Apr 2018 14:56:13 +0000 (16:56 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 25 Apr 2018 14:56:13 +0000 (16:56 +0200)
35 files changed:
client/src/app/+account/account.component.scss [deleted file]
client/src/app/+account/index.ts [deleted file]
client/src/app/+accounts/account-about/account-about.component.html [moved from client/src/app/+account/account-about/account-about.component.html with 100% similarity]
client/src/app/+accounts/account-about/account-about.component.scss [moved from client/src/app/+account/account-about/account-about.component.scss with 100% similarity]
client/src/app/+accounts/account-about/account-about.component.ts [moved from client/src/app/+account/account-about/account-about.component.ts with 100% similarity]
client/src/app/+accounts/account-video-channels/account-video-channels.component.html [moved from client/src/app/+account/account-video-channels/account-video-channels.component.html with 100% similarity]
client/src/app/+accounts/account-video-channels/account-video-channels.component.scss [moved from client/src/app/+account/account-video-channels/account-video-channels.component.scss with 100% similarity]
client/src/app/+accounts/account-video-channels/account-video-channels.component.ts [moved from client/src/app/+account/account-video-channels/account-video-channels.component.ts with 92% similarity]
client/src/app/+accounts/account-videos/account-videos.component.scss [moved from client/src/app/+account/account-videos/account-videos.component.scss with 100% similarity]
client/src/app/+accounts/account-videos/account-videos.component.ts [moved from client/src/app/+account/account-videos/account-videos.component.ts with 100% similarity]
client/src/app/+accounts/accounts-routing.module.ts [moved from client/src/app/+account/account-routing.module.ts with 84% similarity]
client/src/app/+accounts/accounts.component.html [moved from client/src/app/+account/account.component.html with 71% similarity]
client/src/app/+accounts/accounts.component.scss [new file with mode: 0644]
client/src/app/+accounts/accounts.component.ts [moved from client/src/app/+account/account.component.ts with 77% similarity]
client/src/app/+accounts/accounts.module.ts [moved from client/src/app/+account/account.module.ts with 70% similarity]
client/src/app/+accounts/index.ts [new file with mode: 0644]
client/src/app/+video-channels/index.ts [new file with mode: 0644]
client/src/app/+video-channels/video-channel-about/video-channel-about.component.html [new file with mode: 0644]
client/src/app/+video-channels/video-channel-about/video-channel-about.component.scss [new file with mode: 0644]
client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts [new file with mode: 0644]
client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.scss [new file with mode: 0644]
client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts [new file with mode: 0644]
client/src/app/+video-channels/video-channels-routing.module.ts [new file with mode: 0644]
client/src/app/+video-channels/video-channels.component.html [new file with mode: 0644]
client/src/app/+video-channels/video-channels.component.scss [new file with mode: 0644]
client/src/app/+video-channels/video-channels.component.ts [new file with mode: 0644]
client/src/app/+video-channels/video-channels.module.ts [new file with mode: 0644]
client/src/app/app-routing.module.ts
client/src/app/shared/video-channel/video-channel.service.ts
client/src/app/shared/video/video-miniature.component.html
client/src/app/shared/video/video.service.ts
client/src/app/videos/+video-watch/video-watch.component.html
client/src/sass/include/_mixins.scss
server/tests/api/check-params/videos.ts
server/tests/api/videos/multiple-servers.ts

diff --git a/client/src/app/+account/account.component.scss b/client/src/app/+account/account.component.scss
deleted file mode 100644 (file)
index c7b8f03..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-@import '_variables';
-@import '_mixins';
-
-.sub-menu {
-  height: 160px;
-  display: flex;
-  flex-direction: column;
-  align-items: start;
-
-  .account {
-    display: flex;
-    margin-top: 20px;
-    margin-bottom: 20px;
-
-    img {
-      @include avatar(80px);
-
-      margin-right: 20px;
-    }
-
-    .account-info {
-      display: flex;
-      flex-direction: column;
-      justify-content: center;
-
-      .account-display-name {
-        font-size: 23px;
-        font-weight: $font-bold;
-      }
-
-      .account-followers {
-        font-size: 15px;
-      }
-    }
-  }
-
-  .links {
-    margin-top: 0;
-    margin-bottom: 10px;
-
-    a {
-      margin-top: 0;
-      margin-bottom: 0;
-    }
-  }
-}
\ No newline at end of file
diff --git a/client/src/app/+account/index.ts b/client/src/app/+account/index.ts
deleted file mode 100644 (file)
index dc56ffd..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-export * from './account-routing.module'
-export * from './account.component'
-export * from './account.module'
similarity index 92%
rename from client/src/app/+account/account-video-channels/account-video-channels.component.ts
rename to client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
index 8915eb6229c78fb6bf04f2e8d9e788c54788a519..4c5782f9df0f644a533b01400d0ea85100cbe145 100644 (file)
@@ -26,7 +26,7 @@ export class AccountVideoChannelsComponent implements OnInit {
     // Parent get the account for us
     this.accountService.accountLoaded
         .do(account => this.account = account)
-        .flatMap(account => this.videoChannelService.getVideoChannels(account.id))
+        .flatMap(account => this.videoChannelService.listAccountVideoChannels(account.id))
         .map(res => res.data)
         .subscribe(videoChannels => this.videoChannels = videoChannels)
   }
similarity index 84%
rename from client/src/app/+account/account-routing.module.ts
rename to client/src/app/+accounts/accounts-routing.module.ts
index f72d8373fe98a762658a659dc0db35425d33e768..ffe606b4372aa5b7d7c56a80e4f0c71c00c92b31 100644 (file)
@@ -1,15 +1,15 @@
 import { NgModule } from '@angular/core'
 import { RouterModule, Routes } from '@angular/router'
 import { MetaGuard } from '@ngx-meta/core'
-import { AccountComponent } from './account.component'
+import { AccountsComponent } from './accounts.component'
 import { AccountVideosComponent } from './account-videos/account-videos.component'
 import { AccountAboutComponent } from './account-about/account-about.component'
 import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component'
 
-const accountRoutes: Routes = [
+const accountsRoutes: Routes = [
   {
     path: ':accountId',
-    component: AccountComponent,
+    component: AccountsComponent,
     canActivateChild: [ MetaGuard ],
     children: [
       {
@@ -49,7 +49,7 @@ const accountRoutes: Routes = [
 ]
 
 @NgModule({
-  imports: [ RouterModule.forChild(accountRoutes) ],
+  imports: [ RouterModule.forChild(accountsRoutes) ],
   exports: [ RouterModule ]
 })
-export class AccountRoutingModule {}
+export class AccountsRoutingModule {}
similarity index 71%
rename from client/src/app/+account/account.component.html
rename to client/src/app/+accounts/accounts.component.html
index d0e99edda0e840e5c1700ec75ebda898f654524d..549676e5a5fefa1384c44b0ace91d0f790cb462f 100644 (file)
@@ -1,12 +1,12 @@
 <div *ngIf="account" class="row">
   <div class="sub-menu">
 
-    <div class="account">
+    <div class="actor">
       <img [src]="account.avatarUrl" alt="Avatar" />
 
-      <div class="account-info">
-        <div class="account-display-name">{{ account.displayName }}</div>
-        <div class="account-followers">{{ account.followersCount }} subscribers</div>
+      <div class="actor-info">
+        <div class="actor-display-name">{{ account.displayName }}</div>
+        <div class="actor-followers">{{ account.followersCount }} subscribers</div>
       </div>
     </div>
 
diff --git a/client/src/app/+accounts/accounts.component.scss b/client/src/app/+accounts/accounts.component.scss
new file mode 100644 (file)
index 0000000..909b65b
--- /dev/null
@@ -0,0 +1,6 @@
+@import '_variables';
+@import '_mixins';
+
+.sub-menu {
+  @include sub-menu-with-actor;
+}
\ No newline at end of file
similarity index 77%
rename from client/src/app/+account/account.component.ts
rename to client/src/app/+accounts/accounts.component.ts
index d936ce2fe0d3ae8ac1ddd91971ba6d5eb62d4407..1298803c39a4c02c6e514876335cc8a7bcc2b952 100644 (file)
@@ -4,11 +4,10 @@ import { AccountService } from '@app/shared/account/account.service'
 import { Account } from '@app/shared/account/account.model'
 
 @Component({
-  selector: 'my-account',
-  templateUrl: './account.component.html',
-  styleUrls: [ './account.component.scss' ]
+  templateUrl: './accounts.component.html',
+  styleUrls: [ './accounts.component.scss' ]
 })
-export class AccountComponent implements OnInit {
+export class AccountsComponent implements OnInit {
   account: Account
 
   constructor (
similarity index 70%
rename from client/src/app/+account/account.module.ts
rename to client/src/app/+accounts/accounts.module.ts
index 82ef06e76d9129b42c93df5df9f6b7138a628ef7..8e679822a58eb686b84f61e2bcee25e7db6a714e 100644 (file)
@@ -1,28 +1,28 @@
 import { NgModule } from '@angular/core'
 import { SharedModule } from '../shared'
-import { AccountRoutingModule } from './account-routing.module'
-import { AccountComponent } from './account.component'
+import { AccountsRoutingModule } from './accounts-routing.module'
+import { AccountsComponent } from './accounts.component'
 import { AccountVideosComponent } from './account-videos/account-videos.component'
 import { AccountAboutComponent } from './account-about/account-about.component'
 import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component'
 
 @NgModule({
   imports: [
-    AccountRoutingModule,
+    AccountsRoutingModule,
     SharedModule
   ],
 
   declarations: [
-    AccountComponent,
+    AccountsComponent,
     AccountVideosComponent,
     AccountVideoChannelsComponent,
     AccountAboutComponent
   ],
 
   exports: [
-    AccountComponent
+    AccountsComponent
   ],
 
   providers: []
 })
-export class AccountModule { }
+export class AccountsModule { }
diff --git a/client/src/app/+accounts/index.ts b/client/src/app/+accounts/index.ts
new file mode 100644 (file)
index 0000000..4dfb6f5
--- /dev/null
@@ -0,0 +1,3 @@
+export * from './accounts-routing.module'
+export * from './accounts.component'
+export * from './accounts.module'
diff --git a/client/src/app/+video-channels/index.ts b/client/src/app/+video-channels/index.ts
new file mode 100644 (file)
index 0000000..6683d1b
--- /dev/null
@@ -0,0 +1,3 @@
+export * from './video-channels-routing.module'
+export * from './video-channels.component'
+export * from './video-channels.module'
diff --git a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.html b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.html
new file mode 100644 (file)
index 0000000..65ad6f5
--- /dev/null
@@ -0,0 +1,12 @@
+<div *ngIf="videoChannel" class="row">
+  <div class="description col-md-6 col-sm-12">
+    <div class="small-title">Description</div>
+    <div class="content">{{ getVideoChannelDescription() }}</div>
+  </div>
+
+  <div class="stats col-md-6 col-sm-12">
+    <div class="small-title">Stats</div>
+
+    <div class="content">Created {{ videoChannel.createdAt | date }}</div>
+  </div>
+</div>
\ No newline at end of file
diff --git a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.scss b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.scss
new file mode 100644 (file)
index 0000000..b1be7d4
--- /dev/null
@@ -0,0 +1,8 @@
+@import '_variables';
+@import '_mixins';
+
+.small-title {
+  @include in-content-small-title;
+
+  margin-bottom: 20px;
+}
diff --git a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
new file mode 100644 (file)
index 0000000..5d43570
--- /dev/null
@@ -0,0 +1,32 @@
+import { Component, OnInit } from '@angular/core'
+import { ActivatedRoute } from '@angular/router'
+import 'rxjs/add/observable/from'
+import 'rxjs/add/operator/concatAll'
+import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
+import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
+
+@Component({
+  selector: 'my-video-channel-about',
+  templateUrl: './video-channel-about.component.html',
+  styleUrls: [ './video-channel-about.component.scss' ]
+})
+export class VideoChannelAboutComponent implements OnInit {
+  videoChannel: VideoChannel
+
+  constructor (
+    protected route: ActivatedRoute,
+    private videoChannelService: VideoChannelService
+  ) { }
+
+  ngOnInit () {
+    // Parent get the video channel for us
+    this.videoChannelService.videoChannelLoaded
+      .subscribe(videoChannel => this.videoChannel = videoChannel)
+  }
+
+  getVideoChannelDescription () {
+    if (this.videoChannel.description) return this.videoChannel.description
+
+    return 'No description'
+  }
+}
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.scss b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.scss
new file mode 100644 (file)
index 0000000..2ba85c0
--- /dev/null
@@ -0,0 +1,3 @@
+.title-page-single {
+  margin-top: 0;
+}
\ No newline at end of file
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
new file mode 100644 (file)
index 0000000..3cda630
--- /dev/null
@@ -0,0 +1,71 @@
+import { Component, OnDestroy, OnInit } from '@angular/core'
+import { ActivatedRoute, Router } from '@angular/router'
+import { Location } from '@angular/common'
+import { immutableAssign } from '@app/shared/misc/utils'
+import { NotificationsService } from 'angular2-notifications'
+import 'rxjs/add/observable/from'
+import 'rxjs/add/operator/concatAll'
+import { AuthService } from '../../core/auth'
+import { ConfirmService } from '../../core/confirm'
+import { AbstractVideoList } from '../../shared/video/abstract-video-list'
+import { VideoService } from '../../shared/video/video.service'
+import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
+import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
+
+@Component({
+  selector: 'my-video-channel-videos',
+  templateUrl: '../../shared/video/abstract-video-list.html',
+  styleUrls: [
+    '../../shared/video/abstract-video-list.scss',
+    './video-channel-videos.component.scss'
+  ]
+})
+export class VideoChannelVideosComponent extends AbstractVideoList implements OnInit, OnDestroy {
+  titlePage = 'Published videos'
+  marginContent = false // Disable margin
+  currentRoute = '/video-channel/videos'
+  loadOnInit = false
+
+  private videoChannel: VideoChannel
+
+  constructor (
+    protected router: Router,
+    protected route: ActivatedRoute,
+    protected authService: AuthService,
+    protected notificationsService: NotificationsService,
+    protected confirmService: ConfirmService,
+    protected location: Location,
+    private videoChannelService: VideoChannelService,
+    private videoService: VideoService
+  ) {
+    super()
+  }
+
+  ngOnInit () {
+    super.ngOnInit()
+
+    // Parent get the video channel for us
+    this.videoChannelService.videoChannelLoaded
+      .subscribe(videoChannel => {
+        this.videoChannel = videoChannel
+        this.currentRoute = '/video-channel/' + this.videoChannel.uuid + '/videos'
+
+        this.loadMoreVideos(this.pagination.currentPage)
+        this.generateSyndicationList()
+      })
+  }
+
+  ngOnDestroy () {
+    super.ngOnDestroy()
+  }
+
+  getVideosObservable (page: number) {
+    const newPagination = immutableAssign(this.pagination, { currentPage: page })
+
+    return this.videoService.getVideoChannelVideos(this.videoChannel, newPagination, this.sort)
+  }
+
+  generateSyndicationList () {
+    this.syndicationItems = this.videoService.getVideoChannelFeedUrls(this.videoChannel.id)
+  }
+}
diff --git a/client/src/app/+video-channels/video-channels-routing.module.ts b/client/src/app/+video-channels/video-channels-routing.module.ts
new file mode 100644 (file)
index 0000000..935578d
--- /dev/null
@@ -0,0 +1,45 @@
+import { NgModule } from '@angular/core'
+import { RouterModule, Routes } from '@angular/router'
+import { MetaGuard } from '@ngx-meta/core'
+import { VideoChannelsComponent } from './video-channels.component'
+import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component'
+import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component'
+
+const videoChannelsRoutes: Routes = [
+  {
+    path: ':videoChannelId',
+    component: VideoChannelsComponent,
+    canActivateChild: [ MetaGuard ],
+    children: [
+      {
+        path: '',
+        redirectTo: 'videos',
+        pathMatch: 'full'
+      },
+      {
+        path: 'videos',
+        component: VideoChannelVideosComponent,
+        data: {
+          meta: {
+            title: 'Video channel videos'
+          }
+        }
+      },
+      {
+        path: 'about',
+        component: VideoChannelAboutComponent,
+        data: {
+          meta: {
+            title: 'About video channel'
+          }
+        }
+      }
+    ]
+  }
+]
+
+@NgModule({
+  imports: [ RouterModule.forChild(videoChannelsRoutes) ],
+  exports: [ RouterModule ]
+})
+export class VideoChannelsRoutingModule {}
diff --git a/client/src/app/+video-channels/video-channels.component.html b/client/src/app/+video-channels/video-channels.component.html
new file mode 100644 (file)
index 0000000..098e1ee
--- /dev/null
@@ -0,0 +1,23 @@
+<div *ngIf="videoChannel" class="row">
+  <div class="sub-menu">
+
+    <div class="actor">
+      <img [src]="videoChannel.avatarUrl" alt="Avatar" />
+
+      <div class="actor-info">
+        <div class="actor-display-name">{{ videoChannel.displayName }}</div>
+        <div class="actor-followers">{{ videoChannel.followersCount }} subscribers</div>
+      </div>
+    </div>
+
+    <div class="links">
+      <a routerLink="videos" routerLinkActive="active" class="title-page">Videos</a>
+
+      <a routerLink="about" routerLinkActive="active" class="title-page">About</a>
+    </div>
+  </div>
+
+  <div class="margin-content">
+    <router-outlet></router-outlet>
+  </div>
+</div>
diff --git a/client/src/app/+video-channels/video-channels.component.scss b/client/src/app/+video-channels/video-channels.component.scss
new file mode 100644 (file)
index 0000000..909b65b
--- /dev/null
@@ -0,0 +1,6 @@
+@import '_variables';
+@import '_mixins';
+
+.sub-menu {
+  @include sub-menu-with-actor;
+}
\ No newline at end of file
diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts
new file mode 100644 (file)
index 0000000..5eca64f
--- /dev/null
@@ -0,0 +1,24 @@
+import { Component, OnInit } from '@angular/core'
+import { ActivatedRoute } from '@angular/router'
+import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
+import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
+
+@Component({
+  templateUrl: './video-channels.component.html',
+  styleUrls: [ './video-channels.component.scss' ]
+})
+export class VideoChannelsComponent implements OnInit {
+  videoChannel: VideoChannel
+
+  constructor (
+    private route: ActivatedRoute,
+    private videoChannelService: VideoChannelService
+  ) {}
+
+  ngOnInit () {
+    const videoChannelId = this.route.snapshot.params['videoChannelId']
+
+    this.videoChannelService.getVideoChannel(videoChannelId)
+        .subscribe(videoChannel => this.videoChannel = videoChannel)
+  }
+}
diff --git a/client/src/app/+video-channels/video-channels.module.ts b/client/src/app/+video-channels/video-channels.module.ts
new file mode 100644 (file)
index 0000000..a09ea6f
--- /dev/null
@@ -0,0 +1,26 @@
+import { NgModule } from '@angular/core'
+import { SharedModule } from '../shared'
+import { VideoChannelsRoutingModule } from './video-channels-routing.module'
+import { VideoChannelsComponent } from './video-channels.component'
+import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component'
+import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component'
+
+@NgModule({
+  imports: [
+    VideoChannelsRoutingModule,
+    SharedModule
+  ],
+
+  declarations: [
+    VideoChannelsComponent,
+    VideoChannelVideosComponent,
+    VideoChannelAboutComponent
+  ],
+
+  exports: [
+    VideoChannelsComponent
+  ],
+
+  providers: []
+})
+export class VideoChannelsModule { }
index 1d55b4cea2db272dac5ec2b3737a138487c39cd8..799748cfabde0408a9822f805f0c840cdfa4d933 100644 (file)
@@ -9,8 +9,12 @@ const routes: Routes = [
     loadChildren: './+admin/admin.module#AdminModule'
   },
   {
-    path: 'account',
-    loadChildren: './+account/account.module#AccountModule'
+    path: 'accounts',
+    loadChildren: './+accounts/accounts.module#AccountsModule'
+  },
+  {
+    path: 'video-channels',
+    loadChildren: './+video-channels/video-channels.module#VideoChannelsModule'
   }
 ]
 
index 1f9088c38b450c22698bd2f3253b410c98fbcbfe..d8efcc1717271b01963d39e338dd4bc00ad343f1 100644 (file)
@@ -9,16 +9,29 @@ import { VideoChannel as VideoChannelServer } from '../../../../../shared/models
 import { AccountService } from '../account/account.service'
 import { ResultList } from '../../../../../shared'
 import { VideoChannel } from './video-channel.model'
+import { ReplaySubject } from 'rxjs/ReplaySubject'
+import { environment } from '../../../environments/environment'
 
 @Injectable()
 export class VideoChannelService {
+  static BASE_VIDEO_CHANNEL_URL = environment.apiUrl + '/api/v1/video-channels/'
+
+  videoChannelLoaded = new ReplaySubject<VideoChannel>(1)
+
   constructor (
     private authHttp: HttpClient,
     private restExtractor: RestExtractor,
     private restService: RestService
   ) {}
 
-  getVideoChannels (accountId: number): Observable<ResultList<VideoChannel>> {
+  getVideoChannel (videoChannelUUID: string) {
+    return this.authHttp.get<VideoChannel>(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannelUUID)
+               .map(videoChannelHash => new VideoChannel(videoChannelHash))
+               .do(videoChannel => this.videoChannelLoaded.next(videoChannel))
+               .catch((res) => this.restExtractor.handleError(res))
+  }
+
+  listAccountVideoChannels (accountId: number): Observable<ResultList<VideoChannel>> {
     return this.authHttp.get<ResultList<VideoChannelServer>>(AccountService.BASE_ACCOUNT_URL + accountId + '/video-channels')
                .map(res => this.extractVideoChannels(res))
                .catch((res) => this.restExtractor.handleError(res))
index d0b305509b41b4afe77ee7c1390d68a5d83f331b..e26cb058ac107ce7a19c5fcbd1809a09789c7262 100644 (file)
@@ -5,13 +5,13 @@
     <span class="video-miniature-name">
       <a
         class="video-miniature-name"
-        [routerLink]="['/videos/watch', video.uuid]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur() }"
+        [routerLink]="[ '/videos/watch', video.uuid ]" [attr.title]="video.name" [ngClass]="{ 'blur-filter': isVideoBlur() }"
       >
           {{ video.name }}
       </a>
     </span>
 
     <span class="video-miniature-created-at-views">{{ video.publishedAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span>
-    <a class="video-miniature-account" [routerLink]="[ '/account', video.account.id ]">{{ video.by }}</a>
+    <a class="video-miniature-account" [routerLink]="[ '/accounts', video.account.id ]">{{ video.by }}</a>
   </div>
 </div>
index f82aa738961db263e79049802e69444e19ef13ed..8870cbee48b50e11606755cb88ada82b8c0ebf6a 100644 (file)
@@ -23,6 +23,8 @@ import { Video } from './video.model'
 import { objectToFormData } from '@app/shared/misc/utils'
 import { Account } from '@app/shared/account/account.model'
 import { AccountService } from '@app/shared/account/account.service'
+import { VideoChannel } from '../../../../../shared/models/videos'
+import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
 
 @Injectable()
 export class VideoService {
@@ -115,6 +117,22 @@ export class VideoService {
                .catch((res) => this.restExtractor.handleError(res))
   }
 
+  getVideoChannelVideos (
+    videoChannel: VideoChannel,
+    videoPagination: ComponentPagination,
+    sort: VideoSortField
+  ): Observable<{ videos: Video[], totalVideos: number}> {
+    const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
+
+    let params = new HttpParams()
+    params = this.restService.addRestGetParams(params, pagination, sort)
+
+    return this.authHttp
+               .get(VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.uuid + '/videos', { params })
+               .map(this.extractVideos)
+               .catch((res) => this.restExtractor.handleError(res))
+  }
+
   getVideos (
     videoPagination: ComponentPagination,
     sort: VideoSortField,
@@ -175,6 +193,13 @@ export class VideoService {
     return this.buildBaseFeedUrls(params)
   }
 
+  getVideoChannelFeedUrls (videoChannelId: number) {
+    let params = this.restService.addRestGetParams(new HttpParams())
+    params = params.set('videoChannelId', videoChannelId.toString())
+
+    return this.buildBaseFeedUrls(params)
+  }
+
   searchVideos (
     search: string,
     videoPagination: ComponentPagination,
index 5d3361561b7c93bcf0232be0b7e727a9a5c66869..f38e90927b8c34b696484aaf17cd4c96635e1438 100644 (file)
@@ -22,7 +22,7 @@
           </div>
 
           <div class="video-info-by">
-            <a [routerLink]="[ '/account', video.account.id ]" title="Go the account page">
+            <a [routerLink]="[ '/accounts', video.account.id ]" title="Go the account page">
               <span>By {{ video.by }}</span>
               <img [src]="video.accountAvatarUrl" alt="Account avatar" />
             </a>
index cbf9b566a337cf3334a9020885e3e510bd21d5b5..c43bd9803b49cb451ce3d839d5854bf2619a5968 100644 (file)
   color: $orange-color;
   font-weight: $font-bold;
   font-size: 13px;
+}
+
+@mixin sub-menu-with-actor {
+  height: 160px;
+  display: flex;
+  flex-direction: column;
+  align-items: start;
+
+  .actor {
+    display: flex;
+    margin-top: 20px;
+    margin-bottom: 20px;
+
+    img {
+      @include avatar(80px);
+
+      margin-right: 20px;
+    }
+
+    .actor-info {
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+
+      .actor-display-name {
+        font-size: 23px;
+        font-weight: $font-bold;
+      }
+
+      .actor-followers {
+        font-size: 15px;
+      }
+    }
+  }
+
+  .links {
+    margin-top: 0;
+    margin-bottom: 10px;
+
+    a {
+      margin-top: 0;
+      margin-bottom: 0;
+    }
+  }
 }
\ No newline at end of file
index 850ad12e0188c25791892b24c17c9c7117a9f7d0..499a4fc945a5b63c945da0bf35eff104773c0b9c 100644 (file)
@@ -140,7 +140,7 @@ describe('Test videos API validator', function () {
     let path: string
 
     before(async function () {
-      path = '/api/v1/accounts/' + accountUUID + '/video-channels/' + channelUUID + '/videos'
+      path = '/api/v1/video-channels/' + channelUUID + '/videos'
     })
 
     it('Should fail with a bad start pagination', async function () {
index 6238cdc0858e92e18e6f9d3ee7549ecd6896a923..e462a2d47485b77593d55604510f798fb8f603a2 100644 (file)
@@ -47,7 +47,6 @@ describe('Test multiple servers', function () {
   let servers: ServerInfo[] = []
   const toRemove = []
   let videoUUID = ''
-  let accountId: number
   let videoChannelId: number
 
   before(async function () {
@@ -58,17 +57,12 @@ describe('Test multiple servers', function () {
     // Get the access tokens
     await setAccessTokensToServers(servers)
 
-    {
-      const res = await getAccountsList(servers[0].url)
-      accountId = res.body.data[0].id
-    }
-
     {
       const videoChannel = {
         name: 'my channel',
         description: 'super channel'
       }
-      await addVideoChannel(servers[ 0 ].url, servers[ 0 ].accessToken, accountId, videoChannel)
+      await addVideoChannel(servers[ 0 ].url, servers[ 0 ].accessToken, videoChannel)
       const channelRes = await getVideoChannelsList(servers[ 0 ].url, 0, 1)
       videoChannelId = channelRes.body.data[ 0 ].id
     }