|
1 | 1 | <ds-metadata-field-wrapper [label]="label"> |
2 | | - @for (objectPage of objects; track objectPage; let i = $index) { |
| 2 | + @for (objectPage of objects; track objectPage; let i = $index; let lastPage = $last) { |
3 | 3 | <ng-container *ngVar="(objectPage | async) as representations"> |
4 | | - @for (rep of representations; track rep) { |
| 4 | + @for (rep of representations; track rep; let last = $last) { |
5 | 5 | <ds-metadata-representation-loader |
6 | 6 | [mdRepresentation]="rep"> |
7 | 7 | </ds-metadata-representation-loader> |
| 8 | + @if (!last || !lastPage) { |
| 9 | + <span [innerHTML]="separator"></span> |
| 10 | + } |
8 | 11 | } |
9 | | - @if ((i + 1) === objects.length && (i > 0) && (!representations || representations?.length === 0)) { |
| 12 | + @if (lastPage && (i > 0) && (!representations || representations?.length === 0)) { |
10 | 13 | <ds-loading message="{{'loading.default' | translate}}"></ds-loading> |
11 | 14 | } |
12 | | - @if ((i + 1) === objects.length && representations?.length > 0) { |
13 | | - <div class="d-inline-block w-100 mt-2"> |
14 | | - @if ((objects.length * incrementBy) < total) { |
15 | | - <div class="float-start"> |
16 | | - <button class="btn btn-link btn-link-inline" (click)="increase()">{{'item.page.related-items.view-more' | |
17 | | - translate:{ amount: (total - (objects.length * incrementBy) < incrementBy) ? total - (objects.length * incrementBy) : incrementBy } }}</button> |
18 | | - </div> |
19 | | - } |
20 | | - @if (objects.length > 1) { |
21 | | - <div class="float-end"> |
22 | | - <button class="btn btn-link btn-link-inline" (click)="decrease()">{{'item.page.related-items.view-less' | |
23 | | - translate:{ amount: representations?.length } }}</button> |
24 | | - </div> |
25 | | - } |
| 15 | + @if (lastPage && representations?.length > 0 && ((objects.length * incrementBy) < total || objects.length > 1)) { |
| 16 | + <div class="d-flex justify-content-between w-100 mt-2"> |
| 17 | + <div> |
| 18 | + @if ((objects.length * incrementBy) < total) { |
| 19 | + <button class="btn btn-link btn-link-inline" (click)="increase()">{{'item.page.related-items.view-more' | |
| 20 | + translate:{ amount: (total - (objects.length * incrementBy) < incrementBy) ? total - (objects.length * incrementBy) : incrementBy } }}</button> |
| 21 | + } |
| 22 | + </div> |
| 23 | + <div> |
| 24 | + @if (objects.length > 1) { |
| 25 | + <button class="btn btn-link btn-link-inline" (click)="decrease()">{{'item.page.related-items.view-less' | |
| 26 | + translate:{ amount: representations?.length } }}</button> |
| 27 | + } |
| 28 | + </div> |
26 | 29 | </div> |
27 | 30 | } |
28 | 31 | </ng-container> |
|
0 commit comments