]>
Commit | Line | Data |
---|---|---|
ed5bb517 K |
1 | <h1> |
2 | <my-global-icon iconName="following" aria-hidden="true"></my-global-icon> | |
718fc079 | 3 | <ng-container i18n>Subscriptions of your instance</ng-container> |
ed5bb517 K |
4 | </h1> |
5 | ||
ab998f7b | 6 | <p-table |
0667dbaf C |
7 | [value]="following" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start" |
8 | [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" | |
2e46eb97 | 9 | [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" |
b8cf27c0 | 10 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate |
f66b8d12 | 11 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} hosts" |
cd940f40 | 12 | [(selection)]="selectedRows" |
04e0fc48 | 13 | > |
b014b6b9 C |
14 | <ng-template pTemplate="caption"> |
15 | <div class="caption"> | |
9c1a88e3 | 16 | <div class="left-buttons"> |
e3d6c643 C |
17 | <my-action-dropdown |
18 | *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange" | |
cd940f40 | 19 | [actions]="bulkActions" [entry]="selectedRows" |
e3d6c643 C |
20 | > |
21 | </my-action-dropdown> | |
22 | ||
23 | <a *ngIf="!isInSelectionMode()" class="follow-button" (click)="openFollowModal()" (key.enter)="openFollowModal()"> | |
9c1a88e3 | 24 | <my-global-icon iconName="following" aria-hidden="true"></my-global-icon> |
4d029ef8 | 25 | <ng-container i18n>Follow</ng-container> |
9c1a88e3 C |
26 | </a> |
27 | </div> | |
28 | ||
4c8749cb | 29 | <div class="ms-auto"> |
073deef8 | 30 | <my-advanced-input-filter [filters]="searchFilters" (search)="onSearch($event)"></my-advanced-input-filter> |
b014b6b9 C |
31 | </div> |
32 | </div> | |
33 | </ng-template> | |
34 | ||
ab998f7b C |
35 | <ng-template pTemplate="header"> |
36 | <tr> | |
e3d6c643 C |
37 | <th style="width: 40px"> |
38 | <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox> | |
39 | </th> | |
e0436741 | 40 | <th style="width: 150px;" i18n>Action</th> |
4d029ef8 | 41 | <th i18n>Following</th> |
68d19a0a | 42 | <th style="width: 100px;" i18n pSortableColumn="state">State <p-sortIcon field="state"></p-sortIcon></th> |
df4c603d | 43 | <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> |
68d19a0a | 44 | <th style="width: 160px;" i18n pSortableColumn="redundancyAllowed">Redundancy allowed <p-sortIcon field="redundancyAllowed"></p-sortIcon></th> |
ab998f7b C |
45 | </tr> |
46 | </ng-template> | |
47 | ||
40e99372 C |
48 | <ng-template pTemplate="body" let-follow> |
49 | <tr pSelectableRow="follow"> | |
e3d6c643 C |
50 | <td class="checkbox-cell"> |
51 | <p-tableCheckbox [value]="follow" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox> | |
52 | </td> | |
53 | ||
30814423 | 54 | <td class="action-cell"> |
e3d6c643 | 55 | <my-delete-button label (click)="removeFollowing([ follow ])"></my-delete-button> |
30814423 | 56 | </td> |
b8cf27c0 | 57 | <td> |
4d029ef8 | 58 | <a [href]="follow.following.url" i18n-title title="Open instance in a new tab" target="_blank" rel="noopener noreferrer"> |
e3d6c643 | 59 | {{ buildFollowingName(follow) }} |
c2faa073 | 60 | <my-global-icon iconName="external-link"></my-global-icon> |
b8cf27c0 RK |
61 | </a> |
62 | </td> | |
3827c3b3 | 63 | |
073deef8 C |
64 | <td> |
65 | <span *ngIf="follow.state === 'accepted'" class="pt-badge badge-green" i18n>Accepted</span> | |
66 | <span *ngIf="follow.state === 'pending'" class="pt-badge badge-yellow" i18n>Pending</span> | |
67 | <span *ngIf="follow.state === 'rejected'" class="pt-badge badge-red" i18n>Rejected</span> | |
bc99dfe5 | 68 | </td> |
3827c3b3 | 69 | |
7f979fd8 | 70 | <td>{{ follow.createdAt | date: 'short' }}</td> |
c48e82b5 C |
71 | <td> |
72 | <my-redundancy-checkbox | |
4d029ef8 | 73 | *ngIf="isInstanceFollowing(follow)" |
c48e82b5 C |
74 | [host]="follow.following.host" [redundancyAllowed]="follow.following.hostRedundancyAllowed" |
75 | ></my-redundancy-checkbox> | |
76 | </td> | |
ab998f7b C |
77 | </tr> |
78 | </ng-template> | |
d3840613 RK |
79 | |
80 | <ng-template pTemplate="emptymessage"> | |
81 | <tr> | |
e3d6c643 | 82 | <td colspan="6"> |
22839330 | 83 | <div class="no-results"> |
d3840613 | 84 | <ng-container *ngIf="search" i18n>No host found matching current filters.</ng-container> |
b8cf27c0 | 85 | <ng-container *ngIf="!search" i18n>Your instance is not following anyone.</ng-container> |
d3840613 RK |
86 | </div> |
87 | </td> | |
88 | </tr> | |
89 | </ng-template> | |
ab998f7b | 90 | </p-table> |
bb152476 | 91 | |
4d029ef8 | 92 | <my-follow-modal #followModal></my-follow-modal> |