]>
Commit | Line | Data |
---|---|---|
22839330 RK |
1 | <p-table |
2 | [value]="blockedAccounts" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" | |
3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" (onPage)="onPage($event)" | |
4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | |
5 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted accounts" | |
6 | > | |
7 | <ng-template pTemplate="caption"> | |
8 | <div class="caption"> | |
9 | <div class="ml-auto has-feedback has-clear"> | |
10 | <input | |
11 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
12 | (keyup)="onSearch($event)" | |
13 | > | |
14 | <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetSearch()"></a> | |
15 | <span class="sr-only" i18n>Clear filters</span> | |
16 | </div> | |
17 | </div> | |
18 | </ng-template> | |
19 | ||
20 | <ng-template pTemplate="header"> | |
21 | <tr> | |
22 | <th style="width: 100%;" i18n>Account</th> | |
23 | <th style="width: 150px;" i18n pSortableColumn="createdAt">Muted at <p-sortIcon field="createdAt"></p-sortIcon></th> | |
24 | <th style="width: 150px;"></th> <!-- column for action buttons --> | |
25 | </tr> | |
26 | </ng-template> | |
27 | ||
28 | <ng-template pTemplate="body" let-accountBlock> | |
29 | <tr> | |
30 | <td> | |
31 | <a [href]="accountBlock.blockedAccount.url" i18n-title title="Open account in a new tab" target="_blank" rel="noopener noreferrer"> | |
32 | <div class="chip two-lines"> | |
33 | <img | |
34 | class="avatar" | |
35 | [src]="accountBlock.blockedAccount.avatar?.path" | |
36 | (error)="switchToDefaultAvatar($event)" | |
37 | alt="Avatar" | |
38 | > | |
39 | <div> | |
40 | {{ accountBlock.blockedAccount.displayName }} | |
41 | <span class="text-muted">{{ accountBlock.blockedAccount.nameWithHost }}</span> | |
42 | </div> | |
43 | </div> | |
44 | </a> | |
45 | </td> | |
46 | ||
47 | <td>{{ accountBlock.createdAt | date: 'short' }}</td> | |
48 | <td class="action-cell"> | |
49 | <button class="unblock-button" (click)="unblockAccount(accountBlock)" i18n>Unmute</button> | |
50 | </td> | |
51 | </tr> | |
52 | </ng-template> | |
53 | ||
54 | <ng-template pTemplate="emptymessage"> | |
55 | <tr> | |
56 | <td colspan="6"> | |
57 | <div class="no-results"> | |
58 | <ng-container *ngIf="search" i18n>No account found matching current filters.</ng-container> | |
59 | <ng-container *ngIf="!search" i18n>No account found.</ng-container> | |
60 | </div> | |
61 | </td> | |
62 | </tr> | |
63 | </ng-template> | |
64 | </p-table> |