openaire-library/searchPages/searchUtils/searchResult.component.html

201 lines
11 KiB
HTML

<ul [class]="'uk-list uk-margin '+custom_class">
<errorMessages [status]="[status]" [type]="'results'"></errorMessages>
<li *ngFor="let result of results" class="uk-animation-fade">
<div class="uk-card uk-card-default uk-padding uk-card-hover">
<!-- Before title -->
<div class="uk-text-small">
<span class="uk-text-capitalize">
{{(result.entityType) ? getTypeName(result.entityType) : getTypeName(type)}}
</span>
<span *ngIf="result.type" class="uk-text-capitalize"> . {{result.type}}</span>
<span *ngIf="properties.environment !== 'production' && result.types &&
removeDuplicates(result.types, (result.entityType) ? getTypeName(result.entityType) : getTypeName(type)).length > 0">
{{' . '}}<highlight [field]="'type'" [keywords]="keywords" [element]="(removeDuplicates(result.types, (result.entityType) ?
getTypeName(result.entityType) : getTypeName(type)).join(' . '))"></highlight>
</span>
<span *ngIf="properties.environment === 'production' && result.types &&
removeUnknown(result.types, (result.entityType) ? getTypeName(result.entityType) : getTypeName(type)).length > 0">
{{' . '}}<highlight [field]="'type'" [keywords]="keywords"
[element]="(removeUnknown(result.types, (result.entityType) ?
getTypeName(result.entityType) : getTypeName(type)).join(' . '))"></highlight>
</span>
<span *ngIf="result.year">{{' . ' + result.year.toString()}}</span>
<span *ngIf="result.startYear && result.endYear"> . {{result.startYear}} - {{result.endYear}}</span>
<span *ngIf="result.embargoEndDate && result.embargoEndDate != ''">
. Embargo End Date: {{result.embargoEndDate | date: 'dd MMM yyyy'}}
</span>
</div>
<!-- Title -->
<div class="uk-h5 uk-margin-remove">
<a [queryParams]="routerHelper.createQueryParam((result.entityType)?queryParamName(result.entityType):urlParam,result.id)"
routerLink="/search/{{(result.entityType)?result.entityType:type}}" class="portal-link">
<div *ngIf="(result.title && result.title.name) || result.acronym">
<span *ngIf="result.acronym">
<highlight [field]="'acronym'" [keywords]="keywords" [element]="result.acronym"></highlight>
</span>
<span *ngIf="result.acronym && (result.title && result.title.name)"> (</span>
<span *ngIf="(result.title && result.title.name)">
<highlight [field]="'title'" [keywords]="keywords" [element]="result.title.name" [html]="true"></highlight>
</span>
<span *ngIf="result.acronym && (result.title && result.title.name)">)</span>
</div>
<div *ngIf="!(result.title && result.title.name) && !result.acronym">
[no title available]
</div>
</a>
</div>
<!-- Authors -->
<div *ngIf="result.authors" class="uk-margin-small-bottom">
<showAuthors [keywords]="keywords" [authors]="result.authors" [authorsLimit]=10 [showAll]=false></showAuthors>
</div>
<!-- Funder -->
<div *ngIf="result.funderShortname || result.code" class="uk-margin-small-bottom uk-text-small">
<span *ngIf="result.funderShortname">
<span class="uk-text-muted">Funder: </span>
<highlight [field]="'funder'" [keywords]="keywords" [element]="result.funderShortname"></highlight>
</span>
<span *ngIf="result.code" [class.uk-margin-left]="result.funderShortname">
<span class="uk-text-muted">Project Code: </span>
<highlight [field]="'code'" [keywords]="keywords" [element]="result.code.toString()"></highlight>
</span>
</div>
<!-- Labels -->
<div class="uk-margin-small-bottom">
<span *ngIf="properties.environment !== 'production' && result.title && result.title.accessMode"
class="uk-label custom-label" [ngClass]="'label-' + accessClass(result.title.accessMode)"
title="Access Mode">
{{result.title.accessMode}}
</span>{{' '}}
<span *ngIf="properties.environment === 'production' && result.title &&
result.title.accessMode && result.title.accessMode.toLowerCase() !== 'not available'"
class="uk-label custom-label" [ngClass]="'label-' + accessClass(result.title.accessMode)"
title="Access Mode">
{{result.title.accessMode}}
</span>{{' '}}
<span *ngIf="result.openAccessMandatePublications && (!result.openAccessMandateDatasets)"
class="uk-label custom-label label-open"
title="Open Access mandate for Publications">
Open Access mandate for Publications
</span>{{' '}}
<span
*ngIf="result.openAccessMandateDatasets != undefined && result.openAccessMandateDatasets && (result.openAccessMandatePublications == undefined || !result.openAccessMandatePublications)"
class="uk-label custom-label label-open " title="Open Access mandate for Research Data">
Open Access mandate for Research Data
</span>{{' '}}
<span
*ngIf="result.openAccessMandatePublications != undefined && result.openAccessMandatePublications && result.openAccessMandateDatasets != undefined && result.openAccessMandateDatasets"
class="uk-label custom-label label-open "
title="Open Access mandate for Publications and Research Data">
Open Access mandate for Publications and Research Data
</span>{{' '}}
<span *ngIf="properties.environment !== 'production' && result.languages && result.languages.length > 0">
<span *ngFor="let language of result.languages" class="uk-label custom-label label-language "
title="Language">
<highlight [field]="'language'" [keywords]="keywords" [element]="language"></highlight>
</span>{{' '}}
</span>
<span
*ngIf="properties.environment === 'production' && result.languages && removeUnknown(result.languages).length > 0">
<span *ngFor="let language of removeUnknown(result.languages)" class="uk-label custom-label label-language "
title="Language">
<highlight [field]="'language'" [keywords]="keywords" [element]="language"></highlight>
</span>{{' '}}
</span>
<span *ngIf="result.title && result.title.sc39" class="uk-label custom-label label-sc39 "
title="Special Clause 39">Special Clause 39
</span>{{' '}}
<span *ngIf="result.compatibility && result.compatibility != ''"
class="uk-label custom-label label-compatibility"
title="Compatibility">
{{result.compatibility}}
</span>{{' '}}
</div>
<!-- Publisher -->
<div *ngIf="result.publisher && result.publisher != ''" class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">Publisher: </span>
<highlight [field]="'publisher'" [keywords]="keywords" [element]="result.publisher"></highlight>
</div>
<!-- Country -->
<div *ngIf="result.countriesForResults && result.countriesForResults.length > 0"
class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">Country: </span>
<highlight [field]="'country'" [keywords]="keywords" [element]="result.countriesForResults.join(', ')"></highlight>
</div>
<div *ngIf="result.country && result.country != ''" class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">Country: </span>
<highlight [field]="'country'" [keywords]="keywords" [element]="result.country"></highlight>
</div>
<div *ngIf="result.countries && result.countries.length > 0" class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">Country: </span><span
*ngFor="let country of result['countries'].slice(0,10) let i = index">
{{country}}{{(i < (result['countries'].slice(0, 10).length - 1)) ? ", " : ""}}
{{(i == result['countries'].slice(0, 10).length - 1 && result['countries'].length > 10) ? "..." : ""}}</span>
</div>
<!-- Programming Languages -->
<div *ngIf="result.programmingLanguages && result.programmingLanguages.length > 0"
class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">Programming language: </span>{{result.programmingLanguages.join(", ")}}
</div>
<!-- Projects -->
<div *ngIf="result.projects && result.projects.length > 0" class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted"> Project: </span>
<span *ngFor="let project of result['projects'].slice(0,10) let i=index">
<span>
{{project['funderShortname'] ? project['funderShortname'] : project['funderName']}}
</span>
<span *ngIf="project.acronym || project.title">
| {{ project['acronym'] ? project['acronym'] : (project['title'].length > 25 ?
project['title'].substring(0, 25) + '...' : project['title'])}}
</span>
<span *ngIf="project.code"> ({{project.code}})</span>
<span *ngIf="i < result['projects'].length-1">,</span>
</span>
<span *ngIf="result['projects'].length > 10">...</span>
</div>
<!-- Organizations -->
<div *ngIf="showOrganizations && result['organizations'] && result['organizations'].length > 0"
class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">Organization: </span>
<span *ngFor="let organization of result['organizations'].slice(0,10) let i=index">
<span>{{organization.name}}</span>
<span *ngIf="(i < result['organizations'].length-1) && (i < 9)">,</span>
</span>
<span *ngIf="result['organizations'].length > 10">...</span>
</div>
<!-- Website URL -->
<div *ngIf="result.websiteURL && result.websiteURL != ''" class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">Website URL: </span>
<span>
<a href="{{result.websiteURL}}" target="_blank" class="custom-external custom-icon">
{{result.websiteURL}}
</a>
</span>
</div>
<!-- OAI-PMH URL-->
<div *ngIf="result.OAIPMHURL && result.OAIPMHURL != ''" class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">OAI-PMH URL: </span>
<span>
<a href="{{result.OAIPMHURL}}" target="_blank" class="custom-external custom-icon">
{{result.OAIPMHURL}}
</a>
</span>
</div>
<!-- Subjects -->
<div *ngIf="showSubjects && result.subjects && result.subjects.length > 0"
class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-muted">Subject: </span>
<span *ngFor="let subject of result.subjects.slice(0,10) let i = index">{{subject}}
{{(i < (result.subjects.slice(0, 10).length - 1)) ? ", " : ""}}
{{(i == result.subjects.slice(0, 10).length - 1 && result.subjects.length > 10) ? "..." : ""}}
</span>
</div>
<!-- Description -->
<div *ngIf="result.description" class="uk-margin-small-bottom multi-line-ellipsis lines-3">
<p class="uk-text-small">
<highlight [field]="'description'" [keywords]="keywords" [element]="result.description"></highlight>
</p>
</div>
</div>
</li>
</ul>