Unify paginator disabling when no result is displayable, fix batch domain add for...
[oweals/peertube.git] / client / src / app / +admin / moderation / instance-blocklist / instance-server-blocklist.component.html
1 <p-table
2   [value]="blockedServers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
3   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
4   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
5   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted instances"
6 >
7   <ng-template pTemplate="caption">
8     <div class="caption">
9       <div class="ml-auto">
10         <input
11           type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..."
12           (keyup)="onSearch($event)"
13         >
14       </div>
15       <a class="ml-2 block-button" (click)="addServersToBlock()" (key.enter)="addServersToBlock()">
16         <my-global-icon iconName="add"></my-global-icon>
17         <ng-container i18n>Mute domain</ng-container>
18       </a>
19     </div>
20   </ng-template>
21
22   <ng-template pTemplate="header">
23     <tr>
24       <th style="width: 100%;" i18n>Instance</th>
25       <th style="width: 190px;" i18n pSortableColumn="createdAt">Muted at <p-sortIcon field="createdAt"></p-sortIcon></th>
26       <th style="width: 100px;"></th> <!-- column for action buttons -->
27     </tr>
28   </ng-template>
29
30   <ng-template pTemplate="body" let-serverBlock>
31     <tr>
32       <td>
33         <a [href]="'https://' + serverBlock.blockedServer.host" i18n-title title="Open instance in a new tab" target="_blank" rel="noopener noreferrer">
34           {{ serverBlock.blockedServer.host }}
35           <span class="glyphicon glyphicon-new-window"></span>
36         </a>
37       </td>
38       <td>{{ serverBlock.createdAt }}</td>
39       <td class="action-cell">
40         <button class="unblock-button" (click)="unblockServer(serverBlock)" i18n>Unmute</button>
41       </td>
42     </tr>
43   </ng-template>
44
45   <ng-template pTemplate="emptymessage">
46     <tr>
47       <td colspan="6">
48         <div class="empty-table-message">
49           <ng-container *ngIf="search" i18n>No server found matching current filters.</ng-container>
50           <ng-container *ngIf="!search" i18n>No server found.</ng-container>
51         </div>
52       </td>
53     </tr>
54   </ng-template>
55 </p-table>
56
57 <my-batch-domains-modal #batchDomainsModal i18n-action action="Mute domains" (domains)="onDomainsToBlock($event)"></my-batch-domains-modal>