diff options
Diffstat (limited to 'client/src/app/+admin/video-blacklist')
7 files changed, 0 insertions, 182 deletions
diff --git a/client/src/app/+admin/video-blacklist/index.ts b/client/src/app/+admin/video-blacklist/index.ts deleted file mode 100644 index a5451e2e1..000000000 --- a/client/src/app/+admin/video-blacklist/index.ts +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | export * from './video-blacklist-list' | ||
2 | export * from './video-blacklist.component' | ||
3 | export * from './video-blacklist.routes' | ||
diff --git a/client/src/app/+admin/video-blacklist/video-blacklist-list/index.ts b/client/src/app/+admin/video-blacklist/video-blacklist-list/index.ts deleted file mode 100644 index 4daf64187..000000000 --- a/client/src/app/+admin/video-blacklist/video-blacklist-list/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './video-blacklist-list.component' | ||
diff --git a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.html b/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.html deleted file mode 100644 index 05b3a300c..000000000 --- a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.html +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | <div class="admin-sub-header"> | ||
2 | <div i18n class="form-sub-title">Blacklisted videos</div> | ||
3 | </div> | ||
4 | |||
5 | <p-table | ||
6 | [value]="blacklist" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | ||
7 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" | ||
8 | > | ||
9 | <ng-template pTemplate="header"> | ||
10 | <tr> | ||
11 | <th style="width: 40px"></th> | ||
12 | <th i18n pSortableColumn="name">Video name <p-sortIcon field="name"></p-sortIcon></th> | ||
13 | <th i18n>Sensitive</th> | ||
14 | <th i18n pSortableColumn="createdAt">Date <p-sortIcon field="createdAt"></p-sortIcon></th> | ||
15 | <th style="width: 50px;"></th> | ||
16 | </tr> | ||
17 | </ng-template> | ||
18 | |||
19 | <ng-template pTemplate="body" let-videoBlacklist let-expanded="expanded"> | ||
20 | <tr> | ||
21 | <td> | ||
22 | <span *ngIf="videoBlacklist.reason" class="expander" [pRowToggler]="videoBlacklist"> | ||
23 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | ||
24 | </span> | ||
25 | </td> | ||
26 | |||
27 | <td> | ||
28 | <a [href]="getVideoUrl(videoBlacklist)" i18n-title title="Go to the video" target="_blank" rel="noopener noreferrer"> | ||
29 | {{ videoBlacklist.video.name }} | ||
30 | </a> | ||
31 | </td> | ||
32 | |||
33 | <td>{{ videoBlacklist.video.nsfw }}</td> | ||
34 | <td>{{ videoBlacklist.createdAt }}</td> | ||
35 | |||
36 | <td class="action-cell"> | ||
37 | <my-action-dropdown i18n-label label="Actions" [actions]="videoBlacklistActions" [entry]="videoBlacklist"></my-action-dropdown> | ||
38 | </td> | ||
39 | </tr> | ||
40 | </ng-template> | ||
41 | |||
42 | <ng-template pTemplate="rowexpansion" let-videoBlacklist> | ||
43 | <tr class="blacklist-reason"> | ||
44 | <td colspan="6"> | ||
45 | <span i18n class="blacklist-reason-label">Blacklist reason:</span> | ||
46 | {{ videoBlacklist.reason }} | ||
47 | </td> | ||
48 | </tr> | ||
49 | </ng-template> | ||
50 | </p-table> | ||
51 | |||
diff --git a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.scss b/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.scss deleted file mode 100644 index 5265536ca..000000000 --- a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.scss +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | @import '_variables'; | ||
2 | @import '_mixins'; | ||
3 | |||
4 | .blacklist-reason-label { | ||
5 | font-weight: $font-semibold; | ||
6 | } \ No newline at end of file | ||
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 deleted file mode 100644 index 0618252b8..000000000 --- a/client/src/app/+admin/video-blacklist/video-blacklist-list/video-blacklist-list.component.ts +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | ||
2 | import { SortMeta } from 'primeng/components/common/sortmeta' | ||
3 | import { NotificationsService } from 'angular2-notifications' | ||
4 | import { ConfirmService } from '../../../core' | ||
5 | import { RestPagination, RestTable, VideoBlacklistService } from '../../../shared' | ||
6 | import { VideoBlacklist } from '../../../../../../shared' | ||
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' | ||
9 | import { Video } from '@app/shared/video/video.model' | ||
10 | |||
11 | @Component({ | ||
12 | selector: 'my-video-blacklist-list', | ||
13 | templateUrl: './video-blacklist-list.component.html', | ||
14 | styleUrls: [ './video-blacklist-list.component.scss' ] | ||
15 | }) | ||
16 | export class VideoBlacklistListComponent extends RestTable implements OnInit { | ||
17 | blacklist: VideoBlacklist[] = [] | ||
18 | totalRecords = 0 | ||
19 | rowsPerPage = 10 | ||
20 | sort: SortMeta = { field: 'createdAt', order: 1 } | ||
21 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | ||
22 | |||
23 | videoBlacklistActions: DropdownAction<VideoBlacklist>[] = [] | ||
24 | |||
25 | constructor ( | ||
26 | private notificationsService: NotificationsService, | ||
27 | private confirmService: ConfirmService, | ||
28 | private videoBlacklistService: VideoBlacklistService, | ||
29 | private i18n: I18n | ||
30 | ) { | ||
31 | super() | ||
32 | |||
33 | this.videoBlacklistActions = [ | ||
34 | { | ||
35 | label: this.i18n('Unblacklist'), | ||
36 | handler: videoBlacklist => this.removeVideoFromBlacklist(videoBlacklist) | ||
37 | } | ||
38 | ] | ||
39 | } | ||
40 | |||
41 | ngOnInit () { | ||
42 | this.loadSort() | ||
43 | } | ||
44 | |||
45 | getVideoUrl (videoBlacklist: VideoBlacklist) { | ||
46 | return Video.buildClientUrl(videoBlacklist.video.uuid) | ||
47 | } | ||
48 | |||
49 | async removeVideoFromBlacklist (entry: VideoBlacklist) { | ||
50 | const confirmMessage = this.i18n( | ||
51 | 'Do you really want to remove this video from the blacklist? It will be available again in the videos list.' | ||
52 | ) | ||
53 | |||
54 | const res = await this.confirmService.confirm(confirmMessage, this.i18n('Unblacklist')) | ||
55 | if (res === false) return | ||
56 | |||
57 | this.videoBlacklistService.removeVideoFromBlacklist(entry.video.id).subscribe( | ||
58 | () => { | ||
59 | this.notificationsService.success( | ||
60 | this.i18n('Success'), | ||
61 | this.i18n('Video {{name}} removed from the blacklist.', { name: entry.video.name }) | ||
62 | ) | ||
63 | this.loadData() | ||
64 | }, | ||
65 | |||
66 | err => this.notificationsService.error(this.i18n('Error'), err.message) | ||
67 | ) | ||
68 | } | ||
69 | |||
70 | protected loadData () { | ||
71 | this.videoBlacklistService.listBlacklist(this.pagination, this.sort) | ||
72 | .subscribe( | ||
73 | resultList => { | ||
74 | this.blacklist = resultList.data | ||
75 | this.totalRecords = resultList.total | ||
76 | }, | ||
77 | |||
78 | err => this.notificationsService.error(this.i18n('Error'), err.message) | ||
79 | ) | ||
80 | } | ||
81 | } | ||
diff --git a/client/src/app/+admin/video-blacklist/video-blacklist.component.ts b/client/src/app/+admin/video-blacklist/video-blacklist.component.ts deleted file mode 100644 index 24b8c98f8..000000000 --- a/client/src/app/+admin/video-blacklist/video-blacklist.component.ts +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | import { Component } from '@angular/core' | ||
2 | |||
3 | @Component({ | ||
4 | template: '<router-outlet></router-outlet>' | ||
5 | }) | ||
6 | export class VideoBlacklistComponent { | ||
7 | } | ||
diff --git a/client/src/app/+admin/video-blacklist/video-blacklist.routes.ts b/client/src/app/+admin/video-blacklist/video-blacklist.routes.ts deleted file mode 100644 index b1e0e5049..000000000 --- a/client/src/app/+admin/video-blacklist/video-blacklist.routes.ts +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | import { Routes } from '@angular/router' | ||
2 | |||
3 | import { UserRightGuard } from '../../core' | ||
4 | import { UserRight } from '../../../../../shared' | ||
5 | import { VideoBlacklistComponent } from './video-blacklist.component' | ||
6 | import { VideoBlacklistListComponent } from './video-blacklist-list' | ||
7 | |||
8 | export const VideoBlacklistRoutes: Routes = [ | ||
9 | { | ||
10 | path: 'video-blacklist', | ||
11 | component: VideoBlacklistComponent, | ||
12 | canActivate: [ UserRightGuard ], | ||
13 | data: { | ||
14 | userRight: UserRight.MANAGE_VIDEO_BLACKLIST | ||
15 | }, | ||
16 | children: [ | ||
17 | { | ||
18 | path: '', | ||
19 | redirectTo: 'list', | ||
20 | pathMatch: 'full' | ||
21 | }, | ||
22 | { | ||
23 | path: 'list', | ||
24 | component: VideoBlacklistListComponent, | ||
25 | data: { | ||
26 | meta: { | ||
27 | title: 'Blacklisted videos' | ||
28 | } | ||
29 | } | ||
30 | } | ||
31 | ] | ||
32 | } | ||
33 | ] | ||