]>
Commit | Line | Data |
---|---|---|
ab998f7b | 1 | <p-table |
b8cf27c0 | 2 | [value]="followers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" |
ab998f7b | 3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" |
b8cf27c0 | 4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate |
f66b8d12 | 5 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} followers" |
04e0fc48 | 6 | > |
b014b6b9 C |
7 | <ng-template pTemplate="caption"> |
8 | <div class="caption"> | |
25a42e29 RK |
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> | |
b014b6b9 C |
17 | </div> |
18 | </ng-template> | |
19 | ||
ab998f7b C |
20 | <ng-template pTemplate="header"> |
21 | <tr> | |
0dc64777 | 22 | <th i18n>Follower handle</th> |
68d19a0a RK |
23 | <th style="width: 100px;" i18n pSortableColumn="state">State <p-sortIcon field="state"></p-sortIcon></th> |
24 | <th style="width: 100px;" i18n pSortableColumn="score">Score <p-sortIcon field="score"></p-sortIcon></th> | |
7f979fd8 | 25 | <th style="width: 140px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> |
68d19a0a | 26 | <th style="width: 100px;"></th> |
ab998f7b C |
27 | </tr> |
28 | </ng-template> | |
29 | ||
30 | <ng-template pTemplate="body" let-follow> | |
31 | <tr> | |
e1a1f9c6 | 32 | <td><a [href]="follow.follower.url" target="_blank" rel="noopener noreferrer">{{ follow.follower.name + '@' + follow.follower.host }}</a></td> |
3827c3b3 C |
33 | |
34 | <td *ngIf="follow.state === 'accepted'" i18n>Accepted</td> | |
35 | <td *ngIf="follow.state === 'pending'" i18n>Pending</td> | |
36 | ||
0dc64777 | 37 | <td>{{ follow.score }}</td> |
7f979fd8 | 38 | <td>{{ follow.createdAt | date: 'short' }}</td> |
0dc64777 C |
39 | |
40 | <td class="action-cell"> | |
41 | <ng-container *ngIf="follow.state === 'pending'"> | |
42 | <my-button i18n-label label="Accept" icon="tick" (click)="acceptFollower(follow)"></my-button> | |
43 | <my-button i18n-label label="Refuse" icon="cross" (click)="rejectFollower(follow)"></my-button> | |
44 | </ng-container> | |
45 | ||
46 | <my-delete-button *ngIf="follow.state === 'accepted'" (click)="deleteFollower(follow)"></my-delete-button> | |
47 | </td> | |
ab998f7b C |
48 | </tr> |
49 | </ng-template> | |
d3840613 RK |
50 | |
51 | <ng-template pTemplate="emptymessage"> | |
52 | <tr> | |
53 | <td colspan="6"> | |
54 | <div class="empty-table-message"> | |
55 | <ng-container *ngIf="search" i18n>No follower found matching current filters.</ng-container> | |
56 | <ng-container *ngIf="!search" i18n>Your instance doesn't have any follower.</ng-container> | |
57 | </div> | |
58 | </td> | |
59 | </tr> | |
60 | </ng-template> | |
ab998f7b | 61 | </p-table> |