|
1 | 1 | @if (showAccessStatusBadge) { |
2 | 2 | <ds-access-status-badge [object]="bitstream"></ds-access-status-badge> |
3 | 3 | } |
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" |
6 | 10 | [target]="isBlank ? '_blank': '_self'" |
7 | 11 | [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))" |
10 | 14 | role="link" |
11 | 15 | tabindex="0"> |
12 | | - @if ((canDownload$ | async) === false && (canDownloadWithToken$ | async) === false) { |
| 16 | + @if ((canDownload) === false && (canDownloadWithToken) === false) { |
13 | 17 | <!-- If the user cannot download the file by auth or token, show a lock icon --> |
14 | 18 | <span role="img" |
15 | 19 | [attr.aria-label]="'file-download-link.restricted' | translate" |
16 | 20 | [title]="'file-download-link.restricted' | translate" |
17 | 21 | class="pe-1"> |
18 | 22 | <i class="fas fa-lock"></i> |
19 | 23 | </span> |
20 | | - } @else if ((canDownloadWithToken$ | async) && (canDownload$ | async) === false) { |
| 24 | + } @else if (canDownloadWithToken && (canDownload === false)) { |
21 | 25 | <!-- If the user can download the file by token, and NOT normally show a lock open icon --> |
22 | 26 | <span role="img" |
23 | 27 | [attr.aria-label]="'file-download-link.secure-access' | translate" |
|
0 commit comments