]>
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 RK |
4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate |
5 | currentPageReportTemplate="Showing {first} to {last} of {totalRecords} followers" | |
04e0fc48 | 6 | > |
b014b6b9 C |
7 | <ng-template pTemplate="caption"> |
8 | <div class="caption"> | |
9 | <input | |
10 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
be27ef3b | 11 | (keyup)="onSearch($event)" |
b014b6b9 C |
12 | > |
13 | </div> | |
14 | </ng-template> | |
15 | ||
ab998f7b C |
16 | <ng-template pTemplate="header"> |
17 | <tr> | |
0dc64777 | 18 | <th i18n>Follower handle</th> |
68d19a0a RK |
19 | <th style="width: 100px;" i18n pSortableColumn="state">State <p-sortIcon field="state"></p-sortIcon></th> |
20 | <th style="width: 100px;" i18n pSortableColumn="score">Score <p-sortIcon field="score"></p-sortIcon></th> | |
21 | <th style="width: 200px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
22 | <th style="width: 100px;"></th> | |
ab998f7b C |
23 | </tr> |
24 | </ng-template> | |
25 | ||
26 | <ng-template pTemplate="body" let-follow> | |
27 | <tr> | |
e1a1f9c6 | 28 | <td><a [href]="follow.follower.url" target="_blank" rel="noopener noreferrer">{{ follow.follower.name + '@' + follow.follower.host }}</a></td> |
3827c3b3 C |
29 | |
30 | <td *ngIf="follow.state === 'accepted'" i18n>Accepted</td> | |
31 | <td *ngIf="follow.state === 'pending'" i18n>Pending</td> | |
32 | ||
0dc64777 | 33 | <td>{{ follow.score }}</td> |
ab998f7b | 34 | <td>{{ follow.createdAt }}</td> |
0dc64777 C |
35 | |
36 | <td class="action-cell"> | |
37 | <ng-container *ngIf="follow.state === 'pending'"> | |
38 | <my-button i18n-label label="Accept" icon="tick" (click)="acceptFollower(follow)"></my-button> | |
39 | <my-button i18n-label label="Refuse" icon="cross" (click)="rejectFollower(follow)"></my-button> | |
40 | </ng-container> | |
41 | ||
42 | <my-delete-button *ngIf="follow.state === 'accepted'" (click)="deleteFollower(follow)"></my-delete-button> | |
43 | </td> | |
ab998f7b C |
44 | </tr> |
45 | </ng-template> | |
d3840613 RK |
46 | |
47 | <ng-template pTemplate="emptymessage"> | |
48 | <tr> | |
49 | <td colspan="6"> | |
50 | <div class="empty-table-message"> | |
51 | <ng-container *ngIf="search" i18n>No follower found matching current filters.</ng-container> | |
52 | <ng-container *ngIf="!search" i18n>Your instance doesn't have any follower.</ng-container> | |
53 | </div> | |
54 | </td> | |
55 | </tr> | |
56 | </ng-template> | |
ab998f7b | 57 | </p-table> |