aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts')
-rw-r--r--client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts23
1 files changed, 14 insertions, 9 deletions
diff --git a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts b/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts
index 7210e677c..1864e5f65 100644
--- a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts
+++ b/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts
@@ -1,11 +1,10 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { SortMeta } from 'primeng/components/common/sortmeta' 2import { SortMeta } from 'primeng/components/common/sortmeta'
3
4import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
5
6import { ConfirmService } from '../../../core' 4import { ConfirmService } from '../../../core'
7import { VideoBlacklistService, RestTable, RestPagination } from '../../../shared' 5import { RestPagination, RestTable, VideoBlacklistService } from '../../../shared'
8import { BlacklistedVideo } from '../../../../../../shared' 6import { BlacklistedVideo } from '../../../../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill'
9 8
10@Component({ 9@Component({
11 selector: 'my-video-blacklist-list', 10 selector: 'my-video-blacklist-list',
@@ -22,7 +21,8 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit {
22 constructor ( 21 constructor (
23 private notificationsService: NotificationsService, 22 private notificationsService: NotificationsService,
24 private confirmService: ConfirmService, 23 private confirmService: ConfirmService,
25 private videoBlacklistService: VideoBlacklistService 24 private videoBlacklistService: VideoBlacklistService,
25 private i18n: I18n
26 ) { 26 ) {
27 super() 27 super()
28 } 28 }
@@ -32,18 +32,23 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit {
32 } 32 }
33 33
34 async removeVideoFromBlacklist (entry: BlacklistedVideo) { 34 async removeVideoFromBlacklist (entry: BlacklistedVideo) {
35 const confirmMessage = 'Do you really want to remove this video from the blacklist ? It will be available again in the videos list.' 35 const confirmMessage = this.i18n(
36 'Do you really want to remove this video from the blacklist ? It will be available again in the videos list.'
37 )
36 38
37 const res = await this.confirmService.confirm(confirmMessage, 'Unblacklist') 39 const res = await this.confirmService.confirm(confirmMessage, this.i18n('Unblacklist'))
38 if (res === false) return 40 if (res === false) return
39 41
40 this.videoBlacklistService.removeVideoFromBlacklist(entry.videoId).subscribe( 42 this.videoBlacklistService.removeVideoFromBlacklist(entry.videoId).subscribe(
41 () => { 43 () => {
42 this.notificationsService.success('Success', `Video ${entry.name} removed from the blacklist.`) 44 this.notificationsService.success(
45 this.i18n('Success'),
46 this.i18n('Video {{ name }} removed from the blacklist.', { name: entry.name })
47 )
43 this.loadData() 48 this.loadData()
44 }, 49 },
45 50
46 err => this.notificationsService.error('Error', err.message) 51 err => this.notificationsService.error(this.i18n('Error'), err.message)
47 ) 52 )
48 } 53 }
49 54
@@ -55,7 +60,7 @@ export class VideoBlacklistListComponent extends RestTable implements OnInit {
55 this.totalRecords = resultList.total 60 this.totalRecords = resultList.total
56 }, 61 },
57 62
58 err => this.notificationsService.error('Error', err.message) 63 err => this.notificationsService.error(this.i18n('Error'), err.message)
59 ) 64 )
60 } 65 }
61} 66}