]>
Commit | Line | Data |
---|---|---|
1 | <h1> | |
2 | <my-global-icon iconName="flag" aria-hidden="true"></my-global-icon> | |
3 | <ng-container i18n>Reports</ng-container> | |
4 | </h1> | |
5 | ||
6 | <p-table | |
7 | [value]="abuses" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" | |
8 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" [resizableColumns]="true" [lazyLoadOnInit]="false" | |
9 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | |
10 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports" | |
11 | (onPage)="onPage($event)" [expandedRowKeys]="expandedRows" | |
12 | > | |
13 | <ng-template pTemplate="caption"> | |
14 | <div class="caption"> | |
15 | <div class="ml-auto"> | |
16 | <div class="input-group has-feedback has-clear"> | |
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> | |
23 | <h6 class="dropdown-header" i18n>Advanced report filters</h6> | |
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> | |
29 | </div> | |
30 | </div> | |
31 | <input | |
32 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
33 | (keyup)="onAbuseSearch($event)" | |
34 | > | |
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> | |
37 | </div> | |
38 | </div> | |
39 | </div> | |
40 | </ng-template> | |
41 | ||
42 | <ng-template pTemplate="header"> | |
43 | <tr> <!-- header --> | |
44 | <th style="width: 40px;"></th> | |
45 | <th style="width: 20%;" pResizableColumn i18n>Reporter</th> | |
46 | <th i18n>Video/Comment/Account</th> | |
47 | <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
48 | <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th> | |
49 | <th style="width: 150px;"></th> | |
50 | </tr> | |
51 | </ng-template> | |
52 | ||
53 | <ng-template pTemplate="body" let-expanded="expanded" let-abuse> | |
54 | <tr> | |
55 | <td class="c-hand" [pRowToggler]="abuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body"> | |
56 | <span class="expander"> | |
57 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | |
58 | </span> | |
59 | </td> | |
60 | ||
61 | <td> | |
62 | <a *ngIf="abuse.reporterAccount" [href]="abuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer"> | |
63 | <div class="chip two-lines"> | |
64 | <img | |
65 | class="avatar" | |
66 | [src]="abuse.reporterAccount.avatar?.path" | |
67 | (error)="switchToDefaultAvatar($event)" | |
68 | alt="Avatar" | |
69 | > | |
70 | <div> | |
71 | {{ abuse.reporterAccount.displayName }} | |
72 | <span>{{ abuse.reporterAccount.nameWithHost }}</span> | |
73 | </div> | |
74 | </div> | |
75 | </a> | |
76 | ||
77 | <span i18n *ngIf="!abuse.reporterAccount"> | |
78 | Deleted account | |
79 | </span> | |
80 | </td> | |
81 | ||
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> | |
113 | </div> | |
114 | ||
115 | <div class="table-video-text"> | |
116 | <div> | |
117 | {{ abuse.video.name }} | |
118 | <span class="glyphicon glyphicon-trash"></span> | |
119 | </div> | |
120 | <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div> | |
121 | </div> | |
122 | </div> | |
123 | </td> | |
124 | </ng-container> | |
125 | ||
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> | |
135 | ||
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 | ||
152 | <td class="c-hand" [pRowToggler]="abuse">{{ abuse.createdAt | date: 'short' }}</td> | |
153 | ||
154 | <td class="c-hand abuse-states" [pRowToggler]="abuse"> | |
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> | |
158 | </td> | |
159 | ||
160 | <td class="action-cell"> | |
161 | <my-action-dropdown | |
162 | [ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body" | |
163 | i18n-label label="Actions" [actions]="abuseActions" [entry]="abuse" | |
164 | ></my-action-dropdown> | |
165 | </td> | |
166 | </tr> | |
167 | </ng-template> | |
168 | ||
169 | <ng-template pTemplate="rowexpansion" let-abuse> | |
170 | <tr> | |
171 | <td class="expand-cell" colspan="6"> | |
172 | <my-abuse-details [abuse]="abuse"></my-abuse-details> | |
173 | </td> | |
174 | </tr> | |
175 | </ng-template> | |
176 | ||
177 | <ng-template pTemplate="emptymessage"> | |
178 | <tr> | |
179 | <td colspan="6"> | |
180 | <div class="no-results"> | |
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> | |
183 | </div> | |
184 | </td> | |
185 | </tr> | |
186 | </ng-template> | |
187 | </p-table> | |
188 | ||
189 | <my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal> |