forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in DSC-1314 (pull request DSpace#945)
[DSC-1314] Porting of improvements on file-download-button component Approved-by: Andrea Barbasso
- Loading branch information
Showing
1 changed file
with
17 additions
and
17 deletions.
There are no files selected for viewing
34 changes: 17 additions & 17 deletions
34
...tachment/attachment-render/types/file-download-button/file-download-button.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<ng-container *ngIf="!hasNoDownload"> | ||
<ng-container *ngIf="(canDownload$ | async)"> | ||
<ng-container *ngVar="bitstreamPath$ | async as downloadLink"> | ||
<a [routerLink]="downloadLink?.routerLink" [queryParams]="downloadLink?.queryParams" class="btn btn-outline-primary" | ||
data-test="download"> | ||
<i class="fas fa-download"></i> | ||
{{ 'cris-layout.advanced-attachment.download' | translate }}</a> | ||
</ng-container> | ||
</ng-container> | ||
<ng-container *ngIf="!(canDownload$ | async)"> | ||
<ng-container *ngVar="bitstreamPath$ | async as requestACopyLink"> | ||
<button [routerLink]="requestACopyLink?.routerLink" | ||
[queryParams]="requestACopyLink?.queryParams" | ||
[disabled]="!(canRequestItemCopy$ | async)" | ||
class="btn btn-outline-primary" | ||
data-test="requestACopy"> | ||
{{ 'cris-layout.advanced-attachment.requestACopy' | translate }}</button> | ||
</ng-container> | ||
<ng-container *ngIf="bitstreamPath$ | async as bitstreamLink"> | ||
<ng-container *ngIf="canDownload$ | async; then downloadButtonTpl; else requestACopyTpl"></ng-container> | ||
<ng-template #downloadButtonTpl> | ||
<button [routerLink]="bitstreamLink?.routerLink" [queryParams]="bitstreamLink?.queryParams" class="btn btn-outline-primary" | ||
data-test="download"> | ||
<i class="fas fa-download"></i> {{ 'cris-layout.advanced-attachment.download' | translate }} | ||
</button> | ||
</ng-template> | ||
<ng-template #requestACopyTpl> | ||
<button [routerLink]="bitstreamLink?.routerLink" | ||
[queryParams]="bitstreamLink?.queryParams" | ||
[disabled]="!(canRequestItemCopy$ | async)" | ||
class="btn btn-outline-primary" | ||
data-test="requestACopy"> | ||
{{ 'cris-layout.advanced-attachment.requestACopy' | translate }} | ||
</button> | ||
</ng-template> | ||
</ng-container> | ||
</ng-container> |