diff options
author | Chocobozzz <me@florianbigard.com> | 2020-07-27 11:40:30 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-07-31 11:35:19 +0200 |
commit | 94148c9028829b5576a5dcbfba2c7fb9cf6443d3 (patch) | |
tree | 2774f272329111abd03e8441ff936da11fb1a3f3 /client/src/app/shared/shared-abuse-list/abuse-list-table.component.html | |
parent | 441e453ae53e491b09c9b09b00b041788176ce64 (diff) | |
download | PeerTube-94148c9028829b5576a5dcbfba2c7fb9cf6443d3.tar.gz PeerTube-94148c9028829b5576a5dcbfba2c7fb9cf6443d3.tar.zst PeerTube-94148c9028829b5576a5dcbfba2c7fb9cf6443d3.zip |
Add abuse messages management in my account
Diffstat (limited to 'client/src/app/shared/shared-abuse-list/abuse-list-table.component.html')
-rw-r--r-- | client/src/app/shared/shared-abuse-list/abuse-list-table.component.html | 194 |
1 files changed, 194 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html new file mode 100644 index 000000000..a6f707a47 --- /dev/null +++ b/client/src/app/shared/shared-abuse-list/abuse-list-table.component.html | |||
@@ -0,0 +1,194 @@ | |||
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> | ||
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> | ||
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> | ||
45 | <th style="width: 150px;"></th> | ||
46 | </tr> | ||
47 | </ng-template> | ||
48 | |||
49 | <ng-template pTemplate="body" let-expanded="expanded" let-abuse> | ||
50 | <tr> | ||
51 | <td class="c-hand" [pRowToggler]="abuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body"> | ||
52 | <span class="expander"> | ||
53 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | ||
54 | </span> | ||
55 | </td> | ||
56 | |||
57 | <td *ngIf="isAdminView()"> | ||
58 | <a *ngIf="abuse.reporterAccount" [href]="abuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer"> | ||
59 | <div class="chip two-lines"> | ||
60 | <img | ||
61 | class="avatar" | ||
62 | [src]="abuse.reporterAccount.avatar?.path" | ||
63 | (error)="switchToDefaultAvatar($event)" | ||
64 | alt="Avatar" | ||
65 | > | ||
66 | <div> | ||
67 | {{ abuse.reporterAccount.displayName }} | ||
68 | <span>{{ abuse.reporterAccount.nameWithHost }}</span> | ||
69 | </div> | ||
70 | </div> | ||
71 | </a> | ||
72 | |||
73 | <span i18n *ngIf="!abuse.reporterAccount"> | ||
74 | Deleted account | ||
75 | </span> | ||
76 | </td> | ||
77 | |||
78 | <ng-container *ngIf="abuse.video"> | ||
79 | |||
80 | <td *ngIf="!abuse.video.deleted"> | ||
81 | <a [href]="getVideoUrl(abuse)" class="table-video-link" [title]="abuse.video.name" target="_blank" rel="noopener noreferrer"> | ||
82 | <div class="table-video"> | ||
83 | <div class="table-video-image"> | ||
84 | <img [src]="abuse.video.thumbnailPath"> | ||
85 | <span | ||
86 | class="table-video-image-label" *ngIf="abuse.count > 1" | ||
87 | i18n-title title="This video has been reported multiple times." | ||
88 | > | ||
89 | {{ abuse.nth }}/{{ abuse.count }} | ||
90 | </span> | ||
91 | </div> | ||
92 | |||
93 | <div class="table-video-text"> | ||
94 | <div> | ||
95 | <span *ngIf="!abuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span> | ||
96 | <span *ngIf="abuse.video.blacklisted" i18n-title title="The video was blocked" class="glyphicon glyphicon-ban-circle"></span> | ||
97 | {{ abuse.video.name }} | ||
98 | </div> | ||
99 | <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div> | ||
100 | </div> | ||
101 | </div> | ||
102 | </a> | ||
103 | </td> | ||
104 | |||
105 | <td *ngIf="abuse.video.deleted" class="c-hand" [pRowToggler]="abuse"> | ||
106 | <div class="table-video" i18n-title title="Video was deleted"> | ||
107 | <div class="table-video-image"> | ||
108 | <span i18n>Deleted</span> | ||
109 | </div> | ||
110 | |||
111 | <div class="table-video-text"> | ||
112 | <div> | ||
113 | {{ abuse.video.name }} | ||
114 | <span class="glyphicon glyphicon-trash"></span> | ||
115 | </div> | ||
116 | <div i18n>by {{ abuse.video.channel?.displayName }} on {{ abuse.video.channel?.host }} </div> | ||
117 | </div> | ||
118 | </div> | ||
119 | </td> | ||
120 | </ng-container> | ||
121 | |||
122 | <ng-container *ngIf="abuse.comment"> | ||
123 | <td> | ||
124 | <a [href]="getCommentUrl(abuse)" [innerHTML]="abuse.truncatedCommentHtml" class="table-comment-link" | ||
125 | [title]="abuse.comment.video.name" target="_blank" rel="noopener noreferrer" | ||
126 | ></a> | ||
127 | |||
128 | <div class="comment-flagged-account" *ngIf="abuse.flaggedAccount">by {{ abuse.flaggedAccount.displayName }}</div> | ||
129 | </td> | ||
130 | </ng-container> | ||
131 | |||
132 | <ng-container *ngIf="!abuse.comment && !abuse.video"> | ||
133 | <td *ngIf="abuse.flaggedAccount"> | ||
134 | <a [href]="getAccountUrl(abuse)" class="table-account-link" target="_blank" rel="noopener noreferrer"> | ||
135 | <span>{{ abuse.flaggedAccount.displayName }}</span> | ||
136 | |||
137 | <span class="account-flagged-handle">{{ abuse.flaggedAccount.nameWithHostForced }}</span> | ||
138 | </a> | ||
139 | </td> | ||
140 | |||
141 | <td i18n *ngIf="!abuse.flaggedAccount"> | ||
142 | Account deleted | ||
143 | </td> | ||
144 | |||
145 | </ng-container> | ||
146 | |||
147 | |||
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> | ||
153 | <span *ngIf="abuse.moderationComment" container="body" placement="left auto" [ngbTooltip]="abuse.moderationComment" class="glyphicon glyphicon-comment"></span> | ||
154 | </td> | ||
155 | |||
156 | <td class="c-hand abuse-messages" (click)="openAbuseMessagesModal(abuse)"> | ||
157 | <ng-container *ngIf="isLocalAbuse(abuse)"> | ||
158 | {{ abuse.countMessages }} | ||
159 | |||
160 | <my-global-icon iconName="message-circle"></my-global-icon> | ||
161 | </ng-container> | ||
162 | </td> | ||
163 | |||
164 | <td class="action-cell"> | ||
165 | <my-action-dropdown | ||
166 | [ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body" | ||
167 | i18n-label label="Actions" [actions]="abuseActions" [entry]="abuse" | ||
168 | ></my-action-dropdown> | ||
169 | </td> | ||
170 | </tr> | ||
171 | </ng-template> | ||
172 | |||
173 | <ng-template pTemplate="rowexpansion" let-abuse> | ||
174 | <tr> | ||
175 | <td class="expand-cell" colspan="6"> | ||
176 | <my-abuse-details [abuse]="abuse" [baseRoute]="baseRoute" [isAdminView]="isAdminView()"></my-abuse-details> | ||
177 | </td> | ||
178 | </tr> | ||
179 | </ng-template> | ||
180 | |||
181 | <ng-template pTemplate="emptymessage"> | ||
182 | <tr> | ||
183 | <td colspan="6"> | ||
184 | <div class="no-results"> | ||
185 | <ng-container *ngIf="search" i18n>No abuses found matching current filters.</ng-container> | ||
186 | <ng-container *ngIf="!search" i18n>No abuses found.</ng-container> | ||
187 | </div> | ||
188 | </td> | ||
189 | </tr> | ||
190 | </ng-template> | ||
191 | </p-table> | ||
192 | |||
193 | <my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal> | ||
194 | <my-abuse-message-modal #abuseMessagesModal [isAdminView]="isAdminView()" (countMessagesUpdated)="onCountMessagesUpdated($event)"></my-abuse-message-modal> | ||