aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/moderation/video-auto-blacklist-list
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/moderation/video-auto-blacklist-list')
-rw-r--r--client/src/app/+admin/moderation/video-auto-blacklist-list/index.ts1
-rw-r--r--client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.html20
-rw-r--r--client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.scss14
-rw-r--r--client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.ts86
4 files changed, 0 insertions, 121 deletions
diff --git a/client/src/app/+admin/moderation/video-auto-blacklist-list/index.ts b/client/src/app/+admin/moderation/video-auto-blacklist-list/index.ts
deleted file mode 100644
index e3522f68c..000000000
--- a/client/src/app/+admin/moderation/video-auto-blacklist-list/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-auto-blacklist-list.component'
diff --git a/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.html b/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.html
deleted file mode 100644
index e2193b630..000000000
--- a/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.html
+++ /dev/null
@@ -1,20 +0,0 @@
1<my-videos-selection
2 [pagination]="pagination"
3 [(selection)]="selection"
4 [(videosModel)]="videos"
5 [miniatureDisplayOptions]="miniatureDisplayOptions"
6 [titlePage]="titlePage"
7 [getVideosObservableFunction]="getVideosObservableFunction"
8>
9 <ng-template ptTemplate="globalButtons">
10 <span class="action-button action-button-unblacklist-selection" (click)="removeSelectedVideosFromBlacklist()">
11 <my-global-icon iconName="tick"></my-global-icon>
12 <ng-container i18n>Unblacklist</ng-container>
13 </span>
14 </ng-template>
15
16 <ng-template ptTemplate="rowButtons" let-video>
17 <my-button i18n-label label="Unblacklist" icon="tick" (click)="removeVideoFromBlacklist(video)"></my-button>
18 </ng-template>
19
20</my-videos-selection>
diff --git a/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.scss b/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.scss
deleted file mode 100644
index 85ebc6041..000000000
--- a/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.scss
+++ /dev/null
@@ -1,14 +0,0 @@
1@import '_variables';
2@import '_mixins';
3
4.action-button-unblacklist-selection {
5 display: inline-block;
6
7 @include peertube-button;
8 @include orange-button;
9 @include button-with-icon(21px);
10
11 my-global-icon {
12 @include apply-svg-color(#fff);
13 }
14}
diff --git a/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.ts b/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.ts
deleted file mode 100644
index fb2962b47..000000000
--- a/client/src/app/+admin/moderation/video-auto-blacklist-list/video-auto-blacklist-list.component.ts
+++ /dev/null
@@ -1,86 +0,0 @@
1import { Component } from '@angular/core'
2import { I18n } from '@ngx-translate/i18n-polyfill'
3import { ActivatedRoute, Router } from '@angular/router'
4import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
5import { AuthService, Notifier, ServerService } from '@app/core'
6import { VideoBlacklistService } from '@app/shared'
7import { immutableAssign } from '@app/shared/misc/utils'
8import { ScreenService } from '@app/shared/misc/screen.service'
9import { MiniatureDisplayOptions } from '@app/shared/video/video-miniature.component'
10import { SelectionType } from '@app/shared/video/videos-selection.component'
11import { Video } from '@app/shared/video/video.model'
12
13@Component({
14 selector: 'my-video-auto-blacklist-list',
15 templateUrl: './video-auto-blacklist-list.component.html',
16 styleUrls: [ './video-auto-blacklist-list.component.scss' ]
17})
18export class VideoAutoBlacklistListComponent {
19 titlePage: string
20 selection: SelectionType = {}
21 miniatureDisplayOptions: MiniatureDisplayOptions = {
22 date: true,
23 views: false,
24 by: true,
25 privacyLabel: false,
26 privacyText: true,
27 state: false,
28 blacklistInfo: false,
29 nsfw: true
30 }
31 pagination: ComponentPagination = {
32 currentPage: 1,
33 itemsPerPage: 5,
34 totalItems: null
35 }
36 videos: Video[] = []
37 getVideosObservableFunction = this.getVideosObservable.bind(this)
38
39 constructor (
40 protected router: Router,
41 protected route: ActivatedRoute,
42 protected notifier: Notifier,
43 protected authService: AuthService,
44 protected screenService: ScreenService,
45 protected serverService: ServerService,
46 private i18n: I18n,
47 private videoBlacklistService: VideoBlacklistService
48 ) {
49 this.titlePage = this.i18n('Auto-blacklisted videos')
50 }
51
52 getVideosObservable (page: number) {
53 const newPagination = immutableAssign(this.pagination, { currentPage: page })
54
55 return this.videoBlacklistService.getAutoBlacklistedAsVideoList(newPagination)
56 }
57
58 removeVideoFromBlacklist (entry: Video) {
59 this.videoBlacklistService.removeVideoFromBlacklist(entry.id).subscribe(
60 () => {
61 this.notifier.success(this.i18n('Video {{name}} removed from blacklist.', { name: entry.name }))
62
63 this.videos = this.videos.filter(v => v.id !== entry.id)
64 },
65
66 error => this.notifier.error(error.message)
67 )
68 }
69
70 removeSelectedVideosFromBlacklist () {
71 const toReleaseVideosIds = Object.keys(this.selection)
72 .filter(k => this.selection[ k ] === true)
73 .map(k => parseInt(k, 10))
74
75 this.videoBlacklistService.removeVideoFromBlacklist(toReleaseVideosIds).subscribe(
76 () => {
77 this.notifier.success(this.i18n('{{num}} videos removed from blacklist.', { num: toReleaseVideosIds.length }))
78
79 this.selection = {}
80 this.videos = this.videos.filter(v => toReleaseVideosIds.includes(v.id) === false)
81 },
82
83 error => this.notifier.error(error.message)
84 )
85 }
86}