]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
Use badge in video block list
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / moderation / video-block-list / video-block-list.component.html
1 <h1>
2 <my-global-icon iconName="cross" aria-hidden="true"></my-global-icon>
3 <ng-container i18n>Video blocks</ng-container>
4 </h1>
5
6 <p-table
7 [value]="blocklist" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
8 [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
9 [showCurrentPageReport]="true" i18n-currentPageReportTemplate
10 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} blocked videos"
11 (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
12 >
13 <ng-template pTemplate="caption">
14 <div class="caption">
15 <div class="ml-auto">
16 <div class="input-group has-feedback has-clear">
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>
23 <h6 class="dropdown-header" i18n>Advanced block filters</h6>
24 <a [routerLink]="[ '/admin/moderation/video-blocks/list' ]" [queryParams]="{ 'search': 'type:auto' }" class="dropdown-item" i18n>Automatic blocks</a>
25 <a [routerLink]="[ '/admin/moderation/video-blocks/list' ]" [queryParams]="{ 'search': 'type:manual' }" class="dropdown-item" i18n>Manual blocks</a>
26 </div>
27 </div>
28 <input
29 type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
30 (keyup)="onSearch($event)"
31 >
32 <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetTableFilter()"></a>
33 <span class="sr-only" i18n>Clear filters</span>
34 </div>
35 </div>
36 </div>
37 </ng-template>
38
39 <ng-template pTemplate="header">
40 <tr>
41 <th style="width: 40px"></th>
42 <th style="width: 150px;"></th>
43 <th i18n pSortableColumn="name">Video <p-sortIcon field="name"></p-sortIcon></th>
44 <th style="width: 100px;" i18n>Sensitive</th>
45 <th style="width: 120px;" i18n>Unfederated</th>
46 <th style="width: 150px;" i18n pSortableColumn="createdAt">Date <p-sortIcon field="createdAt"></p-sortIcon></th>
47 </tr>
48 </ng-template>
49
50 <ng-template pTemplate="body" let-videoBlock let-expanded="expanded">
51 <tr>
52 <td *ngIf="!videoBlock.reason"></td>
53 <td *ngIf="videoBlock.reason" class="expand-cell c-hand" [pRowToggler]="videoBlock" 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 class="action-cell">
60 <my-action-dropdown
61 [ngClass]="{ 'show': expanded }" placement="bottom-right" container="body"
62 i18n-label label="Actions" [actions]="videoBlocklistActions" [entry]="videoBlock"
63 ></my-action-dropdown>
64 </td>
65
66 <td>
67 <a [href]="getVideoUrl(videoBlock)" class="table-video-link" [title]="videoBlock.video.name" target="_blank" rel="noopener noreferrer">
68 <div class="table-video">
69 <div class="table-video-image">
70 <img [src]="videoBlock.video.thumbnailPath">
71 </div>
72 <div class="table-video-text">
73 <div>
74 <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>
75 {{ videoBlock.video.name }}
76 </div>
77 <div class="text-muted">by {{ videoBlock.video.channel?.displayName }} on {{ videoBlock.video.channel?.host }} </div>
78 </div>
79 </div>
80 </a>
81 </td>
82
83 <td>
84 <span *ngIf="videoBlock.video.nsfw" class="badge badge-red" i18n>NSFW</span>
85 </td>
86
87 <td>
88 <span *ngIf="videoBlock.unfederated" class="badge badge-blue" i18n>Unfederated</span>
89 </td>
90
91 <td>
92 {{ videoBlock.createdAt | date: 'short' }}
93 </td>
94 </tr>
95 </ng-template>
96
97 <ng-template pTemplate="rowexpansion" let-videoBlock>
98 <tr>
99 <td class="expand-cell" colspan="6">
100 <div class="d-flex moderation-expanded">
101
102 <!-- block right part (block details) -->
103 <div class="col-8">
104 <span class="col-3 moderation-expanded-label" i18n>Block reason:</span>
105 <span class="col-9 moderation-expanded-text" [innerHTML]="videoBlock.reasonHtml"></span>
106 </div>
107
108 <!-- block right part (video embed) -->
109 <div class="col-4">
110 <div class="screenratio">
111 <div [innerHTML]="videoBlock.embedHtml"></div>
112 </div>
113 </div>
114
115 </div>
116 </td>
117 </tr>
118 </ng-template>
119
120 <ng-template pTemplate="emptymessage">
121 <tr>
122 <td colspan="6">
123 <div class="no-results">
124 <ng-container *ngIf="search" i18n>No blocked video found matching current filters.</ng-container>
125 <ng-container *ngIf="!search" i18n>No blocked video found.</ng-container>
126 </div>
127 </td>
128 </tr>
129 </ng-template>
130 </p-table>
131