]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-video-miniature/videos-selection.component.ts
Fix live/upload redirection
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-video-miniature / videos-selection.component.ts
index 3e0e3b98309ead370e94299d2c8a832be500e852..456b3692662daa3571519fcefffe8b75f75357b6 100644 (file)
@@ -2,6 +2,7 @@ import { Observable } from 'rxjs'
 import {
   AfterContentInit,
   Component,
+  ComponentFactoryResolver,
   ContentChildren,
   EventEmitter,
   Input,
@@ -12,12 +13,11 @@ import {
   TemplateRef
 } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
-import { AuthService, ComponentPagination, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
-import { I18n } from '@ngx-translate/i18n-polyfill'
+import { AuthService, ComponentPagination, LocalStorageService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core'
 import { ResultList, VideoSortField } from '@shared/models'
 import { PeerTubeTemplateDirective, Video } from '../shared-main'
 import { AbstractVideoList } from './abstract-video-list'
-import { MiniatureDisplayOptions, OwnerDisplayType } from './video-miniature.component'
+import { MiniatureDisplayOptions } from './video-miniature.component'
 
 export type SelectionType = { [ id: number ]: boolean }
 
@@ -27,10 +27,13 @@ export type SelectionType = { [ id: number ]: boolean }
   styleUrls: [ './videos-selection.component.scss' ]
 })
 export class VideosSelectionComponent extends AbstractVideoList implements OnInit, OnDestroy, AfterContentInit {
+  @Input() user: User
   @Input() pagination: ComponentPagination
   @Input() titlePage: string
   @Input() miniatureDisplayOptions: MiniatureDisplayOptions
-  @Input() ownerDisplayType: OwnerDisplayType
+  @Input() noResultMessage = $localize`No results.`
+  @Input() enableSelection = true
+  @Input() loadOnInit = true
 
   @Input() getVideosObservableFunction: (page: number, sort?: VideoSortField) => Observable<ResultList<Video>>
 
@@ -45,7 +48,6 @@ export class VideosSelectionComponent extends AbstractVideoList implements OnIni
   globalButtonsTemplate: TemplateRef<any>
 
   constructor (
-    protected i18n: I18n,
     protected router: Router,
     protected route: ActivatedRoute,
     protected notifier: Notifier,
@@ -53,7 +55,8 @@ export class VideosSelectionComponent extends AbstractVideoList implements OnIni
     protected userService: UserService,
     protected screenService: ScreenService,
     protected storageService: LocalStorageService,
-    protected serverService: ServerService
+    protected serverService: ServerService,
+    protected cfr: ComponentFactoryResolver
   ) {
     super()
   }
@@ -105,7 +108,7 @@ export class VideosSelectionComponent extends AbstractVideoList implements OnIni
   }
 
   isInSelectionMode () {
-    return Object.keys(this._selection).some(k => this._selection[ k ] === true)
+    return Object.keys(this._selection).some(k => this._selection[k] === true)
   }
 
   generateSyndicationList () {