diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-13 16:57:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-14 09:27:18 +0200 |
commit | 26b7305a232e547709f433a6edf700bf495935d8 (patch) | |
tree | b5676090c61df72f864735bcc881d5ee256cffbd /client/src/app/videos/+video-watch/video-watch.component.ts | |
parent | efc9e8450a8bbeeef9cd18e3ad6037abc0f815c3 (diff) | |
download | PeerTube-26b7305a232e547709f433a6edf700bf495935d8.tar.gz PeerTube-26b7305a232e547709f433a6edf700bf495935d8.tar.zst PeerTube-26b7305a232e547709f433a6edf700bf495935d8.zip |
Add blacklist reason field
Diffstat (limited to 'client/src/app/videos/+video-watch/video-watch.component.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 04bcc6cd1..878655d4a 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -21,6 +21,7 @@ import { MarkdownService } from '../shared' | |||
21 | import { VideoDownloadComponent } from './modal/video-download.component' | 21 | import { VideoDownloadComponent } from './modal/video-download.component' |
22 | import { VideoReportComponent } from './modal/video-report.component' | 22 | import { VideoReportComponent } from './modal/video-report.component' |
23 | import { VideoShareComponent } from './modal/video-share.component' | 23 | import { VideoShareComponent } from './modal/video-share.component' |
24 | import { VideoBlacklistComponent } from './modal/video-blacklist.component' | ||
24 | import { addContextMenu, getVideojsOptions, loadLocale } from '../../../assets/player/peertube-player' | 25 | import { addContextMenu, getVideojsOptions, loadLocale } from '../../../assets/player/peertube-player' |
25 | import { ServerService } from '@app/core' | 26 | import { ServerService } from '@app/core' |
26 | import { I18n } from '@ngx-translate/i18n-polyfill' | 27 | import { I18n } from '@ngx-translate/i18n-polyfill' |
@@ -41,6 +42,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
41 | @ViewChild('videoShareModal') videoShareModal: VideoShareComponent | 42 | @ViewChild('videoShareModal') videoShareModal: VideoShareComponent |
42 | @ViewChild('videoReportModal') videoReportModal: VideoReportComponent | 43 | @ViewChild('videoReportModal') videoReportModal: VideoReportComponent |
43 | @ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent | 44 | @ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent |
45 | @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent | ||
44 | 46 | ||
45 | otherVideosDisplayed: Video[] = [] | 47 | otherVideosDisplayed: Video[] = [] |
46 | 48 | ||
@@ -156,26 +158,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
156 | } | 158 | } |
157 | } | 159 | } |
158 | 160 | ||
159 | async blacklistVideo (event: Event) { | ||
160 | event.preventDefault() | ||
161 | |||
162 | const res = await this.confirmService.confirm(this.i18n('Do you really want to blacklist this video?'), this.i18n('Blacklist')) | ||
163 | if (res === false) return | ||
164 | |||
165 | this.videoBlacklistService.blacklistVideo(this.video.id) | ||
166 | .subscribe( | ||
167 | () => { | ||
168 | this.notificationsService.success( | ||
169 | this.i18n('Success'), | ||
170 | this.i18n('Video {{videoName}} had been blacklisted.', { videoName: this.video.name }) | ||
171 | ) | ||
172 | this.redirectService.redirectToHomepage() | ||
173 | }, | ||
174 | |||
175 | error => this.notificationsService.error(this.i18n('Error'), error.message) | ||
176 | ) | ||
177 | } | ||
178 | |||
179 | showMoreDescription () { | 161 | showMoreDescription () { |
180 | if (this.completeVideoDescription === undefined) { | 162 | if (this.completeVideoDescription === undefined) { |
181 | return this.loadCompleteDescription() | 163 | return this.loadCompleteDescription() |
@@ -230,6 +212,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
230 | this.videoDownloadModal.show() | 212 | this.videoDownloadModal.show() |
231 | } | 213 | } |
232 | 214 | ||
215 | showBlacklistModal (event: Event) { | ||
216 | event.preventDefault() | ||
217 | this.videoBlacklistModal.show() | ||
218 | } | ||
219 | |||
233 | isUserLoggedIn () { | 220 | isUserLoggedIn () { |
234 | return this.authService.isLoggedIn() | 221 | return this.authService.isLoggedIn() |
235 | } | 222 | } |