|
1 |
| -<osf-sub-header |
2 |
| - [title]="'preprints.myPreprints.title' | translate" |
3 |
| - [icon]="'preprints'" |
4 |
| - [showButton]="true" |
5 |
| - [buttonLabel]="'preprints.addPreprint' | translate: { preprintWord: 'preprint' | titlecase }" |
6 |
| - (buttonClick)="addPreprintBtnClicked()" |
7 |
| -/> |
8 |
| - |
9 |
| -<section class="flex-1 flex flex-column bg-white p-3 md:p-4"> |
10 |
| - <osf-search-input |
11 |
| - class="w-full" |
12 |
| - [control]="searchControl" |
13 |
| - [placeholder]="'preprints.myPreprints.searchPlaceholder' | translate" |
| 1 | +<div class="xl:flex xl:flex-column xl:mt-6 flex-1"> |
| 2 | + <osf-sub-header |
| 3 | + [title]="'preprints.myPreprints.title' | translate" |
| 4 | + [icon]="'preprints'" |
| 5 | + [showButton]="true" |
| 6 | + [buttonLabel]="'preprints.addPreprint' | translate: { preprintWord: 'preprint' | titlecase }" |
| 7 | + (buttonClick)="addPreprintBtnClicked()" |
14 | 8 | />
|
15 | 9 |
|
16 |
| - <p-table |
17 |
| - class="mt-4" |
18 |
| - [value]="areMyPreprintsLoading() ? skeletonData : preprints()" |
19 |
| - [rows]="tableParams().rows" |
20 |
| - [first]="tableParams().firstRowIndex" |
21 |
| - [rowsPerPageOptions]="tableParams().rowsPerPageOptions" |
22 |
| - [paginator]="true" |
23 |
| - [totalRecords]="tableParams().totalRecords" |
24 |
| - paginatorDropdownAppendTo="body" |
25 |
| - [resizableColumns]="true" |
26 |
| - [autoLayout]="true" |
27 |
| - [scrollable]="true" |
28 |
| - [sortMode]="'single'" |
29 |
| - [lazy]="true" |
30 |
| - [lazyLoadOnInit]="true" |
31 |
| - (onPage)="onPageChange($event)" |
32 |
| - (onSort)="onSort($event)" |
33 |
| - [sortField]="sortColumn()" |
34 |
| - [sortOrder]="sortOrder() === 0 ? 1 : -1" |
35 |
| - [customSort]="true" |
36 |
| - [resetPageOnSort]="false" |
37 |
| - > |
38 |
| - <ng-template #header> |
39 |
| - <tr> |
40 |
| - <th pSortableColumn="title"> |
41 |
| - {{ 'preprints.myPreprints.table.titleLabel' | translate }} |
42 |
| - <p-sortIcon field="title" /> |
43 |
| - </th> |
44 |
| - <th>{{ 'preprints.myPreprints.table.contributorsLabel' | translate }}</th> |
45 |
| - <th pSortableColumn="dateModified"> |
46 |
| - {{ 'preprints.myPreprints.table.modifiedLabel' | translate }} |
47 |
| - <p-sortIcon field="dateModified" /> |
48 |
| - </th> |
49 |
| - </tr> |
50 |
| - </ng-template> |
51 |
| - <ng-template #body let-item> |
52 |
| - @if (item?.id) { |
53 |
| - <tr class="cursor-pointer" (click)="navigateToPreprintDetails(item)"> |
54 |
| - <td>{{ item.title }}</td> |
55 |
| - <td> |
56 |
| - <osf-list-info-shortener [data]="item.contributors" /> |
57 |
| - </td> |
58 |
| - <td>{{ item.dateModified | date: 'MMM d, y, h:mm a' }}</td> |
| 10 | + <section class="flex-1 flex flex-column bg-white p-3 md:p-4"> |
| 11 | + <osf-search-input |
| 12 | + class="w-full" |
| 13 | + [control]="searchControl" |
| 14 | + [placeholder]="'preprints.myPreprints.searchPlaceholder' | translate" |
| 15 | + /> |
| 16 | + |
| 17 | + <p-table |
| 18 | + class="mt-4" |
| 19 | + [value]="areMyPreprintsLoading() ? skeletonData : preprints()" |
| 20 | + [rows]="tableParams().rows" |
| 21 | + [first]="tableParams().firstRowIndex" |
| 22 | + [rowsPerPageOptions]="tableParams().rowsPerPageOptions" |
| 23 | + [paginator]="true" |
| 24 | + [totalRecords]="tableParams().totalRecords" |
| 25 | + paginatorDropdownAppendTo="body" |
| 26 | + [resizableColumns]="true" |
| 27 | + [autoLayout]="true" |
| 28 | + [scrollable]="true" |
| 29 | + [sortMode]="'single'" |
| 30 | + [lazy]="true" |
| 31 | + [lazyLoadOnInit]="true" |
| 32 | + (onPage)="onPageChange($event)" |
| 33 | + (onSort)="onSort($event)" |
| 34 | + [sortField]="sortColumn()" |
| 35 | + [sortOrder]="sortOrder() === 0 ? 1 : -1" |
| 36 | + [customSort]="true" |
| 37 | + [resetPageOnSort]="false" |
| 38 | + > |
| 39 | + <ng-template #header> |
| 40 | + <tr> |
| 41 | + <th pSortableColumn="title"> |
| 42 | + {{ 'preprints.myPreprints.table.titleLabel' | translate }} |
| 43 | + <p-sortIcon field="title" /> |
| 44 | + </th> |
| 45 | + <th>{{ 'preprints.myPreprints.table.contributorsLabel' | translate }}</th> |
| 46 | + <th pSortableColumn="dateModified"> |
| 47 | + {{ 'preprints.myPreprints.table.modifiedLabel' | translate }} |
| 48 | + <p-sortIcon field="dateModified" /> |
| 49 | + </th> |
59 | 50 | </tr>
|
60 |
| - } @else { |
61 |
| - <tr class="loading-row"> |
62 |
| - <td colspan="4"> |
63 |
| - <p-skeleton width="100%" height="3.3rem" borderRadius="0" /> |
64 |
| - </td> |
| 51 | + </ng-template> |
| 52 | + <ng-template #body let-item> |
| 53 | + @if (item?.id) { |
| 54 | + <tr class="cursor-pointer" (click)="navigateToPreprintDetails(item)"> |
| 55 | + <td>{{ item.title }}</td> |
| 56 | + <td> |
| 57 | + <osf-list-info-shortener [data]="item.contributors" /> |
| 58 | + </td> |
| 59 | + <td>{{ item.dateModified | date: 'MMM d, y, h:mm a' }}</td> |
| 60 | + </tr> |
| 61 | + } @else { |
| 62 | + <tr class="loading-row"> |
| 63 | + <td colspan="4"> |
| 64 | + <p-skeleton width="100%" height="3.3rem" borderRadius="0" /> |
| 65 | + </td> |
| 66 | + </tr> |
| 67 | + } |
| 68 | + </ng-template> |
| 69 | + <ng-template pTemplate="emptymessage"> |
| 70 | + <tr> |
| 71 | + <td colspan="4" class="text-center">{{ 'common.search.noResultsFound' | translate }}</td> |
65 | 72 | </tr>
|
66 |
| - } |
67 |
| - </ng-template> |
68 |
| - <ng-template pTemplate="emptymessage"> |
69 |
| - <tr> |
70 |
| - <td colspan="4" class="text-center">{{ 'common.search.noResultsFound' | translate }}</td> |
71 |
| - </tr> |
72 |
| - </ng-template> |
73 |
| - </p-table> |
74 |
| -</section> |
| 73 | + </ng-template> |
| 74 | + </p-table> |
| 75 | + </section> |
| 76 | +</div> |
0 commit comments