From 0251197e249cc03b65805ed6805da72bf4573529 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 20 Apr 2020 11:20:12 +0200 Subject: Factorize rest-table and fix/simplify SQL --- .../instance-account-blocklist.component.ts | 2 -- .../instance-server-blocklist.component.ts | 2 -- .../video-abuse-list.component.html | 26 ++++++++++++++++------ .../video-abuse-list/video-abuse-list.component.ts | 4 +--- .../video-blacklist-list.component.ts | 2 -- 5 files changed, 20 insertions(+), 16 deletions(-) (limited to 'client/src/app/+admin/moderation') diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts index 6bd015234..73a9ae75d 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts @@ -14,8 +14,6 @@ import { Actor } from '@app/shared/actor/actor.model' export class InstanceAccountBlocklistComponent extends RestTable implements OnInit { blockedAccounts: AccountBlock[] = [] totalRecords = 0 - rowsPerPageOptions = [ 20, 50, 100 ] - rowsPerPage = this.rowsPerPageOptions[0] sort: SortMeta = { field: 'createdAt', order: -1 } pagination: RestPagination = { count: this.rowsPerPage, start: 0 } diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts index 344e2d135..559c9c0b0 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts @@ -17,8 +17,6 @@ export class InstanceServerBlocklistComponent extends RestTable implements OnIni blockedServers: ServerBlock[] = [] totalRecords = 0 - rowsPerPageOptions = [ 20, 50, 100 ] - rowsPerPage = this.rowsPerPageOptions[0] sort: SortMeta = { field: 'createdAt', order: -1 } pagination: RestPagination = { count: this.rowsPerPage, start: 0 } diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html index 6dacfe243..4afa2850b 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html @@ -20,7 +20,7 @@ Reporter Video - Created + Created State @@ -59,7 +59,9 @@ {{ videoAbuse.nth }}/{{ videoAbuse.count }} + > + {{ videoAbuse.nth }}/{{ videoAbuse.count }} +
@@ -67,7 +69,7 @@
-
by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }}
+
by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }}
@@ -75,13 +77,15 @@
-
Deleted
+
+ Deleted +
{{ videoAbuse.video.name }}
-
by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }}
+
by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }}
@@ -107,8 +111,10 @@
- +
+ +
Reporter @@ -128,6 +134,7 @@
+
Reportee @@ -147,6 +154,7 @@
+
Updated @@ -157,16 +165,20 @@ Report #{{ videoAbuse.id }}
+
Note
+
+
- The video was {{ videoAbuse.video.deleted ? 'deleted' : 'blacklisted' }} + The video was deleted + The video was blacklisted
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts index 2ece5dcc1..f04efa9fc 100644 --- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts +++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts @@ -29,8 +29,6 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV videoAbuses: (VideoAbuse & { moderationCommentHtml?: string, reasonHtml?: string })[] = [] totalRecords = 0 - rowsPerPageOptions = [ 20, 50, 100 ] - rowsPerPage = this.rowsPerPageOptions[0] sort: SortMeta = { field: 'createdAt', order: 1 } pagination: RestPagination = { count: this.rowsPerPage, start: 0 } @@ -199,7 +197,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV } ngAfterViewInit () { - this.setTableFilter(this.search) + if (this.search) this.setTableFilter(this.search) } getIdentifier () { diff --git a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts index e9925f9bf..63ecdeb9f 100644 --- a/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts +++ b/client/src/app/+admin/moderation/video-blacklist-list/video-blacklist-list.component.ts @@ -17,8 +17,6 @@ import { MarkdownService } from '@app/shared/renderer' export class VideoBlacklistListComponent extends RestTable implements OnInit { blacklist: (VideoBlacklist & { reasonHtml?: string })[] = [] totalRecords = 0 - rowsPerPageOptions = [ 20, 50, 100 ] - rowsPerPage = this.rowsPerPageOptions[0] sort: SortMeta = { field: 'createdAt', order: -1 } pagination: RestPagination = { count: this.rowsPerPage, start: 0 } listBlacklistTypeFilter: VideoBlacklistType = undefined -- cgit v1.2.3