Reduce createdAt column size by using short date format
[oweals/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 >
7   <ng-template pTemplate="caption">
8     <div class="caption">
9       <div class="ml-auto">
10         <div class="input-group">
11           <div class="input-group-prepend c-hand" ngbDropdown placement="bottom-left auto" container="body">
12             <div class="input-group-text" ngbDropdownToggle>
13               <span class="caret" aria-haspopup="menu" role="button"></span>
14             </div>
15
16             <div role="menu" ngbDropdownMenu>
17               <h6 class="dropdown-header" i18n>Filter reports</h6>
18
19               <!-- TODO:
20               <div class="dropdown-item" i18n>Reports opened by admins</div>
21               <div class="dropdown-item" i18n>Reports on videos with multiple reports</div>
22               <div class="dropdown-item" i18n>Unassigned reports</div>
23               -->
24               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:pending' }" class="dropdown-item" i18n>Unsolved reports</a>
25               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:accepted' }" class="dropdown-item" i18n>Accepted reports</a>
26               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'state:rejected' }" class="dropdown-item" i18n>Refused reports</a>
27               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is:blocked' }" class="dropdown-item" i18n>Reports with blocked videos</a>
28               <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'is: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)="onSearch($event)"
34           >
35         </div>
36       </div>
37     </div>
38   </ng-template>
39
40   <ng-template pTemplate="header">
41     <tr> <!-- header -->
42       <th style="width: 40px;"></th>
43       <th style="width: 20%;" pResizableColumn i18n>Reporter</th>
44       <th i18n>Video</th>
45       <th style="width: 140px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
46       <th i18n pSortableColumn="state" style="width: 80px;">State <p-sortIcon field="state"></p-sortIcon></th>
47       <th style="width: 120px;"></th>
48     </tr>
49   </ng-template>
50
51   <ng-template pTemplate="body" let-expanded="expanded" let-videoAbuse>
52     <tr>
53       <td class="c-hand" [pRowToggler]="videoAbuse" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body">
54         <span class="expander">
55           <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
56         </span>
57       </td>
58
59       <td>
60         <a [href]="videoAbuse.reporterAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer">
61           <div class="chip two-lines">
62             <img
63               class="avatar"
64               [src]="videoAbuse.reporterAccount.avatar?.path"
65               (error)="switchToDefaultAvatar($event)"
66               alt="Avatar"
67             >
68             <div>
69               {{ videoAbuse.reporterAccount.displayName }}
70               <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span>
71             </div>
72           </div>
73         </a>
74       </td>
75
76       <td *ngIf="!videoAbuse.video.deleted">
77         <a [href]="getVideoUrl(videoAbuse)" class="video-table-video-link" i18n-title title="Open video in a new tab" target="_blank" rel="noopener noreferrer">
78           <div class="video-table-video">
79             <div class="video-table-video-image">
80               <img [src]="videoAbuse.video.thumbnailPath">
81               <span
82                 class="video-table-video-image-label" *ngIf="videoAbuse.count > 1"
83                 i18n-title title="This video has been reported multiple times."
84               >
85                 {{ videoAbuse.nth }}/{{ videoAbuse.count }}
86               </span>
87             </div>
88             <div class="video-table-video-text">
89               <div>
90                 {{ videoAbuse.video.name }}
91                 <span *ngIf="!videoAbuse.video.blacklisted" class="glyphicon glyphicon-new-window"></span>
92                 <span *ngIf="videoAbuse.video.blacklisted" i18n-title title="Video was blacklisted" class="glyphicon glyphicon-ban-circle"></span>
93               </div>
94               <div class="text-muted" i18n>by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div>
95             </div>
96           </div>
97         </a>
98       </td>
99
100       <td *ngIf="videoAbuse.video.deleted" class="c-hand" [pRowToggler]="videoAbuse">
101         <div class="video-table-video" i18n-title title="Video was deleted">
102           <div class="video-table-video-image">
103             <span i18n>Deleted</span>
104           </div>
105           <div class="video-table-video-text">
106             <div>
107               {{ videoAbuse.video.name }}
108               <span class="glyphicon glyphicon-trash"></span>
109             </div>
110             <div class="text-muted" i18n>by {{ videoAbuse.video.channel?.displayName }} on {{ videoAbuse.video.channel?.host }} </div>
111           </div>
112         </div>
113       </td>
114
115       <td class="c-hand" [pRowToggler]="videoAbuse">{{ videoAbuse.createdAt | date: 'short'  }}</td>
116
117       <td class="c-hand video-abuse-states" [pRowToggler]="videoAbuse">
118         <span *ngIf="isVideoAbuseAccepted(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-ok"></span>
119         <span *ngIf="isVideoAbuseRejected(videoAbuse)" [title]="videoAbuse.state.label" class="glyphicon glyphicon-remove"></span>
120         <span *ngIf="videoAbuse.moderationComment" container="body" placement="left auto" [ngbTooltip]="videoAbuse.moderationComment" class="glyphicon glyphicon-comment"></span>
121       </td>
122
123       <td class="action-cell">
124         <my-action-dropdown
125           [ngClass]="{ 'show': expanded }" placement="bottom-right top-right left auto" container="body"
126           i18n-label label="Actions" [actions]="videoAbuseActions" [entry]="videoAbuse"
127         ></my-action-dropdown>
128       </td>
129     </tr>
130   </ng-template>
131
132   <ng-template pTemplate="rowexpansion" let-videoAbuse>
133       <tr>
134         <td class="expand-cell" colspan="6">
135           <div class="d-flex moderation-expanded">
136             <!-- report left part (report details) -->
137             <div class="col-8">
138
139               <!-- report metadata -->
140               <div class="d-flex">
141                 <span class="col-3 moderation-expanded-label" i18n>Reporter</span>
142                 <span class="col-9 moderation-expanded-text">
143                   <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reporter:&quot;' + videoAbuse.reporterAccount.displayName + '&quot;' }" class="chip">
144                     <img
145                       class="avatar"
146                       [src]="videoAbuse.reporterAccount.avatar.path"
147                       (error)="switchToDefaultAvatar($event)"
148                       alt="Avatar"
149                     >
150                     <div>
151                       <span class="text-muted">{{ createByString(videoAbuse.reporterAccount) }}</span>
152                     </div>
153                   </a>
154                   <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:&quot;' + videoAbuse.reporterAccount.displayName + '&quot;' }" class="ml-auto text-muted video-details-links" i18n>
155                     {videoAbuse.countReportsForReporter, plural, =1 {1 report} other {{{ videoAbuse.countReportsForReporter }} reports}}<span class="ml-1 glyphicon glyphicon-flag"></span>
156                   </a>
157                 </span>
158               </div>
159
160               <div class="d-flex">
161                 <span class="col-3 moderation-expanded-label" i18n>Reportee</span>
162                 <span class="col-9 moderation-expanded-text">
163                   <div class="chip">
164                     <img
165                       class="avatar"
166                       [src]="videoAbuse.video.channel.ownerAccount?.avatar.path"
167                       (error)="switchToDefaultAvatar($event)"
168                       alt="Avatar"
169                     >
170                     <div>
171                       <span class="text-muted">{{ videoAbuse.video.channel.ownerAccount ? createByString(videoAbuse.video.channel.ownerAccount) : '' }}</span>
172                     </div>
173                   </div>
174                   <a [routerLink]="[ '/admin/moderation/video-abuses/list' ]" [queryParams]="{ 'search': 'reportee:&quot;' +videoAbuse.video.channel.ownerAccount.displayName + '&quot;' }" class="ml-auto text-muted video-details-links" i18n>
175                     {videoAbuse.countReportsForReportee, plural, =1 {1 report} other {{{ videoAbuse.countReportsForReportee }} reports}}<span class="ml-1 glyphicon glyphicon-flag"></span>
176                   </a>
177                 </span>
178               </div>
179
180               <div class="d-flex">
181                 <span class="col-3 moderation-expanded-label" i18n>Updated</span>
182                 <time class="col-9 moderation-expanded-text video-details-date-updated">{{ videoAbuse.updatedAt | date: 'medium' }}</time>
183               </div>
184
185               <!-- report text -->
186               <div class="mt-3 d-flex">
187                 <span class="col-3 moderation-expanded-label" i18n>Report #{{ videoAbuse.id }}</span>
188                 <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span>
189               </div>
190
191               <div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment">
192                 <span class="col-3 moderation-expanded-label" i18n>Note</span>
193                 <span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.moderationCommentHtml"></span>
194               </div>
195
196             </div>
197
198             <!-- report right part (video details) -->
199             <div class="col-4">
200               <div class="screenratio">
201                 <div *ngIf="videoAbuse.video.deleted || videoAbuse.video.blacklisted">
202                   <span i18n *ngIf="videoAbuse.video.deleted">The video was deleted</span>
203                   <span i18n *ngIf="!videoAbuse.video.deleted">The video was blacklisted</span>
204                 </div>
205                 <div *ngIf="!videoAbuse.video.deleted && !videoAbuse.video.blacklisted" [innerHTML]="videoAbuse.embedHtml"></div>
206               </div>
207             </div>
208           </div>
209         </td>
210       </tr>
211   </ng-template>
212
213   <ng-template pTemplate="emptymessage">
214     <tr>
215       <td colspan="6">
216         <div class="empty-table-message">
217           <ng-container *ngIf="search" i18n>No video abuses found matching current filters.</ng-container>
218           <ng-container *ngIf="!search" i18n>No video abuses found.</ng-container>
219         </div>
220       </td>
221     </tr>
222   </ng-template>
223 </p-table>
224
225 <my-moderation-comment-modal #moderationCommentModal (commentUpdated)="onModerationCommentUpdated()"></my-moderation-comment-modal>