openaire-library/claims/claim-utils/entityFormatter/publicationTitleFormatter.c...

47 lines
1.6 KiB
TypeScript

import {Component, Input} from '@angular/core';
import {RouterHelper} from '../../../utils/routerHelper.class';
//Usage Example "<publication-title [title]="X" [url]="X" > </publication-title>"
@Component({
selector: 'publication-title',
template: `
<span *ngIf="!externalPortalUrl" class="publication-title">
<span *ngIf="entity.openaireId"><a [queryParams]="routerHelper.createQueryParam(param,entity.openaireId)" routerLinkActive="router-link-active"
[routerLink]="path"> {{entity.title}}</a></span>
<!--span *ngIf="url" class="uk-margin-small-left" ><a target="_blank" href="{{url}}" >
(<span class="custom-external custom-icon" ></span>link)</a></span-->
</span>
<span *ngIf="externalPortalUrl" class="publication-title">
<span *ngIf="entity.openaireId"><a [href]="externalPortalUrl + path+'?'+param+'='+entity.openaireId"> {{entity.title}}</a></span>
</span>
<!-- <div *ngIf="entity.accessRights || entity.bestLicense">-->
<!-- <span class="uk-text-muted">Access mode </span>{{entity.accessRights}} {{entity.bestLicense}}-->
<!-- <span class=" " *ngIf="entity.accessRights == 'EMBARGO' && entity.embargoEndDate"> {{entity.embargoEndDate}}</span>-->
<!-- </div>-->
`
})
export class PublicationTitleFormatter {
// @Input() title: string;
// @Input() url: string;
// @Input() id: string;
@Input() param: string;
@Input() path: string;
@Input() entity: any;
@Input() externalPortalUrl: string = null;
public routerHelper: RouterHelper = new RouterHelper();
constructor() {
}
ngOnInit() {
}
}