linking: results to match search results and community: whole card to be a pointer

This commit is contained in:
Alex Martzios 2022-05-19 13:12:59 +03:00
parent 1a7571593e
commit 8a5d5d954a
5 changed files with 35 additions and 44 deletions

View File

@ -11,7 +11,7 @@
<div *ngIf="communities" class=" uk-padding uk-grid uk-child-width-1-3 uk-grid-small uk-grid-match"
uk-grid >
<ng-container *ngFor="let community of filter()">
<div class="uk-padding-small uk-link-reset community-card " (click)="select(community.id, community.label)">
<a class="uk-padding-small uk-link-reset community-card " (click)="select(community.id, community.label)">
<div [title]="(this.results.length>=basketLimit)?'Basket reached the size limit':''"
class="uk-card uk-card-default uk-card-hover uk-padding-small uk-text-center " >
<div class="uk-text-right" >
@ -48,7 +48,7 @@
</div>
</div>
</div>
</a>
</ng-container>
</div>

View File

@ -8,9 +8,9 @@ declare var UIkit: any;
template: `
<div *ngIf="results.length > 0 " class="uk-margin-top">
<div *ngFor=" let entity of results " [class]="(isSelected(entity))?'uk-block-muted':''" class=" uk-card uk-card-default uk-padding uk-margin-bottom claim-result-card">
<div *ngFor=" let entity of results " [class]="(isSelected(entity))?'uk-block-muted':''" class=" uk-card uk-card-default uk-card-body uk-margin-bottom claim-result-card">
<div>
<div class="uk-text-small">
<div class="uk-text-small uk-margin-small-bottom">
{{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}
</div>
<div class="uk-grid">

View File

@ -3,23 +3,17 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
@Component({
selector: 'claim-project-metadata',
template:
`
<div *ngIf="entity.type == 'project' && entity.project" class="uk-grid uk-margin-remove-top uk-text-small">
<div class="uk-width-1-2">
<div *ngIf="entity.project.funderName">
<span class="uk-text-meta uk-margin-small-right">Funder: </span>{{entity.project.funderName}}
</div>
<div *ngIf="entity.project.code">
<span class="uk-text-meta uk-margin-small-right">GrandID: </span>{{entity.project.code}}
</div>
</div>
<div class="uk-width-1-2">
<div *ngIf=" !shortVersion && (entity.project.startDate || entity.project.endDate)">
<span
class="uk-text-meta uk-margin-small-right">Duration: </span>{{(entity.project.startDate) ? entity.project.startDate : 'Unknown'}}{{'-' + ((entity.project.endDate) ? entity.project.endDate : 'Unknown')}}
</div>
</div>
template: `
<div *ngIf="entity.type == 'project' && entity.project" class="uk-text-small uk-flex uk-flex-wrap" style="grid-gap: 20px;">
<div *ngIf="entity.project.funderName">
<span class="uk-text-meta">Funder: </span>{{entity.project.funderName}}
</div>
<div *ngIf="entity.project.code">
<span class="uk-text-meta">GrandID: </span>{{entity.project.code}}
</div>
<div *ngIf=" !shortVersion && (entity.project.startDate || entity.project.endDate)">
<span class="uk-text-meta">Duration: </span>{{(entity.project.startDate) ? entity.project.startDate : 'Unknown'}}{{'-' + ((entity.project.endDate) ? entity.project.endDate : 'Unknown')}}
</div>
</div>
`

View File

@ -3,30 +3,27 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
@Component({
selector: 'claim-result-metadata',
template:
`
<div *ngIf="entity.result">
<div *ngIf="entity.result.authors && entity.result.authors.length >0 " class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-meta uk-margin-small-right">Authors: </span>
{{sliceArray(entity.result.authors)}}
template: `
<div *ngIf="entity.result" class="uk-text-small">
<div *ngIf="entity.result.authors && entity.result.authors.length >0 " class="uk-margin-small-bottom">
<span class="uk-text-meta">Authors: </span>{{sliceArray(entity.result.authors)}}
</div>
<div *ngIf="!shortVersion && entity.result.editors&& entity.result.editors.length > 0" class="uk-text-small uk-margin-small-bottom">
<span class="uk-text-meta uk-margin-small-right">Editors: </span>
{{sliceArray(entity.result.editors)}}
<div *ngIf="!shortVersion && entity.result.editors&& entity.result.editors.length > 0" class="uk-margin-small-bottom">
<span class="uk-text-meta">Editors: </span>{{sliceArray(entity.result.editors)}}
</div>
<div *ngIf="!shortVersion" class="uk-grid uk-margin-remove uk-text-small">
<div class="uk-width-1-2 uk-padding-remove-left ">
<span *ngIf="entity.result.publisher!=null"><span
class="uk-text-meta uk-margin-small-right uk-margin-small-bottom">Publisher: </span> {{entity.result.publisher}}</span>
<span *ngIf="entity.result.journal!=null"><span
class="uk-text-meta uk-margin-small-right uk-margin-small-bottom">Journal: </span> {{entity.result.journal}}</span>
</div>
<div class="uk-width-1-2">
<span *ngIf="entity.result.date"><span class="uk-text-meta uk-margin-small-right uk-margin-small-bottom">Published: </span> <span
[class]="(getProjectDurationMessage(entity)?'uk-text-warning':'')">{{entity.result.date}}</span></span>
<div [class]="(getProjectDurationMessage(entity)?'uk-text-warning':'')">{{getProjectDurationMessage(entity)}}
</div>
</div>
<div *ngIf="!shortVersion" class="uk-flex uk-flex-wrap" style="grid-gap: 20px;">
<span *ngIf="entity.result.publisher!=null">
<span class="uk-text-meta uk-margin-small-bottom">Publisher: </span>{{entity.result.publisher}}
</span>
<span *ngIf="entity.result.journal!=null">
<span class="uk-text-meta uk-margin-small-bottom">Journal: </span>{{entity.result.journal}}
</span>
<span *ngIf="entity.result.date">
<span class="uk-text-meta uk-margin-small-bottom">Published: </span>
<span [class]="(getProjectDurationMessage(entity)?'uk-text-warning':'')">{{entity.result.date}}</span>
</span>
<div [class]="(getProjectDurationMessage(entity)?'uk-text-warning':'')">{{getProjectDurationMessage(entity)}}
</div>
</div>
</div>
`

View File

@ -9,7 +9,7 @@ import {StringUtils} from "../../../utils/string-utils.class";
<div class="uk-grid uk-flex uk-flex-middle">
<div class="uk-width-expand " style="word-break: break-word;" [class.uk-h6]="!shortVersion" [class.uk-text-bold]="shortVersion" [class.uk-text-truncate]="shortVersion" [class.uk-margin-bottom]="!shortVersion" [class.uk-margin-small-bottom]="shortVersion">
<a *ngIf="entity.result && entity.result.url" target="_blank" [href]="entity.result.url"
class="uk-text-link">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</a>
class="uk-link uk-link-heading">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</a>
<span
*ngIf="(entity.result && !entity.result.url)">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</span>
<span *ngIf="entity.type=='project' && entity.project">