diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-04-20 11:20:12 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-05-01 16:41:02 +0200 |
commit | 0251197e249cc03b65805ed6805da72bf4573529 (patch) | |
tree | 3aae202fd1ea24bac5cd7f2c380ffe50aae189a0 /client/src/app/+admin/moderation | |
parent | b8cf27c0f86d205a279d03b83e0e6728f46da67f (diff) | |
download | PeerTube-0251197e249cc03b65805ed6805da72bf4573529.tar.gz PeerTube-0251197e249cc03b65805ed6805da72bf4573529.tar.zst PeerTube-0251197e249cc03b65805ed6805da72bf4573529.zip |
Factorize rest-table and fix/simplify SQL
Diffstat (limited to 'client/src/app/+admin/moderation')
5 files changed, 20 insertions, 16 deletions
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' | |||
14 | export class InstanceAccountBlocklistComponent extends RestTable implements OnInit { | 14 | export class InstanceAccountBlocklistComponent extends RestTable implements OnInit { |
15 | blockedAccounts: AccountBlock[] = [] | 15 | blockedAccounts: AccountBlock[] = [] |
16 | totalRecords = 0 | 16 | totalRecords = 0 |
17 | rowsPerPageOptions = [ 20, 50, 100 ] | ||
18 | rowsPerPage = this.rowsPerPageOptions[0] | ||
19 | sort: SortMeta = { field: 'createdAt', order: -1 } | 17 | sort: SortMeta = { field: 'createdAt', order: -1 } |
20 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 18 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
21 | 19 | ||
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 | |||
17 | 17 | ||
18 | blockedServers: ServerBlock[] = [] | 18 | blockedServers: ServerBlock[] = [] |
19 | totalRecords = 0 | 19 | totalRecords = 0 |
20 | rowsPerPageOptions = [ 20, 50, 100 ] | ||
21 | rowsPerPage = this.rowsPerPageOptions[0] | ||
22 | sort: SortMeta = { field: 'createdAt', order: -1 } | 20 | sort: SortMeta = { field: 'createdAt', order: -1 } |
23 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 21 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
24 | 22 | ||
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 @@ | |||
20 | <th style="width: 40px;"></th> | 20 | <th style="width: 40px;"></th> |
21 | <th style="width: 20%;" pResizableColumn i18n>Reporter</th> | 21 | <th style="width: 20%;" pResizableColumn i18n>Reporter</th> |
22 | <th i18n>Video</th> | 22 | <th i18n>Video</th> |
23 | <th style="width:190px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | 23 | <th style="width: 190px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> |
24 | <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th> | 24 | <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th> |
25 | <th style="width: 120px;"></th> | 25 | <th style="width: 120px;"></th> |
26 | </tr> | 26 | </tr> |
@@ -59,7 +59,9 @@ | |||
59 | <span | 59 | <span |
60 | class="video-table-video-image-label" *ngIf="videoAbuse.count > 1" | 60 | class="video-table-video-image-label" *ngIf="videoAbuse.count > 1" |
61 | i18n-title title="This video has been reported multiple times." | 61 | i18n-title title="This video has been reported multiple times." |
62 | >{{ videoAbuse.nth }}/{{ videoAbuse.count }}</span> | 62 | > |
63 | {{ videoAbuse.nth }}/{{ videoAbuse.count }} | ||
64 | </span> | ||
63 | </div> | 65 | </div> |
64 | <div class="video-table-video-text"> | 66 | <div class="video-table-video-text"> |
65 | <div> | 67 | <div> |
@@ -67,7 +69,7 @@ | |||
67 | <span *ngIf="!videoAbuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span> | 69 | <span *ngIf="!videoAbuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span> |
68 | <span *ngIf="videoAbuse.video.blacklisted" i18n-title title="Video was blacklisted" class="glyphicon glyphicon-ban-circle"></span> | 70 | <span *ngIf="videoAbuse.video.blacklisted" i18n-title title="Video was blacklisted" class="glyphicon glyphicon-ban-circle"></span> |
69 | </div> | 71 | </div> |
70 | <div class="text-muted">by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div> | 72 | <div class="text-muted" i18n>by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div> |
71 | </div> | 73 | </div> |
72 | </div> | 74 | </div> |
73 | </a> | 75 | </a> |
@@ -75,13 +77,15 @@ | |||
75 | 77 | ||
76 | <td *ngIf="videoAbuse.video.deleted" class="c-hand" [pRowToggler]="videoAbuse"> | 78 | <td *ngIf="videoAbuse.video.deleted" class="c-hand" [pRowToggler]="videoAbuse"> |
77 | <div class="video-table-video" i18n-title title="Video was deleted"> | 79 | <div class="video-table-video" i18n-title title="Video was deleted"> |
78 | <div class="video-table-video-image"><span i18n>Deleted</span></div> | 80 | <div class="video-table-video-image"> |
81 | <span i18n>Deleted</span> | ||
82 | </div> | ||
79 | <div class="video-table-video-text"> | 83 | <div class="video-table-video-text"> |
80 | <div> | 84 | <div> |
81 | {{ videoAbuse.video.name }} | 85 | {{ videoAbuse.video.name }} |
82 | <span class="glyphicon glyphicon-trash"></span> | 86 | <span class="glyphicon glyphicon-trash"></span> |
83 | </div> | 87 | </div> |
84 | <div class="text-muted">by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div> | 88 | <div class="text-muted" i18n>by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div> |
85 | </div> | 89 | </div> |
86 | </div> | 90 | </div> |
87 | </td> | 91 | </td> |
@@ -107,8 +111,10 @@ | |||
107 | <tr> | 111 | <tr> |
108 | <td class="expand-cell" colspan="6"> | 112 | <td class="expand-cell" colspan="6"> |
109 | <div class="d-flex moderation-expanded"> | 113 | <div class="d-flex moderation-expanded"> |
110 | <!-- report metadata --> | 114 | <!-- report left part (report details) --> |
111 | <div class="col-8"> | 115 | <div class="col-8"> |
116 | |||
117 | <!-- report metadata --> | ||
112 | <div class="d-flex"> | 118 | <div class="d-flex"> |
113 | <span class="col-3 moderation-expanded-label" i18n>Reporter</span> | 119 | <span class="col-3 moderation-expanded-label" i18n>Reporter</span> |
114 | <span class="col-9 moderation-expanded-text"> | 120 | <span class="col-9 moderation-expanded-text"> |
@@ -128,6 +134,7 @@ | |||
128 | </a> | 134 | </a> |
129 | </span> | 135 | </span> |
130 | </div> | 136 | </div> |
137 | |||
131 | <div class="d-flex"> | 138 | <div class="d-flex"> |
132 | <span class="col-3 moderation-expanded-label" i18n>Reportee</span> | 139 | <span class="col-3 moderation-expanded-label" i18n>Reportee</span> |
133 | <span class="col-9 moderation-expanded-text"> | 140 | <span class="col-9 moderation-expanded-text"> |
@@ -147,6 +154,7 @@ | |||
147 | </a> | 154 | </a> |
148 | </span> | 155 | </span> |
149 | </div> | 156 | </div> |
157 | |||
150 | <div class="d-flex"> | 158 | <div class="d-flex"> |
151 | <span class="col-3 moderation-expanded-label" i18n>Updated</span> | 159 | <span class="col-3 moderation-expanded-label" i18n>Updated</span> |
152 | <time class="col-9 moderation-expanded-text video-details-date-updated">{{ videoAbuse.updatedAt | date: 'medium' }}</time> | 160 | <time class="col-9 moderation-expanded-text video-details-date-updated">{{ videoAbuse.updatedAt | date: 'medium' }}</time> |
@@ -157,16 +165,20 @@ | |||
157 | <span class="col-3 moderation-expanded-label" i18n>Report #{{ videoAbuse.id }}</span> | 165 | <span class="col-3 moderation-expanded-label" i18n>Report #{{ videoAbuse.id }}</span> |
158 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span> | 166 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span> |
159 | </div> | 167 | </div> |
168 | |||
160 | <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment"> | 169 | <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment"> |
161 | <span class="col-3 moderation-expanded-label" i18n>Note</span> | 170 | <span class="col-3 moderation-expanded-label" i18n>Note</span> |
162 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span> | 171 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span> |
163 | </div> | 172 | </div> |
173 | |||
164 | </div> | 174 | </div> |
165 | 175 | ||
176 | <!-- report right part (video details) --> | ||
166 | <div class="col-4"> | 177 | <div class="col-4"> |
167 | <div class="screenratio"> | 178 | <div class="screenratio"> |
168 | <div *ngIf="videoAbuse.video.deleted || videoAbuse.video.blacklisted"> | 179 | <div *ngIf="videoAbuse.video.deleted || videoAbuse.video.blacklisted"> |
169 | <span i18n>The video was {{ videoAbuse.video.deleted ? 'deleted' : 'blacklisted' }}</span> | 180 | <span i18n *ngIf="videoAbuse.video.deleted">The video was deleted</span> |
181 | <span i18n *ngIf="!videoAbuse.video.deleted">The video was blacklisted</span> | ||
170 | </div> | 182 | </div> |
171 | <div *ngIf="!videoAbuse.video.deleted && !videoAbuse.video.blacklisted" [innerHTML]="videoAbuse.embedHtml"></div> | 183 | <div *ngIf="!videoAbuse.video.deleted && !videoAbuse.video.blacklisted" [innerHTML]="videoAbuse.embedHtml"></div> |
172 | </div> | 184 | </div> |
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 | |||
29 | 29 | ||
30 | videoAbuses: (VideoAbuse & { moderationCommentHtml?: string, reasonHtml?: string })[] = [] | 30 | videoAbuses: (VideoAbuse & { moderationCommentHtml?: string, reasonHtml?: string })[] = [] |
31 | totalRecords = 0 | 31 | totalRecords = 0 |
32 | rowsPerPageOptions = [ 20, 50, 100 ] | ||
33 | rowsPerPage = this.rowsPerPageOptions[0] | ||
34 | sort: SortMeta = { field: 'createdAt', order: 1 } | 32 | sort: SortMeta = { field: 'createdAt', order: 1 } |
35 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 33 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
36 | 34 | ||
@@ -199,7 +197,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV | |||
199 | } | 197 | } |
200 | 198 | ||
201 | ngAfterViewInit () { | 199 | ngAfterViewInit () { |
202 | this.setTableFilter(this.search) | 200 | if (this.search) this.setTableFilter(this.search) |
203 | } | 201 | } |
204 | 202 | ||
205 | getIdentifier () { | 203 | 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' | |||
17 | export class VideoBlacklistListComponent extends RestTable implements OnInit { | 17 | export class VideoBlacklistListComponent extends RestTable implements OnInit { |
18 | blacklist: (VideoBlacklist & { reasonHtml?: string })[] = [] | 18 | blacklist: (VideoBlacklist & { reasonHtml?: string })[] = [] |
19 | totalRecords = 0 | 19 | totalRecords = 0 |
20 | rowsPerPageOptions = [ 20, 50, 100 ] | ||
21 | rowsPerPage = this.rowsPerPageOptions[0] | ||
22 | sort: SortMeta = { field: 'createdAt', order: -1 } | 20 | sort: SortMeta = { field: 'createdAt', order: -1 } |
23 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 21 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
24 | listBlacklistTypeFilter: VideoBlacklistType = undefined | 22 | listBlacklistTypeFilter: VideoBlacklistType = undefined |