diff options
Diffstat (limited to 'client/src/app/+admin/video-abuses/video-abuse-list')
-rw-r--r-- | client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.html | 37 | ||||
-rw-r--r-- | client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts | 8 |
2 files changed, 27 insertions, 18 deletions
diff --git a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.html b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.html index 65d061246..2779db5bc 100644 --- a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.html +++ b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.html | |||
@@ -2,18 +2,27 @@ | |||
2 | <div class="admin-sub-title">Video abuses list</div> | 2 | <div class="admin-sub-title">Video abuses list</div> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <p-dataTable | 5 | <p-table |
6 | [value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | 6 | [value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" |
7 | sortField="id" (onLazyLoad)="loadLazy($event)" | 7 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" |
8 | > | 8 | > |
9 | <p-column field="id" header="ID" [sortable]="true" [style]="{ width: '60px' }"></p-column> | 9 | <ng-template pTemplate="header"> |
10 | <p-column field="reason" header="Reason"></p-column> | 10 | <tr> |
11 | <p-column field="reporterServerHost" header="Reporter server host"></p-column> | 11 | <th>Reason</th> |
12 | <p-column field="reporterUsername" header="Reporter username"></p-column> | 12 | <th>Reporter</th> |
13 | <p-column field="createdAt" header="Created date" [sortable]="true"></p-column> | 13 | <th pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> |
14 | <p-column header="Video"> | 14 | <th>Video</th> |
15 | <ng-template pTemplate="body" let-videoAbuse="rowData"> | 15 | </tr> |
16 | <a [routerLink]="getRouterVideoLink(videoAbuse.videoId)" title="Go to the video">{{ videoAbuse.videoName }}</a> | 16 | </ng-template> |
17 | </ng-template> | 17 | |
18 | </p-column> | 18 | <ng-template pTemplate="body" let-videoAbuse> |
19 | </p-dataTable> | 19 | <tr> |
20 | <td>{{ videoAbuse.reason }}</td> | ||
21 | <td>{{ videoAbuse.reporterServerHost + '@' + videoAbuse.reporterUsername }}</td> | ||
22 | <td>{{ videoAbuse.createdAt }}</td> | ||
23 | <td> | ||
24 | <a [routerLink]="getRouterVideoLink(videoAbuse.videoUUID)" title="Go to the video">{{ videoAbuse.videoName }}</a> | ||
25 | </td> | ||
26 | </tr> | ||
27 | </ng-template> | ||
28 | </p-table> | ||
diff --git a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts index b4d3bbd24..bf9483f34 100644 --- a/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts +++ b/client/src/app/+admin/video-abuses/video-abuse-list/video-abuse-list.component.ts | |||
@@ -15,7 +15,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit { | |||
15 | videoAbuses: VideoAbuse[] = [] | 15 | videoAbuses: VideoAbuse[] = [] |
16 | totalRecords = 0 | 16 | totalRecords = 0 |
17 | rowsPerPage = 10 | 17 | rowsPerPage = 10 |
18 | sort: SortMeta = { field: 'id', order: 1 } | 18 | sort: SortMeta = { field: 'createdAt', order: 1 } |
19 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 19 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
20 | 20 | ||
21 | constructor ( | 21 | constructor ( |
@@ -26,11 +26,11 @@ export class VideoAbuseListComponent extends RestTable implements OnInit { | |||
26 | } | 26 | } |
27 | 27 | ||
28 | ngOnInit () { | 28 | ngOnInit () { |
29 | this.loadData() | 29 | this.loadSort() |
30 | } | 30 | } |
31 | 31 | ||
32 | getRouterVideoLink (videoId: number) { | 32 | getRouterVideoLink (videoUUID: string) { |
33 | return [ '/videos', videoId ] | 33 | return [ '/videos', videoUUID ] |
34 | } | 34 | } |
35 | 35 | ||
36 | protected loadData () { | 36 | protected loadData () { |