|
1 | | -<div class="flex justify-content-between align-items-center p-3"> |
2 | | - <div> |
| 1 | +<div class="flex justify-content-between align-items-center py-2 px-0 md:py-3 md:px-3"> |
| 2 | + <div class="hidden md:block"> |
3 | 3 | <ng-content select="[slot=amount]"></ng-content> |
4 | 4 | </div> |
5 | 5 |
|
6 | 6 | <p-menu #downloadMenu [model]="downloadMenuItems()" appendTo="body" popup> |
7 | 7 | <ng-template #item let-item> |
8 | | - <a class="p-menu-item-link ml-1" target="_blank" [href]="item.link"> |
| 8 | + <a class="p-menu-item-link ml-1" osfStopPropagation target="_blank" [href]="item.link"> |
9 | 9 | <i [class]="item.icon"></i> |
10 | 10 |
|
11 | 11 | {{ item.label }} |
12 | 12 | </a> |
13 | 13 | </ng-template> |
14 | 14 | </p-menu> |
15 | 15 |
|
16 | | - <div class="filters-section flex align-items-center gap-2"> |
| 16 | + <div class="flex align-items-center gap-2 flex-column w-full md:flex-row md:w-fit"> |
17 | 17 | <ng-content select="[slot=otherFilters]"></ng-content> |
18 | 18 |
|
19 | | - <p-multiselect |
20 | | - [options]="tableColumns()" |
21 | | - [(ngModel)]="selectedColumns" |
22 | | - (onChange)="onColumnSelectionChange($event.value)" |
23 | | - optionLabel="header" |
24 | | - [showToggleAll]="false" |
25 | | - [showClear]="false" |
26 | | - [dropdownIcon]="'hidden'" |
27 | | - > |
28 | | - <ng-template let-values pTemplate="selectedItems"> |
29 | | - <div class="flex align-items-center gap-2"> |
30 | | - <i class="fa fa-table-columns text-primary font-bold"></i> |
31 | | - <span>{{ 'adminInstitutions.institutionUsers.customize' | translate }}</span> |
32 | | - </div> |
33 | | - </ng-template> |
| 19 | + <div class="flex align-items-center gap-2 justify-content-between w-full md:justify-content-start md:w-fit"> |
| 20 | + <p-multiselect |
| 21 | + class="w-9 md:w-fit" |
| 22 | + [options]="tableColumns()" |
| 23 | + [(ngModel)]="selectedColumns" |
| 24 | + (onChange)="onColumnSelectionChange($event.value)" |
| 25 | + optionLabel="header" |
| 26 | + [showToggleAll]="false" |
| 27 | + [showClear]="false" |
| 28 | + [dropdownIcon]="'hidden'" |
| 29 | + > |
| 30 | + <ng-template let-values pTemplate="selectedItems"> |
| 31 | + <div class="flex align-items-center gap-2"> |
| 32 | + <i class="fa fa-table-columns text-primary font-bold"></i> |
| 33 | + <span>{{ 'adminInstitutions.institutionUsers.customize' | translate }}</span> |
| 34 | + </div> |
| 35 | + </ng-template> |
34 | 36 |
|
35 | | - <ng-template #item let-item> |
36 | | - {{ item.header | translate }} |
37 | | - </ng-template> |
38 | | - </p-multiselect> |
| 37 | + <ng-template #item let-item> |
| 38 | + {{ item.header | translate }} |
| 39 | + </ng-template> |
| 40 | + </p-multiselect> |
39 | 41 |
|
40 | | - @if (downloadLink()) { |
41 | | - <p-button |
42 | | - icon="fa fa-download text-primary text-xl" |
43 | | - class="p-button p-button-outlined p-button-sm p-06 font-bold grey-border-color child-button-0-padding" |
44 | | - severity="info" |
45 | | - (click)="downloadMenu.toggle($event)" |
46 | | - /> |
47 | | - } |
| 42 | + @if (downloadLink()) { |
| 43 | + <p-button |
| 44 | + icon="fa fa-download text-primary text-xl" |
| 45 | + outlined |
| 46 | + class="grey-border-color download-button" |
| 47 | + severity="info" |
| 48 | + (click)="downloadMenu.toggle($event)" |
| 49 | + /> |
| 50 | + } |
48 | 51 |
|
49 | | - @if (reportsLink()) { |
50 | | - <a |
51 | | - pButton |
52 | | - [href]="reportsLink()" |
53 | | - class="p-button p-button-outlined p-button-sm p-06 font-bold grey-border-color child-button-0-padding" |
54 | | - target="_blank" |
55 | | - > |
56 | | - <i class="fa fa-chart-pie text-primary border-1 border-transparent text-xl"></i> |
57 | | - </a> |
58 | | - } |
| 52 | + @if (reportsLink()) { |
| 53 | + <a |
| 54 | + pButton |
| 55 | + [href]="reportsLink()" |
| 56 | + class="p-button p-button-outlined p-button-sm p-06 font-bold grey-border-color child-button-0-padding no-underline" |
| 57 | + target="_blank" |
| 58 | + > |
| 59 | + <i class="fa fa-chart-pie text-xl"></i> |
| 60 | + </a> |
| 61 | + } |
| 62 | + </div> |
59 | 63 | </div> |
60 | 64 | </div> |
61 | 65 |
|
|
70 | 74 | [sortOrder]="currentSortOrder()" |
71 | 75 | [customSort]="true" |
72 | 76 | [resetPageOnSort]="false" |
73 | | - [tableStyle]="{ 'min-width': '50rem' }" |
| 77 | + class="institution-admin-table" |
74 | 78 | > |
75 | 79 | <ng-template #header let-columns> |
76 | 80 | <tr> |
77 | 81 | @for (col of columns; track col.field) { |
78 | | - <th [pSortableColumn]="col.sortable ? col.field : null"> |
| 82 | + <th [pSortableColumn]="col.sortable ? col.field : null" (click)="onHeaderClick(col)"> |
79 | 83 | <div class="flex align-items-center gap-2"> |
80 | 84 | <span>{{ col.header | translate }}</span> |
81 | 85 | @if (col.sortable) { |
|
98 | 102 | [target]="getLinkTarget(rowData[col.field], col)" |
99 | 103 | class="text-primary no-underline hover:underline" |
100 | 104 | > |
101 | | - {{ getCellValueWithFormatting(rowData[col.field], col) }} |
| 105 | + @if (col.dateFormat) { |
| 106 | + {{ getCellValue(rowData[col.field]) | date: col.dateFormat }} |
| 107 | + } @else { |
| 108 | + {{ getCellValue(rowData[col.field]) }} |
| 109 | + } |
102 | 110 | </a> |
103 | 111 | } @else { |
104 | | - {{ getCellValueWithFormatting(rowData[col.field], col) }} |
| 112 | + @if (col.dateFormat) { |
| 113 | + {{ getCellValue(rowData[col.field]) | date: col.dateFormat }} |
| 114 | + } @else { |
| 115 | + {{ getCellValue(rowData[col.field]) }} |
| 116 | + } |
105 | 117 | } |
106 | 118 |
|
107 | 119 | @if (col.showIcon) { |
|
121 | 133 | </ng-template> |
122 | 134 | </p-table> |
123 | 135 |
|
124 | | -@if (enablePagination() && totalCount() > pageSize()) { |
125 | | - <div class="p-3"> |
126 | | - <osf-custom-paginator |
127 | | - [first]="first()" |
128 | | - [totalCount]="totalCount()" |
129 | | - [rows]="pageSize()" |
130 | | - (pageChanged)="onPageChange($event)" |
131 | | - ></osf-custom-paginator> |
| 136 | +@if (isNextPreviousPagination()) { |
| 137 | + <div class="flex column-gap-2 w-full justify-content-center pt-2"> |
| 138 | + @if (firstLink() && prevLink()) { |
| 139 | + <p-button icon="fas fa-angles-left" severity="contrast" text (click)="switchPage(firstLink())"></p-button> |
| 140 | + } |
| 141 | + |
| 142 | + <p-button |
| 143 | + icon="fas fa-angle-left" |
| 144 | + severity="contrast" |
| 145 | + text |
| 146 | + [disabled]="!prevLink()" |
| 147 | + (click)="switchPage(prevLink())" |
| 148 | + > |
| 149 | + </p-button> |
| 150 | + |
| 151 | + <p-button |
| 152 | + icon="fas fa-angle-right" |
| 153 | + severity="contrast" |
| 154 | + text |
| 155 | + [disabled]="!nextLink()" |
| 156 | + (click)="switchPage(nextLink())" |
| 157 | + > |
| 158 | + </p-button> |
132 | 159 | </div> |
| 160 | +} @else { |
| 161 | + @if (enablePagination() && totalCount() > pageSize()) { |
| 162 | + <div class="p-3"> |
| 163 | + <osf-custom-paginator |
| 164 | + [first]="first()" |
| 165 | + [totalCount]="totalCount()" |
| 166 | + [rows]="pageSize()" |
| 167 | + (pageChanged)="onPageChange($event)" |
| 168 | + ></osf-custom-paginator> |
| 169 | + </div> |
| 170 | + } |
133 | 171 | } |
0 commit comments