|
1 | | -<div *ngIf="licenses.length > 0 || uris.length > 0" class="item-page-field"> |
2 | | - <ng-container *ngIf="(hasCcLicenseName$ | async) && (hasCcLicenseUri$ | async); then ccLicense; else default"> |
3 | | - </ng-container> |
4 | | - <ng-template #ccLicense> |
5 | | - <ds-item-page-cc-license-field [item]="item" [variant]="'full'"></ds-item-page-cc-license-field> |
6 | | - </ng-template> |
7 | | - <ng-template #default> |
8 | | - <ds-metadata-field-wrapper [label]="'item.page.license.title' | translate"> |
9 | | - <ng-container *ngIf="licenses.length === uris.length; then licensesWithLink; else listOfLicenses"> |
10 | | - </ng-container> |
11 | | - <ng-template #licensesWithLink> |
12 | | - <ng-container *ngFor="let license of licenses; let last=last; let i=index;"> |
13 | | - <a [href]="uris[i]" target="_blank" class="license-link"><span class="license-text">{{ license }}</span></a> |
14 | | - <span class="separator" *ngIf="!last" [innerHTML]="separator"></span> |
15 | | - </ng-container> |
16 | | - </ng-template> |
17 | | - <ng-template #listOfLicenses> |
18 | | - <ng-container *ngFor="let license of licenses; let last=last;"> |
19 | | - <span class="license-text">{{ license }}</span> |
20 | | - <span class="separator" *ngIf="!last || uris.length > 0" [innerHTML]="separator"></span> |
21 | | - </ng-container> |
22 | | - <ng-container *ngFor="let uri of uris; let last=last;"> |
23 | | - <a [href]="uri" target="_blank" class="license-link"><span class="license-text">{{ uri }}</span></a> |
24 | | - <span class="separator" *ngIf="!last" [innerHTML]="separator"></span> |
25 | | - </ng-container> |
26 | | - </ng-template> |
27 | | - </ds-metadata-field-wrapper> |
28 | | - </ng-template> |
29 | | -</div> |
| 1 | +@if (licenses.length > 0 || uris.length > 0) { |
| 2 | + <div class="item-page-field"> |
| 3 | + @if ((hasCcLicenseName$ | async) && (hasCcLicenseUri$ | async)) { |
| 4 | + <ds-item-page-cc-license-field [item]="item" [variant]="'full'"></ds-item-page-cc-license-field> |
| 5 | + } @else { |
| 6 | + <ds-metadata-field-wrapper [label]="'item.page.license.title' | translate"> |
| 7 | + @if (licenses.length === uris.length) { |
| 8 | + @for (license of licenses; track license; let last=$last; let i=$index) { |
| 9 | + <a [href]="uris[i]" target="_blank" class="license-link"><span class="license-text">{{ license }}</span></a> |
| 10 | + @if (!last) { |
| 11 | + <span class="separator" [innerHTML]="separator"></span> |
| 12 | + } |
| 13 | + } |
| 14 | + } @else { |
| 15 | + @for (license of licenses; track license; let last=$last) { |
| 16 | + <span class="license-text">{{ license }}</span> |
| 17 | + @if (!last || uris.length > 0) { |
| 18 | + <span class="separator" [innerHTML]="separator"></span> |
| 19 | + } |
| 20 | + } |
| 21 | + @for (uri of uris; track uri; let last=$last) { |
| 22 | + <a [href]="uri" target="_blank" class="license-link"><span class="license-text">{{ uri }}</span></a> |
| 23 | + @if (!last) { |
| 24 | + <span class="separator" [innerHTML]="separator"></span> |
| 25 | + } |
| 26 | + } |
| 27 | + } |
| 28 | + </ds-metadata-field-wrapper> |
| 29 | + } |
| 30 | + </div> |
| 31 | +} |
0 commit comments