]>
Commit | Line | Data |
---|---|---|
94148c90 C |
1 | <p-table |
2 | [value]="abuses" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" | |
6c53d8bf | 3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true" |
94148c90 C |
4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate |
5 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports" | |
6 | (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" | |
7 | > | |
8 | <ng-template pTemplate="caption"> | |
9 | <div class="caption"> | |
10 | <div class="ml-auto"> | |
11 | <div class="input-group has-feedback has-clear"> | |
12 | <div class="input-group-prepend c-hand" ngbDropdown placement="bottom-left auto" container="body"> | |
13 | <div class="input-group-text" ngbDropdownToggle> | |
14 | <span class="caret" aria-haspopup="menu" role="button"></span> | |
15 | </div> | |
16 | ||
17 | <div role="menu" ngbDropdownMenu> | |
18 | <h6 class="dropdown-header" i18n>Advanced report filters</h6> | |
594d3e48 C |
19 | <a [routerLink]="[ baseRoute ]" [queryParams]="{ 'search': 'state:pending' }" class="dropdown-item" i18n>Unsolved reports</a> |
20 | <a [routerLink]="[ baseRoute ]" [queryParams]="{ 'search': 'state:accepted' }" class="dropdown-item" i18n>Accepted reports</a> | |
21 | <a [routerLink]="[ baseRoute ]" [queryParams]="{ 'search': 'state:rejected' }" class="dropdown-item" i18n>Refused reports</a> | |
22 | <a [routerLink]="[ baseRoute ]" [queryParams]="{ 'search': 'videoIs:blacklisted' }" class="dropdown-item" i18n>Reports with blocked videos</a> | |
23 | <a [routerLink]="[ baseRoute ]" [queryParams]="{ 'search': 'videoIs:deleted' }" class="dropdown-item" i18n>Reports with deleted videos</a> | |
94148c90 C |
24 | </div> |
25 | </div> | |
26 | <input | |
27 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
5ed46c1b | 28 | (keyup)="onSearch($event)" |
94148c90 C |
29 | > |
30 | <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetTableFilter()"></a> | |
31 | <span class="sr-only" i18n>Clear filters</span> | |
32 | </div> | |
33 | </div> | |
34 | </div> | |
35 | </ng-template> | |
36 | ||
37 | <ng-template pTemplate="header"> | |
38 | <tr> <!-- header --> | |
39 | <th style="width: 40px;"></th> | |
7706b370 | 40 | <th style="width: 150px;"></th> |
94148c90 C |
41 | <th *ngIf="isAdminView()" style="width: 20%;" pResizableColumn i18n>Reporter</th> |
42 | <th i18n>Video/Comment/Account</th> | |
43 | <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
44 | <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th> | |
45 | <th i18n style="width: 80px;">Messages</th> | |
d573926e | 46 | <th i18n *ngIf="isAdminView()" style="width: 100px;">Internal note</th> |
94148c90 C |
47 | </tr> |
48 | </ng-template> | |
49 | ||
50 | <ng-template pTemplate="body" let-expanded="expanded" let-abuse> | |
51 | <tr> | |
7706b370 | 52 | <td class="expand-cell c-hand" [pRowToggler]="abuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body"> |
94148c90 C |
53 | <span class="expander"> |
54 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | |
55 | </span> | |
56 | </td> | |
57 | ||
7706b370 C |
58 | <td class="action-cell"> |
59 | <my-action-dropdown | |
60 | [ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body" | |
61 | i18n-label label="Actions" [actions]="abuseActions" [entry]="abuse" | |
62 | ></my-action-dropdown> | |
63 | </td> | |
64 | ||
94148c90 C |
65 | <td *ngIf="isAdminView()"> |
66 | <a *ngIf="abuse.reporterAccount" [href]="abuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer"> | |
67 | <div class="chip two-lines"> | |
746018f6 | 68 | <my-actor-avatar [account]="abuse.reporterAccount"></my-actor-avatar> |
94148c90 C |
69 | <div> |
70 | {{ abuse.reporterAccount.displayName }} | |
71 | <span>{{ abuse.reporterAccount.nameWithHost }}</span> | |
72 | </div> | |
73 | </div> | |
74 | </a> | |
75 | ||
76 | <span i18n *ngIf="!abuse.reporterAccount"> | |
77 | Deleted account | |
78 | </span> | |
79 | </td> | |
80 | ||
81 | <ng-container *ngIf="abuse.video"> | |
82 | ||
83 | <td *ngIf="!abuse.video.deleted"> | |
84 | <a [href]="getVideoUrl(abuse)" class="table-video-link" [title]="abuse.video.name" target="_blank" rel="noopener noreferrer"> | |
85 | <div class="table-video"> | |
86 | <div class="table-video-image"> | |
87 | <img [src]="abuse.video.thumbnailPath"> | |
88 | <span | |
89 | class="table-video-image-label" *ngIf="abuse.count > 1" | |
90 | i18n-title title="This video has been reported multiple times." | |
91 | > | |
92 | {{ abuse.nth }}/{{ abuse.count }} | |
93 | </span> | |
94 | </div> | |
95 | ||
96 | <div class="table-video-text"> | |
97 | <div> | |
98 | <span *ngIf="!abuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span> | |
99 | <span *ngIf="abuse.video.blacklisted" i18n-title title="The video was blocked" class="glyphicon glyphicon-ban-circle"></span> | |
100 | {{ abuse.video.name }} | |
101 | </div> | |
102 | <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div> | |
103 | </div> | |
104 | </div> | |
105 | </a> | |
106 | </td> | |
107 | ||
108 | <td *ngIf="abuse.video.deleted" class="c-hand" [pRowToggler]="abuse"> | |
109 | <div class="table-video" i18n-title title="Video was deleted"> | |
110 | <div class="table-video-image"> | |
111 | <span i18n>Deleted</span> | |
112 | </div> | |
113 | ||
114 | <div class="table-video-text"> | |
115 | <div> | |
116 | {{ abuse.video.name }} | |
117 | <span class="glyphicon glyphicon-trash"></span> | |
118 | </div> | |
119 | <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div> | |
120 | </div> | |
121 | </div> | |
122 | </td> | |
123 | </ng-container> | |
124 | ||
125 | <ng-container *ngIf="abuse.comment"> | |
126 | <td> | |
127 | <a [href]="getCommentUrl(abuse)" [innerHTML]="abuse.truncatedCommentHtml" class="table-comment-link" | |
128 | [title]="abuse.comment.video.name" target="_blank" rel="noopener noreferrer" | |
129 | ></a> | |
130 | ||
131 | <div class="comment-flagged-account" *ngIf="abuse.flaggedAccount">by {{ abuse.flaggedAccount.displayName }}</div> | |
132 | </td> | |
133 | </ng-container> | |
134 | ||
135 | <ng-container *ngIf="!abuse.comment && !abuse.video"> | |
136 | <td *ngIf="abuse.flaggedAccount"> | |
137 | <a [href]="getAccountUrl(abuse)" class="table-account-link" target="_blank" rel="noopener noreferrer"> | |
138 | <span>{{ abuse.flaggedAccount.displayName }}</span> | |
139 | ||
140 | <span class="account-flagged-handle">{{ abuse.flaggedAccount.nameWithHostForced }}</span> | |
141 | </a> | |
142 | </td> | |
143 | ||
144 | <td i18n *ngIf="!abuse.flaggedAccount"> | |
145 | Account deleted | |
146 | </td> | |
147 | ||
148 | </ng-container> | |
149 | ||
94148c90 C |
150 | <td class="c-hand" [pRowToggler]="abuse">{{ abuse.createdAt | date: 'short' }}</td> |
151 | ||
152 | <td class="c-hand abuse-states" [pRowToggler]="abuse"> | |
153 | <span *ngIf="isAbuseAccepted(abuse)" [title]="abuse.state.label" class="glyphicon glyphicon-ok"></span> | |
154 | <span *ngIf="isAbuseRejected(abuse)" [title]="abuse.state.label" class="glyphicon glyphicon-remove"></span> | |
94148c90 C |
155 | </td> |
156 | ||
157 | <td class="c-hand abuse-messages" (click)="openAbuseMessagesModal(abuse)"> | |
158 | <ng-container *ngIf="isLocalAbuse(abuse)"> | |
159 | {{ abuse.countMessages }} | |
160 | ||
161 | <my-global-icon iconName="message-circle"></my-global-icon> | |
162 | </ng-container> | |
163 | </td> | |
164 | ||
d573926e C |
165 | <td *ngIf="isAdminView()" class="internal-note" container="body" placement="left auto" [ngbTooltip]="abuse.moderationComment"> |
166 | {{ abuse.moderationComment }} | |
167 | </td> | |
94148c90 C |
168 | </tr> |
169 | </ng-template> | |
170 | ||
171 | <ng-template pTemplate="rowexpansion" let-abuse> | |
172 | <tr> | |
71ab65d0 | 173 | <td class="expand-cell" colspan="8"> |
94148c90 C |
174 | <my-abuse-details [abuse]="abuse" [baseRoute]="baseRoute" [isAdminView]="isAdminView()"></my-abuse-details> |
175 | </td> | |
176 | </tr> | |
177 | </ng-template> | |
178 | ||
179 | <ng-template pTemplate="emptymessage"> | |
180 | <tr> | |
181 | <td colspan="6"> | |
182 | <div class="no-results"> | |
183 | <ng-container *ngIf="search" i18n>No abuses found matching current filters.</ng-container> | |
184 | <ng-container *ngIf="!search" i18n>No abuses found.</ng-container> | |
185 | </div> | |
186 | </td> | |
187 | </tr> | |
188 | </ng-template> | |
189 | </p-table> | |
190 | ||
191 | <my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal> | |
192 | <my-abuse-message-modal #abuseMessagesModal [isAdminView]="isAdminView()" (countMessagesUpdated)="onCountMessagesUpdated($event)"></my-abuse-message-modal> |