1
|
import {Component, Input} from '@angular/core';
|
2
|
|
3
|
import { SearchProjectsComponent } from '../../searchPages/simple/searchProjects.component';
|
4
|
import {SearchResultComponent} from '../../searchPages/searchUtils/searchResult.component';
|
5
|
|
6
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
7
|
|
8
|
@Component({
|
9
|
selector: 'projectsTab',
|
10
|
template: `
|
11
|
<div *ngIf="searchProjectsComponent.searchUtils.totalResults == 0" class = "alert alert-info " >
|
12
|
There are no projects
|
13
|
</div>
|
14
|
|
15
|
<div *ngIf="searchProjectsComponent.searchUtils.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 = "searchProjectsComponent.searchUtils.totalResults > 10" ><a [href] = "linkToSearchProjects" >View all {{searchProjectsComponent.searchUtils.totalResults}} results</a></div>
|
22
|
<search-result [(results)]="searchProjectsComponent.results" [(status)]= "searchProjectsComponent.status"></search-result>
|
23
|
</div>
|
24
|
`
|
25
|
})
|
26
|
|
27
|
export class ProjectsTabComponent {
|
28
|
|
29
|
@Input() paramsForSearchLink: string = "";
|
30
|
@Input() searchProjectsComponent : SearchProjectsComponent;
|
31
|
public linkToSearchProjects = "";
|
32
|
|
33
|
constructor () {}
|
34
|
|
35
|
ngOnInit() {
|
36
|
this.linkToSearchProjects = OpenaireProperties.getLinkToAdvancedSearchProjects()+this.paramsForSearchLink;
|
37
|
}
|
38
|
|
39
|
ngOnDestroy() {}
|
40
|
}
|