2017-12-19 13:53:46 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {RouterHelper} from '../../../utils/routerHelper.class';
|
2020-07-13 16:42:34 +02:00
|
|
|
import {properties} from "../../../../../environments/environment";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
//Usage Example "<project-title [project]="X" > </project-title>"
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'project-title',
|
|
|
|
template: `
|
2022-07-05 16:48:28 +02:00
|
|
|
<ng-container>
|
|
|
|
<h6 class="uk-margin-remove multi-line-ellipsis lines-2">
|
|
|
|
<p class="uk-margin-remove">
|
2024-05-10 10:34:17 +02:00
|
|
|
<a *ngIf="externalPortalUrl" [href]="externalPortalUrl + projectUrl + '?projectId='+project['openaireId']" class="uk-link uk-link-heading" [class.uk-disabled]="project.name == 'unidentified'">
|
2024-09-04 08:46:37 +02:00
|
|
|
<span *ngIf="project['code'] != 'unidentified'">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</span>
|
|
|
|
<span *ngIf="project['code'] == 'unidentified'">{{project['funderName']}}</span>
|
2022-07-05 16:48:28 +02:00
|
|
|
</a>
|
2024-05-10 10:34:17 +02:00
|
|
|
<a *ngIf="!externalPortalUrl" [routerLink]="projectUrl" [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])" class="uk-link uk-link-heading" [class.uk-disabled]="project.name == 'unidentified'">
|
2024-09-04 08:46:37 +02:00
|
|
|
<span *ngIf="project['code'] != 'unidentified'">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</span>
|
|
|
|
<span *ngIf="project['code'] == 'unidentified'">{{project['funderName']}} </span>
|
2022-07-05 16:48:28 +02:00
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</h6>
|
|
|
|
</ng-container>
|
2024-09-04 08:46:37 +02:00
|
|
|
<span *ngIf="project['funderName'] && project['code'] != 'unidentified'" class="uk-margin-small-top">
|
2024-03-28 12:07:11 +01:00
|
|
|
<span class="uk-text-meta">Funder: </span>{{project['funderName']}}
|
2021-02-10 11:24:52 +01:00
|
|
|
</span>
|
2017-12-19 13:53:46 +01:00
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class ProjectTitleFormatter {
|
2022-07-05 16:48:28 +02:00
|
|
|
@Input() project: any;
|
2018-02-05 14:14:59 +01:00
|
|
|
@Input() searchLink: string;
|
2019-07-23 14:23:12 +02:00
|
|
|
@Input() externalPortalUrl: string = null;
|
|
|
|
public url: string;
|
|
|
|
public routerHelper: RouterHelper = new RouterHelper();
|
2020-07-13 16:42:34 +02:00
|
|
|
public projectUrl = properties.searchLinkToProject.split('?')[0];
|
2019-07-23 14:23:12 +02:00
|
|
|
|
|
|
|
constructor() {
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
ngOnInit() {
|
2019-07-23 14:23:12 +02:00
|
|
|
this.url = this.searchLink + "?projectId=" + this.project["openaireId"];
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
}
|