From ab683a8e0d998cfd9dfb9562d3c616f3e6e1dbfd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Apr 2017 21:42:36 +0200 Subject: Format video blacklist --- client/src/app/videos/shared/video.service.ts | 4 +-- .../videos/video-watch/video-watch.component.html | 22 ++++++------ .../videos/video-watch/video-watch.component.ts | 42 +++++++++++----------- 3 files changed, 35 insertions(+), 33 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts index a0965e20c..ba83c72fd 100644 --- a/client/src/app/videos/shared/video.service.ts +++ b/client/src/app/videos/shared/video.service.ts @@ -152,8 +152,8 @@ export class VideoService { blacklistVideo(id: string) { return this.authHttp.post(VideoService.BASE_VIDEO_URL + id + '/blacklist', {}) - .map(this.restExtractor.extractDataBool) - .catch((res) => this.restExtractor.handleError(res)); + .map(this.restExtractor.extractDataBool) + .catch((res) => this.restExtractor.handleError(res)); } private setVideoRate(id: string, rateType: RateType) { diff --git a/client/src/app/videos/video-watch/video-watch.component.html b/client/src/app/videos/video-watch/video-watch.component.html index 124a3ba8b..5e758401e 100644 --- a/client/src/app/videos/video-watch/video-watch.component.html +++ b/client/src/app/videos/video-watch/video-watch.component.html @@ -79,17 +79,17 @@ -
  • - - Delete - -
  • - -
  • - - Blacklist - -
  • +
  • + + Delete + +
  • + +
  • + + Blacklist + +
  • 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 f582df45c..07b2a1d1f 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts @@ -171,41 +171,43 @@ export class VideoWatchComponent implements OnInit, OnDestroy { removeVideo(event: Event) { event.preventDefault(); + this.confirmService.confirm('Do you really want to delete this video?', 'Delete').subscribe( res => { if (res === false) return; this.videoService.removeVideo(this.video.id) - .subscribe( - status => { - this.notificationsService.success('Success', `Video ${this.video.name} deleted.`) - // Go back to the video-list. - this.router.navigate(['/videos/list']) - }, - - error => this.notificationsService.error('Error', error.text) - ); + .subscribe( + status => { + this.notificationsService.success('Success', `Video ${this.video.name} deleted.`); + // Go back to the video-list. + this.router.navigate(['/videos/list']); + }, + + error => this.notificationsService.error('Error', error.text) + ); } ); } blacklistVideo(event: Event) { - event.preventDefault() + event.preventDefault(); + this.confirmService.confirm('Do you really want to blacklist this video ?', 'Blacklist').subscribe( res => { - if (res === false) return; + if (res === false) return; - this.videoService.blacklistVideo(this.video.id) - .subscribe( - status => { - this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) - this.router.navigate(['/videos/list']) - }, + this.videoService.blacklistVideo(this.video.id) + .subscribe( + status => { + this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`); + this.router.navigate(['/videos/list']); + }, - error => this.notificationsService.error('Error', error.text) - ) + error => this.notificationsService.error('Error', error.text) + ); } - ) + ); } showReportModal(event: Event) { -- cgit v1.2.3