]>
Commit | Line | Data |
---|---|---|
94148c90 C |
1 | <p-table |
2 | [value]="abuses" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" | |
3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true" [lazyLoadOnInit]="false" | |
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..." | |
28 | (keyup)="onAbuseSearch($event)" | |
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> | |
40 | <th *ngIf="isAdminView()" style="width: 20%;" pResizableColumn i18n>Reporter</th> | |
41 | <th i18n>Video/Comment/Account</th> | |
42 | <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
43 | <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th> | |
44 | <th i18n style="width: 80px;">Messages</th> | |
d573926e | 45 | <th i18n *ngIf="isAdminView()" style="width: 100px;">Internal note</th> |
94148c90 C |
46 | <th style="width: 150px;"></th> |
47 | </tr> | |
48 | </ng-template> | |
49 | ||
50 | <ng-template pTemplate="body" let-expanded="expanded" let-abuse> | |
51 | <tr> | |
52 | <td class="c-hand" [pRowToggler]="abuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body"> | |
53 | <span class="expander"> | |
54 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | |
55 | </span> | |
56 | </td> | |
57 | ||
58 | <td *ngIf="isAdminView()"> | |
59 | <a *ngIf="abuse.reporterAccount" [href]="abuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer"> | |
60 | <div class="chip two-lines"> | |
61 | <img | |
62 | class="avatar" | |
63 | [src]="abuse.reporterAccount.avatar?.path" | |
64 | (error)="switchToDefaultAvatar($event)" | |
65 | alt="Avatar" | |
66 | > | |
67 | <div> | |
68 | {{ abuse.reporterAccount.displayName }} | |
69 | <span>{{ abuse.reporterAccount.nameWithHost }}</span> | |
70 | </div> | |
71 | </div> | |
72 | </a> | |
73 | ||
74 | <span i18n *ngIf="!abuse.reporterAccount"> | |
75 | Deleted account | |
76 | </span> | |
77 | </td> | |
78 | ||
79 | <ng-container *ngIf="abuse.video"> | |
80 | ||
81 | <td *ngIf="!abuse.video.deleted"> | |
82 | <a [href]="getVideoUrl(abuse)" class="table-video-link" [title]="abuse.video.name" target="_blank" rel="noopener noreferrer"> | |
83 | <div class="table-video"> | |
84 | <div class="table-video-image"> | |
85 | <img [src]="abuse.video.thumbnailPath"> | |
86 | <span | |
87 | class="table-video-image-label" *ngIf="abuse.count > 1" | |
88 | i18n-title title="This video has been reported multiple times." | |
89 | > | |
90 | {{ abuse.nth }}/{{ abuse.count }} | |
91 | </span> | |
92 | </div> | |
93 | ||
94 | <div class="table-video-text"> | |
95 | <div> | |
96 | <span *ngIf="!abuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span> | |
97 | <span *ngIf="abuse.video.blacklisted" i18n-title title="The video was blocked" class="glyphicon glyphicon-ban-circle"></span> | |
98 | {{ abuse.video.name }} | |
99 | </div> | |
100 | <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div> | |
101 | </div> | |
102 | </div> | |
103 | </a> | |
104 | </td> | |
105 | ||
106 | <td *ngIf="abuse.video.deleted" class="c-hand" [pRowToggler]="abuse"> | |
107 | <div class="table-video" i18n-title title="Video was deleted"> | |
108 | <div class="table-video-image"> | |
109 | <span i18n>Deleted</span> | |
110 | </div> | |
111 | ||
112 | <div class="table-video-text"> | |
113 | <div> | |
114 | {{ abuse.video.name }} | |
115 | <span class="glyphicon glyphicon-trash"></span> | |
116 | </div> | |
117 | <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div> | |
118 | </div> | |
119 | </div> | |
120 | </td> | |
121 | </ng-container> | |
122 | ||
123 | <ng-container *ngIf="abuse.comment"> | |
124 | <td> | |
125 | <a [href]="getCommentUrl(abuse)" [innerHTML]="abuse.truncatedCommentHtml" class="table-comment-link" | |
126 | [title]="abuse.comment.video.name" target="_blank" rel="noopener noreferrer" | |
127 | ></a> | |
128 | ||
129 | <div class="comment-flagged-account" *ngIf="abuse.flaggedAccount">by {{ abuse.flaggedAccount.displayName }}</div> | |
130 | </td> | |
131 | </ng-container> | |
132 | ||
133 | <ng-container *ngIf="!abuse.comment && !abuse.video"> | |
134 | <td *ngIf="abuse.flaggedAccount"> | |
135 | <a [href]="getAccountUrl(abuse)" class="table-account-link" target="_blank" rel="noopener noreferrer"> | |
136 | <span>{{ abuse.flaggedAccount.displayName }}</span> | |
137 | ||
138 | <span class="account-flagged-handle">{{ abuse.flaggedAccount.nameWithHostForced }}</span> | |
139 | </a> | |
140 | </td> | |
141 | ||
142 | <td i18n *ngIf="!abuse.flaggedAccount"> | |
143 | Account deleted | |
144 | </td> | |
145 | ||
146 | </ng-container> | |
147 | ||
94148c90 C |
148 | <td class="c-hand" [pRowToggler]="abuse">{{ abuse.createdAt | date: 'short' }}</td> |
149 | ||
150 | <td class="c-hand abuse-states" [pRowToggler]="abuse"> | |
151 | <span *ngIf="isAbuseAccepted(abuse)" [title]="abuse.state.label" class="glyphicon glyphicon-ok"></span> | |
152 | <span *ngIf="isAbuseRejected(abuse)" [title]="abuse.state.label" class="glyphicon glyphicon-remove"></span> | |
94148c90 C |
153 | </td> |
154 | ||
155 | <td class="c-hand abuse-messages" (click)="openAbuseMessagesModal(abuse)"> | |
156 | <ng-container *ngIf="isLocalAbuse(abuse)"> | |
157 | {{ abuse.countMessages }} | |
158 | ||
159 | <my-global-icon iconName="message-circle"></my-global-icon> | |
160 | </ng-container> | |
161 | </td> | |
162 | ||
d573926e C |
163 | <td *ngIf="isAdminView()" class="internal-note" container="body" placement="left auto" [ngbTooltip]="abuse.moderationComment"> |
164 | {{ abuse.moderationComment }} | |
165 | </td> | |
166 | ||
94148c90 C |
167 | <td class="action-cell"> |
168 | <my-action-dropdown | |
169 | [ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body" | |
170 | i18n-label label="Actions" [actions]="abuseActions" [entry]="abuse" | |
171 | ></my-action-dropdown> | |
172 | </td> | |
173 | </tr> | |
174 | </ng-template> | |
175 | ||
176 | <ng-template pTemplate="rowexpansion" let-abuse> | |
177 | <tr> | |
178 | <td class="expand-cell" colspan="6"> | |
179 | <my-abuse-details [abuse]="abuse" [baseRoute]="baseRoute" [isAdminView]="isAdminView()"></my-abuse-details> | |
180 | </td> | |
181 | </tr> | |
182 | </ng-template> | |
183 | ||
184 | <ng-template pTemplate="emptymessage"> | |
185 | <tr> | |
186 | <td colspan="6"> | |
187 | <div class="no-results"> | |
188 | <ng-container *ngIf="search" i18n>No abuses found matching current filters.</ng-container> | |
189 | <ng-container *ngIf="!search" i18n>No abuses found.</ng-container> | |
190 | </div> | |
191 | </td> | |
192 | </tr> | |
193 | </ng-template> | |
194 | </p-table> | |
195 | ||
196 | <my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal> | |
197 | <my-abuse-message-modal #abuseMessagesModal [isAdminView]="isAdminView()" (countMessagesUpdated)="onCountMessagesUpdated($event)"></my-abuse-message-modal> |