2017-12-19 13:53:46 +01:00
import { Component , Input } from '@angular/core' ;
2018-09-26 15:56:21 +02:00
import { RouterHelper } from '../../../utils/routerHelper.class' ;
2017-12-19 13:53:46 +01:00
//Usage Example "<publication-title [title]="X" [url]="X" > </publication-title>"
@Component ( {
selector : 'publication-title' ,
template : `
2022-07-05 16:48:28 +02:00
< ng - container * ngIf = "entity.openaireId" >
< h6 class = "uk-margin-remove multi-line-ellipsis lines-2" >
< p class = "uk-margin-remove" >
< a * ngIf = "!externalPortalUrl" [ queryParams ] = " routerHelper.createQueryParam ( param , entity.openaireId ) "
[ routerLink ] = "path" class = "uk-link uk-link-heading" > { { entity . title ? entity . title : "[No title available]" } } < / a >
< a * ngIf = "externalPortalUrl" [ href ] = " externalPortalUrl + path + ' ? ' + param + ' = ' + entity.openaireId " class = "uk-link uk-link-heading custom-external" > { { entity . title ? entity . title : "[No title available]" } } < / a >
< / p >
2022-07-05 15:41:11 +02:00
< / h6 >
< / n g - c o n t a i n e r >
2017-12-19 13:53:46 +01:00
`
} )
export class PublicationTitleFormatter {
2018-09-26 15:56:21 +02:00
@Input ( ) param : string ;
@Input ( ) path : string ;
2019-07-23 14:23:12 +02:00
@Input ( ) entity : any ;
@Input ( ) externalPortalUrl : string = null ;
public routerHelper : RouterHelper = new RouterHelper ( ) ;
2017-12-19 13:53:46 +01:00
}