1
|
import {Component, Input} from '@angular/core';
|
2
|
|
3
|
import { SearchPublicationsComponent } from '../../searchPages/searchPublications.component';
|
4
|
import {SearchResultComponent} from '../../searchPages/searchUtils/searchResult.component';
|
5
|
|
6
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
7
|
|
8
|
@Component({
|
9
|
selector: 'publicationsTab',
|
10
|
template: `
|
11
|
<div *ngIf="searchPublicationsComponent.totalResults == 0" class = "alert alert-info " >
|
12
|
There are no publications
|
13
|
</div>
|
14
|
|
15
|
<div *ngIf="searchPublicationsComponent.totalResults > 0">
|
16
|
<p>
|
17
|
The results below are discovered through our pilot algorithms.
|
18
|
<a href="mailto:">Let us know how we are doing!</a>
|
19
|
</p>
|
20
|
|
21
|
<div class = "text-right" *ngIf = "searchPublicationsComponent.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{searchPublicationsComponent.totalResults}} results</a></div>
|
22
|
<search-result [(results)]="searchPublicationsComponent.results" [(status)]= "searchPublicationsComponent.status"></search-result>
|
23
|
</div>
|
24
|
`
|
25
|
})
|
26
|
|
27
|
export class PublicationsTabComponent {
|
28
|
@Input() paramsForSearchLink: string = "";
|
29
|
@Input() searchPublicationsComponent : SearchPublicationsComponent;
|
30
|
private linkToSearchPublications = "";
|
31
|
|
32
|
constructor () {}
|
33
|
|
34
|
ngOnInit() {
|
35
|
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications()+this.paramsForSearchLink;
|
36
|
}
|
37
|
|
38
|
ngOnDestroy() {}
|
39
|
}
|