Skip to content

Commit 04a1e9f

Browse files
[DURACOM-455] optimize file download link template
1 parent de6955b commit 04a1e9f

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

src/app/shared/file-download-link/file-download-link.component.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
@if (showAccessStatusBadge) {
22
<ds-access-status-badge [object]="bitstream"></ds-access-status-badge>
33
}
4-
<a [routerLink]="(bitstreamPath$| async)?.routerLink" class="d-block dont-break-out mb-1"
5-
[queryParams]="(bitstreamPath$| async)?.queryParams"
4+
@let bitstreamPath = bitstreamPath$ | async;
5+
@let canDownload = canDownload$ | async;
6+
@let canDownloadWithToken = canDownloadWithToken$ | async;
7+
8+
<a [routerLink]="bitstreamPath?.routerLink" class="d-block dont-break-out mb-1"
9+
[queryParams]="bitstreamPath?.queryParams"
610
[target]="isBlank ? '_blank': '_self'"
711
[ngClass]="cssClasses"
8-
[attr.aria-label]="getDownloadLinkTitle(canDownload$ | async, canDownloadWithToken$ | async, dsoNameService.getName(bitstream))"
9-
[title]="getDownloadLinkTitle(canDownload$ | async, canDownloadWithToken$ | async, dsoNameService.getName(bitstream))"
12+
[attr.aria-label]="getDownloadLinkTitle(canDownload, canDownloadWithToken, dsoNameService.getName(bitstream))"
13+
[title]="getDownloadLinkTitle(canDownload, canDownloadWithToken, dsoNameService.getName(bitstream))"
1014
role="link"
1115
tabindex="0">
12-
@if ((canDownload$ | async) === false && (canDownloadWithToken$ | async) === false) {
16+
@if ((canDownload) === false && (canDownloadWithToken) === false) {
1317
<!-- If the user cannot download the file by auth or token, show a lock icon -->
1418
<span role="img"
1519
[attr.aria-label]="'file-download-link.restricted' | translate"
1620
[title]="'file-download-link.restricted' | translate"
1721
class="pe-1">
1822
<i class="fas fa-lock"></i>
1923
</span>
20-
} @else if ((canDownloadWithToken$ | async) && (canDownload$ | async) === false) {
24+
} @else if (canDownloadWithToken && (canDownload === false)) {
2125
<!-- If the user can download the file by token, and NOT normally show a lock open icon -->
2226
<span role="img"
2327
[attr.aria-label]="'file-download-link.secure-access' | translate"

0 commit comments

Comments
 (0)