]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.html
Move abuse-list details into its own component
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / video-abuse-list / video-abuse-list.component.html
1 <p-table
2 [value]="videoAbuses" [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"
4 [showCurrentPageReport]="true" i18n-currentPageReportTemplate
5 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} reports"
6 (onPage)="onPage()" [expandedRowKeys]="expandedRows"
7 >
8 <ng-template pTemplate="caption">
9 <div class="caption">
10 <div class="ml-auto">
11 <div class="input-group">
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>Filter reports</h6>
19
20 <!-- TODO:
21 <div class="dropdown-item" i18n>Reports opened by admins</div>
22 <div class="dropdown-item" i18n>Reports on videos with multiple reports</div>
23 <div class="dropdown-item" i18n>Unassigned reports</div>
24 -->
25 <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:pending' }" class="dropdown-item" i18n>Unsolved reports</a>
26 <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:accepted' }" class="dropdown-item" i18n>Accepted reports</a>
27 <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:rejected' }" class="dropdown-item" i18n>Refused reports</a>
28 <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:blacklisted' }" class="dropdown-item" i18n>Reports with blacklisted videos</a>
29 <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:deleted' }" class="dropdown-item" i18n>Reports with deleted videos</a>
30 </div>
31 </div>
32 <input
33 type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
34 (keyup)="onSearch($event)"
35 >
36 </div>
37 </div>
38 </div>
39 </ng-template>
40
41 <ng-template pTemplate="header">
42 <tr> <!-- header -->
43 <th style="width: 40px;"></th>
44 <th style="width: 20%;" pResizableColumn i18n>Reporter</th>
45 <th i18n>Video</th>
46 <th style="width: 140px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
47 <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th>
48 <th style="width: 120px;"></th>
49 </tr>
50 </ng-template>
51
52 <ng-template pTemplate="body" let-expanded="expanded" let-videoAbuse>
53 <tr>
54 <td class="c-hand" [pRowToggler]="videoAbuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body">
55 <span class="expander">
56 <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
57 </span>
58 </td>
59
60 <td>
61 <a [href]="videoAbuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
62 <div class="chip two-lines">
63 <img
64 class="avatar"
65 [src]="videoAbuse.reporterAccount.avatar?.path"
66 (error)="switchToDefaultAvatar($event)"
67 alt="Avatar"
68 >
69 <div>
70 {{ videoAbuse.reporterAccount.displayName }}
71 <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span>
72 </div>
73 </div>
74 </a>
75 </td>
76
77 <td *ngIf="!videoAbuse.video.deleted">
78 <a [href]="getVideoUrl(videoAbuse)" class="video-table-video-link" i18n-title title="Open video in a new tab" target="_blank" rel="noopener noreferrer">
79 <div class="video-table-video">
80 <div class="video-table-video-image">
81 <img [src]="videoAbuse.video.thumbnailPath">
82 <span
83 class="video-table-video-image-label" *ngIf="videoAbuse.count > 1"
84 i18n-title title="This video has been reported multiple times."
85 >
86 {{ videoAbuse.nth }}/{{ videoAbuse.count }}
87 </span>
88 </div>
89 <div class="video-table-video-text">
90 <div>
91 {{ videoAbuse.video.name }}
92 <span *ngIf="!videoAbuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span>
93 <span *ngIf="videoAbuse.video.blacklisted" i18n-title title="Video was blacklisted" class="glyphicon glyphicon-ban-circle"></span>
94 </div>
95 <div class="text-muted" i18n>by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div>
96 </div>
97 </div>
98 </a>
99 </td>
100
101 <td *ngIf="videoAbuse.video.deleted" class="c-hand" [pRowToggler]="videoAbuse">
102 <div class="video-table-video" i18n-title title="Video was deleted">
103 <div class="video-table-video-image">
104 <span i18n>Deleted</span>
105 </div>
106 <div class="video-table-video-text">
107 <div>
108 {{ videoAbuse.video.name }}
109 <span class="glyphicon glyphicon-trash"></span>
110 </div>
111 <div class="text-muted" i18n>by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div>
112 </div>
113 </div>
114 </td>
115
116 <td class="c-hand" [pRowToggler]="videoAbuse">{{ videoAbuse.createdAt | date: 'short' }}</td>
117
118 <td class="c-hand video-abuse-states" [pRowToggler]="videoAbuse">
119 <span *ngIf="isVideoAbuseAccepted(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-ok"></span>
120 <span *ngIf="isVideoAbuseRejected(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-remove"></span>
121 <span *ngIf="videoAbuse.moderationComment" container="body" placement="left auto" [ngbTooltip]="videoAbuse.moderationComment" class="glyphicon glyphicon-comment"></span>
122 </td>
123
124 <td class="action-cell">
125 <my-action-dropdown
126 [ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body"
127 i18n-label label="Actions" [actions]="videoAbuseActions" [entry]="videoAbuse"
128 ></my-action-dropdown>
129 </td>
130 </tr>
131 </ng-template>
132
133 <ng-template pTemplate="rowexpansion" let-videoAbuse>
134 <tr>
135 <td class="expand-cell" colspan="6">
136 <my-video-abuse-details [videoAbuse]="videoAbuse"></my-video-abuse-details>
137 </td>
138 </tr>
139 </ng-template>
140
141 <ng-template pTemplate="emptymessage">
142 <tr>
143 <td colspan="6">
144 <div class="empty-table-message">
145 <ng-container *ngIf="search" i18n>No video abuses found matching current filters.</ng-container>
146 <ng-container *ngIf="!search" i18n>No video abuses found.</ng-container>
147 </div>
148 </td>
149 </tr>
150 </ng-template>
151 </p-table>
152
153 <my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal>