]>
Commit | Line | Data |
---|---|---|
5baee5fc RK |
1 | <p-table |
2 | [value]="blocklist" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" | |
3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" | |
4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | |
5 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} blocked videos" | |
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 block filters</h6> | |
19 | <a [routerLink]="[ '/admin/moderation/video-blocks/list' ]" [queryParams]="{ 'search': 'type:auto' }" class="dropdown-item" i18n>Automatic blocks</a> | |
20 | <a [routerLink]="[ '/admin/moderation/video-blocks/list' ]" [queryParams]="{ 'search': 'type:manual' }" class="dropdown-item" i18n>Manual blocks</a> | |
21 | </div> | |
22 | </div> | |
23 | <input | |
24 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
25 | (keyup)="onBlockSearch($event)" | |
26 | > | |
27 | <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetTableFilter()"></a> | |
28 | <span class="sr-only" i18n>Clear filters</span> | |
29 | </div> | |
30 | </div> | |
31 | </div> | |
32 | </ng-template> | |
33 | ||
34 | <ng-template pTemplate="header"> | |
35 | <tr> | |
36 | <th style="width: 40px"></th> | |
37 | <th i18n pSortableColumn="name">Video <p-sortIcon field="name"></p-sortIcon></th> | |
38 | <th style="width: 100px;" i18n>Sensitive</th> | |
39 | <th style="width: 120px;" i18n>Unfederated</th> | |
40 | <th style="width: 150px;" i18n pSortableColumn="createdAt">Date <p-sortIcon field="createdAt"></p-sortIcon></th> | |
41 | <th style="width: 150px;"></th> | |
42 | </tr> | |
43 | </ng-template> | |
44 | ||
45 | <ng-template pTemplate="body" let-videoBlock let-expanded="expanded"> | |
46 | <tr> | |
47 | <td *ngIf="!videoBlock.reason"></td> | |
48 | <td *ngIf="videoBlock.reason" class="expand-cell c-hand" [pRowToggler]="videoBlock" i18n-ngbTooltip ngbTooltip="More information" placement="top-left" container="body"> | |
49 | <span class="expander"> | |
50 | <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i> | |
51 | </span> | |
52 | </td> | |
53 | ||
54 | <td> | |
55 | <a [href]="getVideoUrl(videoBlock)" class="video-table-video-link" i18n-title title="Open video in a new tab" target="_blank" rel="noopener noreferrer"> | |
56 | <div class="video-table-video"> | |
57 | <div class="video-table-video-image"> | |
58 | <img [src]="videoBlock.video.thumbnailPath"> | |
59 | </div> | |
60 | <div class="video-table-video-text"> | |
61 | <div> | |
62 | <my-global-icon i18n-title title="The video was blocked due to automatic blocking of new videos" *ngIf="videoBlock.type == 2" iconName="robot"></my-global-icon> | |
63 | {{ videoBlock.video.name }} | |
64 | </div> | |
65 | <div class="text-muted">by {{ videoBlock.video.channel?.displayName }} on {{ videoBlock.video.channel?.host }} </div> | |
66 | </div> | |
67 | </div> | |
68 | </a> | |
69 | </td> | |
70 | ||
71 | <ng-container *ngIf="videoBlock.reason"> | |
72 | <td class="c-hand" [pRowToggler]="videoBlock">{{ booleanToText(videoBlock.video.nsfw) }}</td> | |
73 | <td class="c-hand" [pRowToggler]="videoBlock">{{ booleanToText(videoBlock.unfederated) }}</td> | |
74 | <td class="c-hand" [pRowToggler]="videoBlock">{{ videoBlock.createdAt | date: 'short' }}</td> | |
75 | </ng-container> | |
76 | <ng-container *ngIf="!videoBlock.reason"> | |
77 | <td>{{ booleanToText(videoBlock.video.nsfw) }}</td> | |
78 | <td>{{ booleanToText(videoBlock.unfederated) }}</td> | |
79 | <td>{{ videoBlock.createdAt | date: 'short' }}</td> | |
80 | </ng-container> | |
81 | ||
82 | <td class="action-cell"> | |
83 | <my-action-dropdown | |
84 | [ngClass]="{ 'show': expanded }" placement="bottom-right" container="body" | |
85 | i18n-label label="Actions" [actions]="videoBlocklistActions" [entry]="videoBlock" | |
86 | ></my-action-dropdown> | |
87 | </td> | |
88 | </tr> | |
89 | </ng-template> | |
90 | ||
91 | <ng-template pTemplate="rowexpansion" let-videoBlock> | |
92 | <tr> | |
93 | <td class="expand-cell" colspan="6"> | |
94 | <div class="d-flex moderation-expanded"> | |
95 | <span class="col-2 moderation-expanded-label" i18n>Block reason:</span> | |
96 | <span class="col-9 moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span> | |
97 | </div> | |
98 | </td> | |
99 | </tr> | |
100 | </ng-template> | |
101 | ||
102 | <ng-template pTemplate="emptymessage"> | |
103 | <tr> | |
104 | <td colspan="6"> | |
105 | <div class="empty-table-message"> | |
106 | <ng-container *ngIf="search" i18n>No blocked video found matching current filters.</ng-container> | |
107 | <ng-container *ngIf="!search" i18n>No blocked video found.</ng-container> | |
108 | </div> | |
109 | </td> | |
110 | </tr> | |
111 | </ng-template> | |
112 | </p-table> | |
113 |