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