Project

General

Profile

1
import {Component, Input} from '@angular/core';
2
import {RouterHelper} from '../../../utils/routerHelper.class';
3

    
4
//Usage Example "<publication-title [title]="X" [url]="X" > </publication-title>"
5

    
6
@Component({
7
  selector: 'publication-title',
8
  template: `
9
    <span *ngIf="!externalPortalUrl" class="publication-title uk-text-large">
10

    
11
     <span *ngIf="entity.openaireId"><a [queryParams]="routerHelper.createQueryParam(param,entity.openaireId)" routerLinkActive="router-link-active"
12
                         [routerLink]="path">  {{entity.title?entity.title:"[No title available]"}}</a></span>
13
      <!--span *ngIf="url" class="uk-margin-small-left" ><a target="_blank" href="{{url}}" >
14
      (<span class="custom-external custom-icon" ></span>link)</a></span-->
15
   </span>
16
    <span *ngIf="externalPortalUrl" class="publication-title uk-text-large">
17

    
18
      <span *ngIf="entity.openaireId"><a [href]="externalPortalUrl + path+'?'+param+'='+entity.openaireId">  {{entity.title}}</a></span>
19
    </span>
20
    
21
<!--    <div *ngIf="entity.accessRights || entity.bestLicense">-->
22
<!--      <span class="uk-text-muted">Access mode </span>{{entity.accessRights}} {{entity.bestLicense}}-->
23
<!--      <span class=" " *ngIf="entity.accessRights == 'EMBARGO' && entity.embargoEndDate"> {{entity.embargoEndDate}}</span>-->
24
<!--    </div>-->
25
  `
26
})
27

    
28
export class PublicationTitleFormatter {
29
  // @Input() title: string;
30
  // @Input() url: string;
31
  // @Input() id: string;
32
  @Input() param: string;
33
  @Input() path: string;
34
  @Input() entity: any;
35
  @Input() externalPortalUrl: string = null;
36
  public routerHelper: RouterHelper = new RouterHelper();
37

    
38
  constructor() {
39
  }
40

    
41
  ngOnInit() {
42

    
43
  }
44

    
45

    
46
}
(4-4/4)