]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/moderation/abuse-list/abuse-list.component.html
Add abuse message management in admin
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / abuse-list / abuse-list.component.html
CommitLineData
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>
441e453a 49 <th i18n style="width: 80px;">Messages</th>
572bf73b 50 <th style="width: 150px;"></th>
ab998f7b
C
51 </tr>
52 </ng-template>
53
d95d1559 54 <ng-template pTemplate="body" let-expanded="expanded" let-abuse>
ab998f7b 55 <tr>
d95d1559 56 <td class="c-hand" [pRowToggler]="abuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body">
2bc9bd08 57 <span class="expander">
efc9e845
C
58 <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
59 </span>
60 </td>
61
19a3b914 62 <td>
8ca56654 63 <a *ngIf="abuse.reporterAccount" [href]="abuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
d6af8146
RK
64 <div class="chip two-lines">
65 <img
66 class="avatar"
d95d1559 67 [src]="abuse.reporterAccount.avatar?.path"
d6af8146
RK
68 (error)="switchToDefaultAvatar($event)"
69 alt="Avatar"
70 >
71 <div>
d95d1559 72 {{ abuse.reporterAccount.displayName }}
8ca56654 73 <span>{{ abuse.reporterAccount.nameWithHost }}</span>
d6af8146
RK
74 </div>
75 </div>
19a3b914 76 </a>
8ca56654
C
77
78 <span i18n *ngIf="!abuse.reporterAccount">
79 Deleted account
80 </span>
19a3b914 81 </td>
efc9e845 82
8ca56654
C
83 <ng-container *ngIf="abuse.video">
84
85 <td *ngIf="!abuse.video.deleted">
86 <a [href]="getVideoUrl(abuse)" class="table-video-link" [title]="abuse.video.name" target="_blank" rel="noopener noreferrer">
87 <div class="table-video">
88 <div class="table-video-image">
89 <img [src]="abuse.video.thumbnailPath">
90 <span
91 class="table-video-image-label" *ngIf="abuse.count > 1"
92 i18n-title title="This video has been reported multiple times."
93 >
94 {{ abuse.nth }}/{{ abuse.count }}
95 </span>
96 </div>
97
98 <div class="table-video-text">
99 <div>
100 <span *ngIf="!abuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span>
101 <span *ngIf="abuse.video.blacklisted" i18n-title title="The video was blocked" class="glyphicon glyphicon-ban-circle"></span>
102 {{ abuse.video.name }}
103 </div>
104 <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div>
105 </div>
106 </div>
107 </a>
108 </td>
109
110 <td *ngIf="abuse.video.deleted" class="c-hand" [pRowToggler]="abuse">
111 <div class="table-video" i18n-title title="Video was deleted">
112 <div class="table-video-image">
113 <span i18n>Deleted</span>
5fd4ca00 114 </div>
8ca56654
C
115
116 <div class="table-video-text">
86521a67 117 <div>
d95d1559 118 {{ abuse.video.name }}
8ca56654 119 <span class="glyphicon glyphicon-trash"></span>
86521a67 120 </div>
8ca56654 121 <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div>
86521a67
RK
122 </div>
123 </div>
8ca56654
C
124 </td>
125 </ng-container>
efc9e845 126
8ca56654
C
127 <ng-container *ngIf="abuse.comment">
128 <td>
129 <a [href]="getCommentUrl(abuse)" [innerHTML]="abuse.truncatedCommentHtml" class="table-comment-link"
130 [title]="abuse.comment.video.name" target="_blank" rel="noopener noreferrer"
131 ></a>
132
133 <div class="comment-flagged-account" *ngIf="abuse.flaggedAccount">by {{ abuse.flaggedAccount.displayName }}</div>
134 </td>
135 </ng-container>
844db39e 136
cfde28ba
C
137 <ng-container *ngIf="!abuse.comment && !abuse.video">
138 <td *ngIf="abuse.flaggedAccount">
139 <a [href]="getAccountUrl(abuse)" class="table-account-link" target="_blank" rel="noopener noreferrer">
140 <span>{{ abuse.flaggedAccount.displayName }}</span>
141
142 <span class="account-flagged-handle">{{ abuse.flaggedAccount.nameWithHostForced }}</span>
143 </a>
144 </td>
145
146 <td i18n *ngIf="!abuse.flaggedAccount">
147 Account deleted
148 </td>
149
150 </ng-container>
151
152
d95d1559 153 <td class="c-hand" [pRowToggler]="abuse">{{ abuse.createdAt | date: 'short' }}</td>
9b4241e3 154
8ca56654 155 <td class="c-hand abuse-states" [pRowToggler]="abuse">
d95d1559
C
156 <span *ngIf="isAbuseAccepted(abuse)" [title]="abuse.state.label" class="glyphicon glyphicon-ok"></span>
157 <span *ngIf="isAbuseRejected(abuse)" [title]="abuse.state.label" class="glyphicon glyphicon-remove"></span>
158 <span *ngIf="abuse.moderationComment" container="body" placement="left auto" [ngbTooltip]="abuse.moderationComment" class="glyphicon glyphicon-comment"></span>
f0d4e7eb
C
159 </td>
160
441e453a
C
161 <td class="c-hand abuse-messages" (click)="openAbuseMessagesModal(abuse)">
162 {{ abuse.countMessages }}
163
164 <my-global-icon iconName="message-circle"></my-global-icon>
165 </td>
166
efc9e845 167 <td class="action-cell">
5fd4ca00 168 <my-action-dropdown
0d3a2982 169 [ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body"
d95d1559 170 i18n-label label="Actions" [actions]="abuseActions" [entry]="abuse"
5fd4ca00 171 ></my-action-dropdown>
efc9e845
C
172 </td>
173 </tr>
174 </ng-template>
175
d95d1559 176 <ng-template pTemplate="rowexpansion" let-abuse>
83b5fe9c 177 <tr>
d6af8146 178 <td class="expand-cell" colspan="6">
d95d1559 179 <my-abuse-details [abuse]="abuse"></my-abuse-details>
83b5fe9c
FA
180 </td>
181 </tr>
ab998f7b 182 </ng-template>
d3840613
RK
183
184 <ng-template pTemplate="emptymessage">
185 <tr>
186 <td colspan="6">
22839330 187 <div class="no-results">
310b5219
C
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>
d3840613
RK
190 </div>
191 </td>
192 </tr>
193 </ng-template>
ab998f7b 194</p-table>
efc9e845 195
4707f410 196<my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal>
441e453a 197<my-abuse-message-modal #abuseMessagesModal (countMessagesUpdated)="onCountMessagesUpdated($event)"></my-abuse-message-modal>