]>
Commit | Line | Data |
---|---|---|
1 | <h1> | |
2 | <my-global-icon iconName="follower" aria-hidden="true"></my-global-icon> | |
3 | <ng-container i18n>Followers of your instance</ng-container> | |
4 | </h1> | |
5 | ||
6 | <p-table | |
7 | [value]="followers" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start" | |
8 | [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" | |
9 | [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" | |
10 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | |
11 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} followers" | |
12 | [(selection)]="selectedRows" | |
13 | > | |
14 | <ng-template pTemplate="caption"> | |
15 | <div class="caption"> | |
16 | <div class="left-buttons"> | |
17 | <my-action-dropdown | |
18 | *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange" | |
19 | [actions]="bulkActions" [entry]="selectedRows" | |
20 | > | |
21 | </my-action-dropdown> | |
22 | </div> | |
23 | ||
24 | <div class="ms-auto"> | |
25 | <my-advanced-input-filter [filters]="searchFilters" (search)="onSearch($event)"></my-advanced-input-filter> | |
26 | </div> | |
27 | </div> | |
28 | </ng-template> | |
29 | ||
30 | <ng-template pTemplate="header"> | |
31 | <tr> | |
32 | <th style="width: 40px"> | |
33 | <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox> | |
34 | </th> | |
35 | <th style="width: 150px;" i18n>Actions</th> | |
36 | <th i18n>Follower</th> | |
37 | <th style="width: 100px;" i18n pSortableColumn="state">State <p-sortIcon field="state"></p-sortIcon></th> | |
38 | <th style="width: 100px;" i18n pSortableColumn="score">Score <p-sortIcon field="score"></p-sortIcon></th> | |
39 | <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
40 | </tr> | |
41 | </ng-template> | |
42 | ||
43 | <ng-template pTemplate="body" let-follow> | |
44 | <tr> | |
45 | <td class="checkbox-cell"> | |
46 | <p-tableCheckbox [value]="follow" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox> | |
47 | </td> | |
48 | ||
49 | <td class="action-cell"> | |
50 | <my-button *ngIf="follow.state !== 'accepted'" i18n-title title="Accept" icon="tick" (click)="acceptFollower([ follow ])"></my-button> | |
51 | <my-button *ngIf="follow.state !== 'rejected'" i18n-title title="Reject" icon="cross" (click)="rejectFollower([ follow ])"></my-button> | |
52 | ||
53 | <my-delete-button *ngIf="follow.state === 'rejected'" (click)="deleteFollowers([ follow ])"></my-delete-button> | |
54 | </td> | |
55 | <td> | |
56 | <a [href]="follow.follower.url" i18n-title title="Open actor page in a new tab" target="_blank" rel="noopener noreferrer"> | |
57 | {{ buildFollowerName(follow) }} | |
58 | <my-global-icon iconName="external-link"></my-global-icon> | |
59 | </a> | |
60 | </td> | |
61 | ||
62 | <td> | |
63 | <span *ngIf="follow.state === 'accepted'" class="pt-badge badge-green" i18n>Accepted</span> | |
64 | <span *ngIf="follow.state === 'pending'" class="pt-badge badge-yellow" i18n>Pending</span> | |
65 | <span *ngIf="follow.state === 'rejected'" class="pt-badge badge-red" i18n>Rejected</span> | |
66 | </td> | |
67 | ||
68 | <td>{{ follow.score }}</td> | |
69 | <td>{{ follow.createdAt | date: 'short' }}</td> | |
70 | </tr> | |
71 | </ng-template> | |
72 | ||
73 | <ng-template pTemplate="emptymessage"> | |
74 | <tr> | |
75 | <td myAutoColspan> | |
76 | <div class="no-results"> | |
77 | <ng-container *ngIf="search" i18n>No follower found matching current filters.</ng-container> | |
78 | <ng-container *ngIf="!search" i18n>Your instance doesn't have any follower.</ng-container> | |
79 | </div> | |
80 | </td> | |
81 | </tr> | |
82 | </ng-template> | |
83 | </p-table> |