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