forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathmetadata-link-view.component.html
34 lines (31 loc) · 1.48 KB
/
metadata-link-view.component.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<div class="d-inline-block" *ngVar="(metadataView$ | async) as metadataView">
<ng-container *ngIf="metadataView" [ngTemplateOutlet]="metadataView?.authority ? linkToAuthority : (metadataView?.entityType ? textWithIcon : textWithoutIcon)"
[ngTemplateOutletContext]="{metadataView: metadataView}"></ng-container>
</div>
<ng-template class="d-flex" #linkToAuthority let-metadataView="metadataView">
<a rel="noopener noreferrer" data-test="linkToAuthority"
[routerLink]="['/items/' + metadataView.authority]">
<span dsEntityIcon
[iconPosition]="iconPosition"
[entityType]="metadataView.entityType"
[entityStyle]="metadataView.entityStyle">{{metadataView.value}}</span>
</a>
<img *ngIf="metadataView.orcidAuthenticated"
placement="top"
ngbTooltip="{{ metadataView.orcidAuthenticated }}"
class="orcid-icon"
alt="orcid-logo"
src="assets/images/orcid.logo.icon.svg"
data-test="orcidIcon"/>
</ng-template>
<ng-template #textWithIcon let-metadataView="metadataView">
<span dsEntityIcon
data-test="textWithIcon"
[iconPosition]="iconPosition"
[entityType]="metadataView.entityType"
[entityStyle]="metadataView.entityStyle"
[fallbackOnDefault]="false">{{normalizeValue(metadataView.value)}}</span>
</ng-template>
<ng-template #textWithoutIcon let-metadataView="metadataView">
<span data-test="textWithoutIcon">{{normalizeValue(metadataView.value)}}</span>
</ng-template>