]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/video-list/video-miniature.component.ts
Change video spinner
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-list / video-miniature.component.ts
index 38317f8320b20668dc399f81f45a59b010a4044d..18434dad2f28fc795db7b58ba577ce447e0ffd14 100644 (file)
@@ -1,43 +1,19 @@
-import { Component, Input, Output, EventEmitter } from '@angular/core';
+import { Component, Input } from '@angular/core'
 
-import { SortField, Video, VideoService } from '../shared';
-import { User } from '../../shared';
+import { SortField, Video } from '../shared'
+import { User } from '../../shared'
 
 @Component({
   selector: 'my-video-miniature',
-  styles: [ require('./video-miniature.component.scss') ],
-  template: require('./video-miniature.component.html')
+  styleUrls: [ './video-miniature.component.scss' ],
+  templateUrl: './video-miniature.component.html'
 })
-
 export class VideoMiniatureComponent {
-  @Output() removed = new EventEmitter<any>();
-
-  @Input() currentSort: SortField;
-  @Input() user: User;
-  @Input() video: Video;
-
-  hovering = false;
-
-  constructor(private videoService: VideoService) {}
-
-  displayRemoveIcon() {
-    return this.hovering && this.video.isRemovableBy(this.user);
-  }
-
-  onBlur() {
-    this.hovering = false;
-  }
-
-  onHover() {
-    this.hovering = true;
-  }
+  @Input() currentSort: SortField
+  @Input() user: User
+  @Input() video: Video
 
-  removeVideo(id: string) {
-    if (confirm('Do you really want to remove this video?')) {
-      this.videoService.removeVideo(id).subscribe(
-        status => this.removed.emit(true),
-        error => alert(error)
-      );
-    }
+  isVideoNSFWForThisUser () {
+    return this.video.isVideoNSFWForUser(this.user)
   }
 }