diff options
author | Chocobozzz <chocobozzz@framasoft.org> | 2020-06-11 10:36:04 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@framasoft.org> | 2020-06-11 10:36:04 +0200 |
commit | fa58a19819cb821a5c5a26802efd492461be9c04 (patch) | |
tree | 72bd8307da8ac447bb9934b1301ab0d93ea97e6b /client/src/app/shared/video | |
parent | 50a04125dac1a126cb79a9fb575fcf673c5ac2d6 (diff) | |
parent | e95bede8fe660a38c99e51560caa5dd58a8eb23e (diff) | |
download | PeerTube-fa58a19819cb821a5c5a26802efd492461be9c04.tar.gz PeerTube-fa58a19819cb821a5c5a26802efd492461be9c04.tar.zst PeerTube-fa58a19819cb821a5c5a26802efd492461be9c04.zip |
Merge branch 'blacklist' into 'develop'
rename blacklist to block/blocklist, merge block and auto-block views
See merge request framasoft/peertube/PeerTube!30
Diffstat (limited to 'client/src/app/shared/video')
-rw-r--r-- | client/src/app/shared/video/abstract-video-list.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/video/modals/video-block.component.html (renamed from client/src/app/shared/video/modals/video-blacklist.component.html) | 4 | ||||
-rw-r--r-- | client/src/app/shared/video/modals/video-block.component.scss (renamed from client/src/app/shared/video/modals/video-blacklist.component.scss) | 0 | ||||
-rw-r--r-- | client/src/app/shared/video/modals/video-block.component.ts (renamed from client/src/app/shared/video/modals/video-blacklist.component.ts) | 31 | ||||
-rw-r--r-- | client/src/app/shared/video/video-actions-dropdown.component.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/video/video-actions-dropdown.component.ts | 54 | ||||
-rw-r--r-- | client/src/app/shared/video/video-miniature.component.html | 8 | ||||
-rw-r--r-- | client/src/app/shared/video/video-miniature.component.scss | 8 | ||||
-rw-r--r-- | client/src/app/shared/video/video-miniature.component.ts | 12 | ||||
-rw-r--r-- | client/src/app/shared/video/video.model.ts | 8 |
10 files changed, 64 insertions, 65 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.html b/client/src/app/shared/video/abstract-video-list.html index cd8a5b840..8ce3b25b0 100644 --- a/client/src/app/shared/video/abstract-video-list.html +++ b/client/src/app/shared/video/abstract-video-list.html | |||
@@ -39,7 +39,7 @@ | |||
39 | [fitWidth]="true" | 39 | [fitWidth]="true" |
40 | [video]="video" [user]="user" [ownerDisplayType]="ownerDisplayType" | 40 | [video]="video" [user]="user" [ownerDisplayType]="ownerDisplayType" |
41 | [displayVideoActions]="displayVideoActions" [displayOptions]="displayOptions" | 41 | [displayVideoActions]="displayVideoActions" [displayOptions]="displayOptions" |
42 | (videoBlacklisted)="removeVideoFromArray(video)" (videoRemoved)="removeVideoFromArray(video)" | 42 | (videoBlocked)="removeVideoFromArray(video)" (videoRemoved)="removeVideoFromArray(video)" |
43 | > | 43 | > |
44 | </my-video-miniature> | 44 | </my-video-miniature> |
45 | </ng-container> | 45 | </ng-container> |
diff --git a/client/src/app/shared/video/modals/video-blacklist.component.html b/client/src/app/shared/video/modals/video-block.component.html index 8f06a6b02..a8dd30b5e 100644 --- a/client/src/app/shared/video/modals/video-blacklist.component.html +++ b/client/src/app/shared/video/modals/video-block.component.html | |||
@@ -1,12 +1,12 @@ | |||
1 | <ng-template #modal> | 1 | <ng-template #modal> |
2 | <div class="modal-header"> | 2 | <div class="modal-header"> |
3 | <h4 i18n class="modal-title">Blacklist video</h4> | 3 | <h4 i18n class="modal-title">Blocklist video</h4> |
4 | <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon> | 4 | <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon> |
5 | </div> | 5 | </div> |
6 | 6 | ||
7 | <div class="modal-body"> | 7 | <div class="modal-body"> |
8 | 8 | ||
9 | <form novalidate [formGroup]="form" (ngSubmit)="blacklist()"> | 9 | <form novalidate [formGroup]="form" (ngSubmit)="block()"> |
10 | <div class="form-group"> | 10 | <div class="form-group"> |
11 | <textarea | 11 | <textarea |
12 | i18n-placeholder placeholder="Reason..." formControlName="reason" | 12 | i18n-placeholder placeholder="Reason..." formControlName="reason" |
diff --git a/client/src/app/shared/video/modals/video-blacklist.component.scss b/client/src/app/shared/video/modals/video-block.component.scss index afcdb9a16..afcdb9a16 100644 --- a/client/src/app/shared/video/modals/video-blacklist.component.scss +++ b/client/src/app/shared/video/modals/video-block.component.scss | |||
diff --git a/client/src/app/shared/video/modals/video-blacklist.component.ts b/client/src/app/shared/video/modals/video-block.component.ts index 6ef9c250b..1a25e0578 100644 --- a/client/src/app/shared/video/modals/video-blacklist.component.ts +++ b/client/src/app/shared/video/modals/video-block.component.ts | |||
@@ -1,24 +1,24 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { Notifier, RedirectService } from '@app/core' | 2 | import { Notifier, RedirectService } from '@app/core' |
3 | import { VideoBlacklistService } from '../../../shared/video-blacklist' | 3 | import { VideoBlockService } from '../../video-block' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 5 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
6 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | 6 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' |
7 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' | 7 | import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' |
8 | import { FormReactive, VideoBlacklistValidatorsService } from '@app/shared/forms' | 8 | import { FormReactive, VideoBlockValidatorsService } from '@app/shared/forms' |
9 | import { Video } from '@app/shared/video/video.model' | 9 | import { Video } from '@app/shared/video/video.model' |
10 | 10 | ||
11 | @Component({ | 11 | @Component({ |
12 | selector: 'my-video-blacklist', | 12 | selector: 'my-video-block', |
13 | templateUrl: './video-blacklist.component.html', | 13 | templateUrl: './video-block.component.html', |
14 | styleUrls: [ './video-blacklist.component.scss' ] | 14 | styleUrls: [ './video-block.component.scss' ] |
15 | }) | 15 | }) |
16 | export class VideoBlacklistComponent extends FormReactive implements OnInit { | 16 | export class VideoBlockComponent extends FormReactive implements OnInit { |
17 | @Input() video: Video = null | 17 | @Input() video: Video = null |
18 | 18 | ||
19 | @ViewChild('modal', { static: true }) modal: NgbModal | 19 | @ViewChild('modal', { static: true }) modal: NgbModal |
20 | 20 | ||
21 | @Output() videoBlacklisted = new EventEmitter() | 21 | @Output() videoBlocked = new EventEmitter() |
22 | 22 | ||
23 | error: string = null | 23 | error: string = null |
24 | 24 | ||
@@ -27,10 +27,9 @@ export class VideoBlacklistComponent extends FormReactive implements OnInit { | |||
27 | constructor ( | 27 | constructor ( |
28 | protected formValidatorService: FormValidatorService, | 28 | protected formValidatorService: FormValidatorService, |
29 | private modalService: NgbModal, | 29 | private modalService: NgbModal, |
30 | private videoBlacklistValidatorsService: VideoBlacklistValidatorsService, | 30 | private videoBlockValidatorsService: VideoBlockValidatorsService, |
31 | private videoBlacklistService: VideoBlacklistService, | 31 | private videoBlocklistService: VideoBlockService, |
32 | private notifier: Notifier, | 32 | private notifier: Notifier, |
33 | private redirectService: RedirectService, | ||
34 | private i18n: I18n | 33 | private i18n: I18n |
35 | ) { | 34 | ) { |
36 | super() | 35 | super() |
@@ -40,7 +39,7 @@ export class VideoBlacklistComponent extends FormReactive implements OnInit { | |||
40 | const defaultValues = { unfederate: 'true' } | 39 | const defaultValues = { unfederate: 'true' } |
41 | 40 | ||
42 | this.buildForm({ | 41 | this.buildForm({ |
43 | reason: this.videoBlacklistValidatorsService.VIDEO_BLACKLIST_REASON, | 42 | reason: this.videoBlockValidatorsService.VIDEO_BLOCK_REASON, |
44 | unfederate: null | 43 | unfederate: null |
45 | }, defaultValues) | 44 | }, defaultValues) |
46 | } | 45 | } |
@@ -54,20 +53,20 @@ export class VideoBlacklistComponent extends FormReactive implements OnInit { | |||
54 | this.openedModal = null | 53 | this.openedModal = null |
55 | } | 54 | } |
56 | 55 | ||
57 | blacklist () { | 56 | block () { |
58 | const reason = this.form.value[ 'reason' ] || undefined | 57 | const reason = this.form.value[ 'reason' ] || undefined |
59 | const unfederate = this.video.isLocal ? this.form.value[ 'unfederate' ] : undefined | 58 | const unfederate = this.video.isLocal ? this.form.value[ 'unfederate' ] : undefined |
60 | 59 | ||
61 | this.videoBlacklistService.blacklistVideo(this.video.id, reason, unfederate) | 60 | this.videoBlocklistService.blockVideo(this.video.id, reason, unfederate) |
62 | .subscribe( | 61 | .subscribe( |
63 | () => { | 62 | () => { |
64 | this.notifier.success(this.i18n('Video blacklisted.')) | 63 | this.notifier.success(this.i18n('Video blocked.')) |
65 | this.hide() | 64 | this.hide() |
66 | 65 | ||
67 | this.video.blacklisted = true | 66 | this.video.blacklisted = true |
68 | this.video.blacklistedReason = reason | 67 | this.video.blockedReason = reason |
69 | 68 | ||
70 | this.videoBlacklisted.emit() | 69 | this.videoBlocked.emit() |
71 | }, | 70 | }, |
72 | 71 | ||
73 | err => this.notifier.error(err.message) | 72 | err => this.notifier.error(err.message) |
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.html b/client/src/app/shared/video/video-actions-dropdown.component.html index ec03fa55d..3c8271b65 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.html +++ b/client/src/app/shared/video/video-actions-dropdown.component.html | |||
@@ -17,5 +17,5 @@ | |||
17 | 17 | ||
18 | <my-video-download #videoDownloadModal></my-video-download> | 18 | <my-video-download #videoDownloadModal></my-video-download> |
19 | <my-video-report #videoReportModal [video]="video"></my-video-report> | 19 | <my-video-report #videoReportModal [video]="video"></my-video-report> |
20 | <my-video-blacklist #videoBlacklistModal [video]="video" (videoBlacklisted)="onVideoBlacklisted()"></my-video-blacklist> | 20 | <my-video-block #videoBlockModal [video]="video" (videoBlocked)="onVideoBlocked()"></my-video-block> |
21 | </ng-container> | 21 | </ng-container> |
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts index 4e5fc6476..1f5763610 100644 --- a/client/src/app/shared/video/video-actions-dropdown.component.ts +++ b/client/src/app/shared/video/video-actions-dropdown.component.ts | |||
@@ -9,8 +9,8 @@ import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' | |||
9 | import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component' | 9 | import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component' |
10 | import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component' | 10 | import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component' |
11 | import { VideoReportComponent } from '@app/shared/video/modals/video-report.component' | 11 | import { VideoReportComponent } from '@app/shared/video/modals/video-report.component' |
12 | import { VideoBlacklistComponent } from '@app/shared/video/modals/video-blacklist.component' | 12 | import { VideoBlockComponent } from '@app/shared/video/modals/video-block.component' |
13 | import { VideoBlacklistService } from '@app/shared/video-blacklist' | 13 | import { VideoBlockService } from '@app/shared/video-block' |
14 | import { ScreenService } from '@app/shared/misc/screen.service' | 14 | import { ScreenService } from '@app/shared/misc/screen.service' |
15 | import { VideoCaption } from '@shared/models' | 15 | import { VideoCaption } from '@shared/models' |
16 | import { RedundancyService } from '@app/shared/video/redundancy.service' | 16 | import { RedundancyService } from '@app/shared/video/redundancy.service' |
@@ -36,7 +36,7 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
36 | 36 | ||
37 | @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent | 37 | @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent |
38 | @ViewChild('videoReportModal') videoReportModal: VideoReportComponent | 38 | @ViewChild('videoReportModal') videoReportModal: VideoReportComponent |
39 | @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent | 39 | @ViewChild('videoBlockModal') videoBlockModal: VideoBlockComponent |
40 | 40 | ||
41 | @Input() video: Video | VideoDetails | 41 | @Input() video: Video | VideoDetails |
42 | @Input() videoCaptions: VideoCaption[] = [] | 42 | @Input() videoCaptions: VideoCaption[] = [] |
@@ -59,8 +59,8 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
59 | @Input() buttonDirection: DropdownDirection = 'vertical' | 59 | @Input() buttonDirection: DropdownDirection = 'vertical' |
60 | 60 | ||
61 | @Output() videoRemoved = new EventEmitter() | 61 | @Output() videoRemoved = new EventEmitter() |
62 | @Output() videoUnblacklisted = new EventEmitter() | 62 | @Output() videoUnblocked = new EventEmitter() |
63 | @Output() videoBlacklisted = new EventEmitter() | 63 | @Output() videoBlocked = new EventEmitter() |
64 | @Output() modalOpened = new EventEmitter() | 64 | @Output() modalOpened = new EventEmitter() |
65 | 65 | ||
66 | videoActions: DropdownAction<{ video: Video }>[][] = [] | 66 | videoActions: DropdownAction<{ video: Video }>[][] = [] |
@@ -71,7 +71,7 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
71 | private authService: AuthService, | 71 | private authService: AuthService, |
72 | private notifier: Notifier, | 72 | private notifier: Notifier, |
73 | private confirmService: ConfirmService, | 73 | private confirmService: ConfirmService, |
74 | private videoBlacklistService: VideoBlacklistService, | 74 | private videoBlocklistService: VideoBlockService, |
75 | private screenService: ScreenService, | 75 | private screenService: ScreenService, |
76 | private videoService: VideoService, | 76 | private videoService: VideoService, |
77 | private redundancyService: RedundancyService, | 77 | private redundancyService: RedundancyService, |
@@ -117,10 +117,10 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
117 | this.videoReportModal.show() | 117 | this.videoReportModal.show() |
118 | } | 118 | } |
119 | 119 | ||
120 | showBlacklistModal () { | 120 | showBlockModal () { |
121 | this.modalOpened.emit() | 121 | this.modalOpened.emit() |
122 | 122 | ||
123 | this.videoBlacklistModal.show() | 123 | this.videoBlockModal.show() |
124 | } | 124 | } |
125 | 125 | ||
126 | /* Actions checker */ | 126 | /* Actions checker */ |
@@ -133,12 +133,12 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
133 | return this.video.isRemovableBy(this.user) | 133 | return this.video.isRemovableBy(this.user) |
134 | } | 134 | } |
135 | 135 | ||
136 | isVideoBlacklistable () { | 136 | isVideoBlockable () { |
137 | return this.video.isBlackistableBy(this.user) | 137 | return this.video.isBlockableBy(this.user) |
138 | } | 138 | } |
139 | 139 | ||
140 | isVideoUnblacklistable () { | 140 | isVideoUnblockable () { |
141 | return this.video.isUnblacklistableBy(this.user) | 141 | return this.video.isUnblockableBy(this.user) |
142 | } | 142 | } |
143 | 143 | ||
144 | isVideoDownloadable () { | 144 | isVideoDownloadable () { |
@@ -151,22 +151,22 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
151 | 151 | ||
152 | /* Action handlers */ | 152 | /* Action handlers */ |
153 | 153 | ||
154 | async unblacklistVideo () { | 154 | async unblockVideo () { |
155 | const confirmMessage = this.i18n( | 155 | const confirmMessage = this.i18n( |
156 | 'Do you really want to remove this video from the blacklist? It will be available again in the videos list.' | 156 | 'Do you really want to unblock this video? It will be available again in the videos list.' |
157 | ) | 157 | ) |
158 | 158 | ||
159 | const res = await this.confirmService.confirm(confirmMessage, this.i18n('Unblacklist')) | 159 | const res = await this.confirmService.confirm(confirmMessage, this.i18n('Unblock')) |
160 | if (res === false) return | 160 | if (res === false) return |
161 | 161 | ||
162 | this.videoBlacklistService.removeVideoFromBlacklist(this.video.id).subscribe( | 162 | this.videoBlocklistService.unblockVideo(this.video.id).subscribe( |
163 | () => { | 163 | () => { |
164 | this.notifier.success(this.i18n('Video {{name}} removed from the blacklist.', { name: this.video.name })) | 164 | this.notifier.success(this.i18n('Video {{name}} unblocked.', { name: this.video.name })) |
165 | 165 | ||
166 | this.video.blacklisted = false | 166 | this.video.blacklisted = false |
167 | this.video.blacklistedReason = null | 167 | this.video.blockedReason = null |
168 | 168 | ||
169 | this.videoUnblacklisted.emit() | 169 | this.videoUnblocked.emit() |
170 | }, | 170 | }, |
171 | 171 | ||
172 | err => this.notifier.error(err.message) | 172 | err => this.notifier.error(err.message) |
@@ -203,8 +203,8 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
203 | ) | 203 | ) |
204 | } | 204 | } |
205 | 205 | ||
206 | onVideoBlacklisted () { | 206 | onVideoBlocked () { |
207 | this.videoBlacklisted.emit() | 207 | this.videoBlocked.emit() |
208 | } | 208 | } |
209 | 209 | ||
210 | getPlaylistDropdownPlacement () { | 210 | getPlaylistDropdownPlacement () { |
@@ -239,16 +239,16 @@ export class VideoActionsDropdownComponent implements OnChanges { | |||
239 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() | 239 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable() |
240 | }, | 240 | }, |
241 | { | 241 | { |
242 | label: this.i18n('Blacklist'), | 242 | label: this.i18n('Block'), |
243 | handler: () => this.showBlacklistModal(), | 243 | handler: () => this.showBlockModal(), |
244 | iconName: 'no', | 244 | iconName: 'no', |
245 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoBlacklistable() | 245 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoBlockable() |
246 | }, | 246 | }, |
247 | { | 247 | { |
248 | label: this.i18n('Unblacklist'), | 248 | label: this.i18n('Unblock'), |
249 | handler: () => this.unblacklistVideo(), | 249 | handler: () => this.unblockVideo(), |
250 | iconName: 'undo', | 250 | iconName: 'undo', |
251 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoUnblacklistable() | 251 | isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoUnblockable() |
252 | }, | 252 | }, |
253 | { | 253 | { |
254 | label: this.i18n('Mirror'), | 254 | label: this.i18n('Mirror'), |
diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/video/video-miniature.component.html index 3e23cf18c..575505f63 100644 --- a/client/src/app/shared/video/video-miniature.component.html +++ b/client/src/app/shared/video/video-miniature.component.html | |||
@@ -43,9 +43,9 @@ | |||
43 | </div> | 43 | </div> |
44 | </div> | 44 | </div> |
45 | 45 | ||
46 | <div *ngIf="displayOptions.blacklistInfo && video.blacklisted" class="video-info-blacklisted"> | 46 | <div *ngIf="displayOptions.blacklistInfo && video.blacklisted" class="video-info-blocked"> |
47 | <span class="blacklisted-label" i18n>Blacklisted</span> | 47 | <span class="blocked-label" i18n>Blocked</span> |
48 | <span class="blacklisted-reason" *ngIf="video.blacklistedReason">{{ video.blacklistedReason }}</span> | 48 | <span class="blocked-reason" *ngIf="video.blockedReason">{{ video.blockedReason }}</span> |
49 | </div> | 49 | </div> |
50 | 50 | ||
51 | <div i18n *ngIf="displayOptions.nsfw && video.nsfw" class="video-info-nsfw"> | 51 | <div i18n *ngIf="displayOptions.nsfw && video.nsfw" class="video-info-nsfw"> |
@@ -57,7 +57,7 @@ | |||
57 | <!-- FIXME: remove bottom placement when overflow is fixed in bootstrap dropdown: https://github.com/ng-bootstrap/ng-bootstrap/issues/3495 --> | 57 | <!-- FIXME: remove bottom placement when overflow is fixed in bootstrap dropdown: https://github.com/ng-bootstrap/ng-bootstrap/issues/3495 --> |
58 | <my-video-actions-dropdown | 58 | <my-video-actions-dropdown |
59 | *ngIf="showActions" [video]="video" [displayOptions]="videoActionsDisplayOptions" placement="bottom-left bottom-right left auto" | 59 | *ngIf="showActions" [video]="video" [displayOptions]="videoActionsDisplayOptions" placement="bottom-left bottom-right left auto" |
60 | (videoRemoved)="onVideoRemoved()" (videoBlacklisted)="onVideoBlacklisted()" (videoUnblacklisted)="onVideoUnblacklisted()" | 60 | (videoRemoved)="onVideoRemoved()" (videoBlocked)="onVideoBlocked()" (videoUnblocked)="onVideoUnblocked()" |
61 | ></my-video-actions-dropdown> | 61 | ></my-video-actions-dropdown> |
62 | </div> | 62 | </div> |
63 | </div> | 63 | </div> |
diff --git a/client/src/app/shared/video/video-miniature.component.scss b/client/src/app/shared/video/video-miniature.component.scss index 849bd54bb..34f34f228 100644 --- a/client/src/app/shared/video/video-miniature.component.scss +++ b/client/src/app/shared/video/video-miniature.component.scss | |||
@@ -45,15 +45,15 @@ $more-margin-right: 15px; | |||
45 | } | 45 | } |
46 | 46 | ||
47 | .video-info-privacy, | 47 | .video-info-privacy, |
48 | .video-info-blacklisted .blacklisted-label, | 48 | .video-info-blocked .blocked-label, |
49 | .video-info-nsfw { | 49 | .video-info-nsfw { |
50 | font-weight: $font-semibold; | 50 | font-weight: $font-semibold; |
51 | } | 51 | } |
52 | 52 | ||
53 | .video-info-blacklisted { | 53 | .video-info-blocked { |
54 | color: red; | 54 | color: red; |
55 | 55 | ||
56 | .blacklisted-reason::before { | 56 | .blocked-reason::before { |
57 | content: ' - '; | 57 | content: ' - '; |
58 | } | 58 | } |
59 | } | 59 | } |
@@ -160,7 +160,7 @@ $more-margin-right: 15px; | |||
160 | margin-top: 5px; | 160 | margin-top: 5px; |
161 | } | 161 | } |
162 | 162 | ||
163 | .video-info-blacklisted { | 163 | .video-info-blocked { |
164 | margin-top: 3px; | 164 | margin-top: 3px; |
165 | } | 165 | } |
166 | } | 166 | } |
diff --git a/client/src/app/shared/video/video-miniature.component.ts b/client/src/app/shared/video/video-miniature.component.ts index aa1726ca7..f0b0992e2 100644 --- a/client/src/app/shared/video/video-miniature.component.ts +++ b/client/src/app/shared/video/video-miniature.component.ts | |||
@@ -59,8 +59,8 @@ export class VideoMiniatureComponent implements OnInit { | |||
59 | 59 | ||
60 | @Input() useLazyLoadUrl = false | 60 | @Input() useLazyLoadUrl = false |
61 | 61 | ||
62 | @Output() videoBlacklisted = new EventEmitter() | 62 | @Output() videoBlocked = new EventEmitter() |
63 | @Output() videoUnblacklisted = new EventEmitter() | 63 | @Output() videoUnblocked = new EventEmitter() |
64 | @Output() videoRemoved = new EventEmitter() | 64 | @Output() videoRemoved = new EventEmitter() |
65 | 65 | ||
66 | videoActionsDisplayOptions: VideoActionsDisplayType = { | 66 | videoActionsDisplayOptions: VideoActionsDisplayType = { |
@@ -184,12 +184,12 @@ export class VideoMiniatureComponent implements OnInit { | |||
184 | this.loadWatchLater() | 184 | this.loadWatchLater() |
185 | } | 185 | } |
186 | 186 | ||
187 | onVideoBlacklisted () { | 187 | onVideoBlocked () { |
188 | this.videoBlacklisted.emit() | 188 | this.videoBlocked.emit() |
189 | } | 189 | } |
190 | 190 | ||
191 | onVideoUnblacklisted () { | 191 | onVideoUnblocked () { |
192 | this.videoUnblacklisted.emit() | 192 | this.videoUnblocked.emit() |
193 | } | 193 | } |
194 | 194 | ||
195 | onVideoRemoved () { | 195 | onVideoRemoved () { |
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index 97759f9c1..16e43cbd8 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts | |||
@@ -54,7 +54,7 @@ export class Video implements VideoServerModel { | |||
54 | state?: VideoConstant<VideoState> | 54 | state?: VideoConstant<VideoState> |
55 | scheduledUpdate?: VideoScheduleUpdate | 55 | scheduledUpdate?: VideoScheduleUpdate |
56 | blacklisted?: boolean | 56 | blacklisted?: boolean |
57 | blacklistedReason?: string | 57 | blockedReason?: string |
58 | 58 | ||
59 | account: { | 59 | account: { |
60 | id: number | 60 | id: number |
@@ -140,7 +140,7 @@ export class Video implements VideoServerModel { | |||
140 | if (this.state) this.state.label = peertubeTranslate(this.state.label, translations) | 140 | if (this.state) this.state.label = peertubeTranslate(this.state.label, translations) |
141 | 141 | ||
142 | this.blacklisted = hash.blacklisted | 142 | this.blacklisted = hash.blacklisted |
143 | this.blacklistedReason = hash.blacklistedReason | 143 | this.blockedReason = hash.blacklistedReason |
144 | 144 | ||
145 | this.userHistory = hash.userHistory | 145 | this.userHistory = hash.userHistory |
146 | 146 | ||
@@ -163,11 +163,11 @@ export class Video implements VideoServerModel { | |||
163 | return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.REMOVE_ANY_VIDEO)) | 163 | return user && this.isLocal === true && (this.account.name === user.username || user.hasRight(UserRight.REMOVE_ANY_VIDEO)) |
164 | } | 164 | } |
165 | 165 | ||
166 | isBlackistableBy (user: AuthUser) { | 166 | isBlockableBy (user: AuthUser) { |
167 | return this.blacklisted !== true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true | 167 | return this.blacklisted !== true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true |
168 | } | 168 | } |
169 | 169 | ||
170 | isUnblacklistableBy (user: AuthUser) { | 170 | isUnblockableBy (user: AuthUser) { |
171 | return this.blacklisted === true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true | 171 | return this.blacklisted === true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true |
172 | } | 172 | } |
173 | 173 | ||