]>
Commit | Line | Data |
---|---|---|
41a2aee3 | 1 | import { Component, Input, Output, EventEmitter } from '@angular/core'; |
501bc6c2 | 2 | |
7ddd02c9 C |
3 | import { NotificationsService } from 'angular2-notifications'; |
4 | ||
92fb909c | 5 | import { ConfirmService, ConfigService } from '../../core'; |
bddab65a | 6 | import { SortField, Video, VideoService } from '../shared'; |
4a6995be | 7 | import { User } from '../../shared'; |
501bc6c2 C |
8 | |
9 | @Component({ | |
10 | selector: 'my-video-miniature', | |
ec8d8440 C |
11 | styleUrls: [ './video-miniature.component.scss' ], |
12 | templateUrl: './video-miniature.component.html' | |
501bc6c2 C |
13 | }) |
14 | ||
15 | export class VideoMiniatureComponent { | |
bddab65a | 16 | @Input() currentSort: SortField; |
501bc6c2 | 17 | @Input() user: User; |
4fd8aa32 | 18 | @Input() video: Video; |
501bc6c2 | 19 | |
7ddd02c9 C |
20 | constructor( |
21 | private notificationsService: NotificationsService, | |
5769e1db | 22 | private confirmService: ConfirmService, |
92fb909c | 23 | private configService: ConfigService, |
7ddd02c9 C |
24 | private videoService: VideoService |
25 | ) {} | |
501bc6c2 | 26 | |
92fb909c C |
27 | getVideoName() { |
28 | if (this.isVideoNSFWForThisUser()) | |
29 | return 'NSFW'; | |
30 | ||
31 | return this.video.name; | |
32 | } | |
33 | ||
92fb909c C |
34 | isVideoNSFWForThisUser() { |
35 | return this.video.isVideoNSFWForUser(this.user); | |
36 | } | |
501bc6c2 | 37 | } |