|
1 | | -<div *ngIf="!(isLoading$ | async) && itemList?.length > 0"> |
2 | | - <ngb-carousel #carousel [interval]="2000" (slide)="onSlide($event)" class="ds-carousel"> |
3 | | - <ng-template ngbSlide [id]="'slide_' + i" *ngFor="let item of currentPageItems(); let i = index; let last = last"> |
4 | | - <ng-container *ngIf="getItemLink(item.indexableObject); let currentLink; else carouselContent"> |
5 | | - <a *ngIf="isLinkInternal(currentLink)" [routerLink]="currentLink"> |
6 | | - <ng-container *ngTemplateOutlet="carouselContent"></ng-container> |
7 | | - </a> |
8 | | - <a *ngIf="!isLinkInternal(currentLink)" [href]="currentLink" [target]="carouselOptions.targetBlank ? '_blank' : null"> |
9 | | - <ng-container *ngTemplateOutlet="carouselContent"></ng-container> |
10 | | - </a> |
11 | | - </ng-container> |
12 | | - <ng-template #carouselContent> |
13 | | - <div class="carousel-content-wrapper" |
14 | | - [ngStyle]="{ |
| 1 | +<ngb-carousel #carousel [interval]="2000" (slide)="onSlide($event)" class="ds-carousel"> |
| 2 | + <ng-template ngbSlide *ngFor="let item of items; let i = index; let last = last"> |
| 3 | + <ng-container *ngIf="getItemLink(item.indexableObject); let currentLink; else carouselContent"> |
| 4 | + <a *ngIf="internalLinkService.isLinkInternal(currentLink)" [routerLink]="internalLinkService.getRelativePath(currentLink)"> |
| 5 | + <ng-container *ngTemplateOutlet="carouselContent"></ng-container> |
| 6 | + </a> |
| 7 | + <a *ngIf="!internalLinkService.isLinkInternal(currentLink)" [href]="currentLink" [target]="carouselOptions.targetBlank ? '_blank' : null"> |
| 8 | + <ng-container *ngTemplateOutlet="carouselContent"></ng-container> |
| 9 | + </a> |
| 10 | + </ng-container> |
| 11 | + <ng-template #carouselContent> |
| 12 | + <div class="carousel-content-wrapper" |
| 13 | + [ngStyle]="{ |
15 | 14 | 'height': carouselOptions.keepAspectRatio ? null : carouselOptions.carouselHeightPx + 'px', |
16 | 15 | 'aspect-ratio': carouselOptions.keepAspectRatio ? carouselOptions.aspectRatio : null |
17 | 16 | }"> |
18 | | - <div class="picsum-img-wrapper" *ngIf="(itemToImageHrefMap$ | async).get(item.indexableObject.uuid); let href"> |
19 | | - <img [src]="href" [alt]="item.indexableObject.metadata[title][0].value" class="img-fluid" |
20 | | - [ngClass]="{'w-100': carouselOptions.fitWidth, 'h-100': carouselOptions.fitHeight}"> |
21 | | - </div> |
22 | | - <div class="carousel-caption"> |
23 | | - <div class="carousel-caption-inner"> |
24 | | - <h3 data-test="carouselObjTitle" [class]="carouselOptions.titleStyle" |
25 | | - *ngIf="item.indexableObject.metadata[title]"> |
26 | | - {{item.indexableObject.metadata[title][0].value}}</h3> |
27 | | - <div data-test="carouselObjDesc" class="carousel-caption-text pr-3 pl-2" [class]="carouselOptions.captionStyle" |
28 | | - *ngIf="item.indexableObject.metadata[description]; let descriptionObj"> |
29 | | - {{descriptionObj[0].value}} |
30 | | - </div> |
| 17 | + <div class="picsum-img-wrapper" *ngIf="(itemToImageHrefMap$ | async).get(item.indexableObject.uuid); let href"> |
| 18 | + <img [src]="href" [alt]="item.indexableObject.metadata[title][0].value" class="img-fluid" |
| 19 | + [ngClass]="{'w-100': carouselOptions.fitWidth, 'h-100': carouselOptions.fitHeight}"> |
| 20 | + </div> |
| 21 | + <div class="carousel-caption"> |
| 22 | + <div class="carousel-caption-inner"> |
| 23 | + <h3 data-test="carouselObjTitle" [class]="carouselOptions.titleStyle" |
| 24 | + *ngIf="item.indexableObject.metadata[title]"> |
| 25 | + {{item.indexableObject.metadata[title][0].value}}</h3> |
| 26 | + <div data-test="carouselObjDesc" class="carousel-caption-text pr-3 pl-2" [class]="carouselOptions.captionStyle" |
| 27 | + *ngIf="item.indexableObject.metadata[description]; let descriptionObj"> |
| 28 | + {{descriptionObj[0].value}} |
31 | 29 | </div> |
32 | 30 | </div> |
33 | 31 | </div> |
34 | | - </ng-template> |
| 32 | + </div> |
35 | 33 | </ng-template> |
36 | | - </ngb-carousel> |
37 | | - <div class="text-center play-pause-button"> |
38 | | - <button type="button" class="btn btn-sm toggle-paused" (click)="togglePaused()"> |
39 | | - <i class="fas fa-play" *ngIf="paused"></i> |
40 | | - <i class="fas fa-pause" *ngIf="!paused"></i> |
41 | | - </button> |
42 | | - </div> |
43 | | - <div class="mt-4 w-100 d-flex justify-content-center align-items-center" *ngIf="totalPages > 1"> |
44 | | - <button (click)="previousPage()" [disabled]="currentPage === 1" class="prev border-0 bg-transparent"> |
45 | | - <i class="fa fa-arrow-left"></i> |
46 | | - </button> |
47 | | - <button |
48 | | - *ngFor="let page of pages()" |
49 | | - class="number" |
50 | | - (click)="changePage(page)" |
51 | | - style="border: none; background: none; margin: 0 5px" |
52 | | - [style.color]="page === currentPage ? '#000000' : '#7c7c7c'"> |
53 | | - {{ page < 10 ? '0' + page : page }} |
54 | | - </button> |
55 | | - <button (click)="nextPage()" [disabled]="currentPage === pages().length" class="next border-0 bg-transparent"> |
56 | | - <i class="fa fa-arrow-right"></i> |
57 | | - </button> |
58 | | - </div> |
59 | | -</div> |
60 | | - |
61 | | - |
62 | | -<div |
63 | | - class="carousel-content-wrapper" |
64 | | - [ngStyle]="{ |
65 | | - 'height': carouselOptions.keepAspectRatio ? null : carouselOptions.carouselHeightPx + 'px', |
66 | | - 'aspect-ratio': carouselOptions.keepAspectRatio ? carouselOptions.aspectRatio : null |
67 | | - }" |
68 | | - *ngIf="(isLoading$ | async)" |
69 | | -> |
70 | | - <a |
71 | | - href="#" |
72 | | - target="_blank" |
73 | | - class="img-container-el"> |
74 | | - <div class="picsum-img-wrapper flex-column"> |
75 | | - <img class="img-fluid" src="assets/images/replacement_image.svg"> |
76 | | - {{'loading.default' | translate}} |
77 | | - </div> |
78 | | - </a> |
| 34 | + </ng-template> |
| 35 | +</ngb-carousel> |
| 36 | +<div class="text-center play-pause-button"> |
| 37 | + <button type="button" class="btn btn-sm toggle-paused" (click)="togglePaused()"> |
| 38 | + <i class="fas fa-play" *ngIf="paused"></i> |
| 39 | + <i class="fas fa-pause" *ngIf="!paused"></i> |
| 40 | + </button> |
79 | 41 | </div> |
0 commit comments