]>
Commit | Line | Data |
---|---|---|
ab998f7b C |
1 | <p-table |
2 | [value]="followers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | |
3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" | |
04e0fc48 | 4 | > |
b014b6b9 C |
5 | <ng-template pTemplate="caption"> |
6 | <div class="caption"> | |
7 | <input | |
8 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
9 | (keyup)="onSearch($event.target.value)" | |
10 | > | |
11 | </div> | |
12 | </ng-template> | |
13 | ||
ab998f7b C |
14 | <ng-template pTemplate="header"> |
15 | <tr> | |
0dc64777 | 16 | <th i18n>Follower handle</th> |
cb5ce4cb C |
17 | <th i18n pSortableColumn="state">State <p-sortIcon field="state"></p-sortIcon></th> |
18 | <th i18n pSortableColumn="score">Score <p-sortIcon field="score"></p-sortIcon></th> | |
b1d40cff | 19 | <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> |
0dc64777 | 20 | <th></th> |
ab998f7b C |
21 | </tr> |
22 | </ng-template> | |
23 | ||
24 | <ng-template pTemplate="body" let-follow> | |
25 | <tr> | |
e1a1f9c6 | 26 | <td><a [href]="follow.follower.url" target="_blank" rel="noopener noreferrer">{{ follow.follower.name + '@' + follow.follower.host }}</a></td> |
3827c3b3 C |
27 | |
28 | <td *ngIf="follow.state === 'accepted'" i18n>Accepted</td> | |
29 | <td *ngIf="follow.state === 'pending'" i18n>Pending</td> | |
30 | ||
0dc64777 | 31 | <td>{{ follow.score }}</td> |
ab998f7b | 32 | <td>{{ follow.createdAt }}</td> |
0dc64777 C |
33 | |
34 | <td class="action-cell"> | |
35 | <ng-container *ngIf="follow.state === 'pending'"> | |
36 | <my-button i18n-label label="Accept" icon="tick" (click)="acceptFollower(follow)"></my-button> | |
37 | <my-button i18n-label label="Refuse" icon="cross" (click)="rejectFollower(follow)"></my-button> | |
38 | </ng-container> | |
39 | ||
40 | <my-delete-button *ngIf="follow.state === 'accepted'" (click)="deleteFollower(follow)"></my-delete-button> | |
41 | </td> | |
ab998f7b C |
42 | </tr> |
43 | </ng-template> | |
44 | </p-table> |