Add search for video, reporter and channel name fields
[oweals/peertube.git] / client / src / app / +admin / moderation / video-abuse-list / video-abuse-list.component.html
1 <p-table
2   [value]="videoAbuses" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
3   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true"
4   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
5   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports"
6 >
7   <ng-template pTemplate="caption">
8     <div class="caption">
9       <div class="ml-auto">
10         <input
11           type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
12           (keyup)="onSearch($event)"
13         >
14       </div>
15     </div>
16   </ng-template>
17
18   <ng-template pTemplate="header">
19     <tr> <!-- header -->
20       <th style="width: 40px;"></th>
21       <th style="width: 20%;" pResizableColumn i18n>Reporter</th>
22       <th i18n>Video</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>
25       <th style="width: 120px;"></th>
26     </tr>
27   </ng-template>
28
29   <ng-template pTemplate="body" let-expanded="expanded" let-videoAbuse>
30     <tr>
31       <td class="c-hand" [pRowToggler]="videoAbuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body">
32         <span class="expander">
33           <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
34         </span>
35       </td>
36
37       <td>
38         <a [href]="videoAbuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
39           <div class="chip two-lines">
40             <img
41               class="avatar"
42               [src]="videoAbuse.reporterAccount.avatar.path"
43               (error)="switchToDefaultAvatar($event)"
44               alt="Avatar"
45             >
46             <div>
47               {{ videoAbuse.reporterAccount.displayName }}
48               <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span>
49             </div>
50           </div>
51         </a>
52       </td>
53
54       <td *ngIf="!videoAbuse.video.deleted">
55         <a [href]="getVideoUrl(videoAbuse)" class="video-abuse-video-link" i18n-title title="Open video in a new tab" target="_blank" rel="noopener noreferrer">
56           <div class="video-abuse-video">
57             <div class="video-abuse-video-image"><img [src]="videoAbuse.video.thumbnailPath"></div>
58             <div class="video-abuse-video-text">
59               <div>
60                 {{ videoAbuse.video.name }}
61                 <span *ngIf="!videoAbuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span>
62                 <span *ngIf="videoAbuse.video.blacklisted" i18n-title title="Video was blacklisted" class="glyphicon glyphicon-ban-circle"></span>
63               </div>
64               <div class="text-muted">by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div>
65             </div>
66           </div>
67         </a>
68       </td>
69
70       <td *ngIf="videoAbuse.video.deleted" class="c-hand" [pRowToggler]="videoAbuse">
71         <div class="video-abuse-video" i18n-title title="Video was deleted">
72           <div class="video-abuse-video-image"><span i18n>Deleted</span></div>
73           <div class="video-abuse-video-text">
74             <div>
75               {{ videoAbuse.video.name }}
76               <span class="glyphicon glyphicon-trash"></span>
77             </div>
78             <div class="text-muted">by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div>
79           </div>
80         </div>
81       </td>
82
83       <td class="c-hand" [pRowToggler]="videoAbuse">{{ videoAbuse.createdAt }}</td>
84
85       <td class="c-hand video-abuse-states" [pRowToggler]="videoAbuse">
86         <span *ngIf="isVideoAbuseAccepted(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-ok"></span>
87         <span *ngIf="isVideoAbuseRejected(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-remove"></span>
88         <span *ngIf="videoAbuse.moderationComment" [title]="videoAbuse.moderationComment" class="glyphicon glyphicon-comment"></span>
89       </td>
90
91       <td class="action-cell">
92         <my-action-dropdown placement="bottom-right auto" container="body" i18n-label label="Actions" [actions]="videoAbuseActions" [entry]="videoAbuse"></my-action-dropdown>
93       </td>
94     </tr>
95   </ng-template>
96
97   <ng-template pTemplate="rowexpansion" let-videoAbuse>
98       <tr>
99         <td class="expand-cell" colspan="6">
100           <div class="d-flex">
101             <div class="col-8">
102               <div class="d-flex">
103                 <span class="col-3 moderation-expanded-label" i18n>Reason:</span>
104                 <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span>
105               </div>
106               <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment">
107                 <span class="col-3 moderation-expanded-label" i18n>Note:</span>
108                 <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span>
109               </div>
110             </div>
111
112             <div class="col-4">
113               <div class="screenratio">
114                 <div *ngIf="videoAbuse.video.deleted || videoAbuse.video.blacklisted">
115                   <span i18n>The video was {{ videoAbuse.video.deleted ? 'deleted' : 'blacklisted' }}</span>
116                 </div>
117                 <div *ngIf="!videoAbuse.video.deleted && !videoAbuse.video.blacklisted" [innerHTML]="videoAbuse.embedHtml"></div>
118               </div>
119             </div>
120           </div>
121         </td>
122       </tr>
123   </ng-template>
124 </p-table>
125
126 <my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal>