2019-07-23 14:23:12 +02:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {ClaimEntity} from '../../claim-utils/claimHelper.class';
|
|
|
|
import {StringUtils} from "../../../utils/string-utils.class";
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'claim-title',
|
|
|
|
template:
|
|
|
|
`
|
2022-04-05 17:36:08 +02:00
|
|
|
<div class="uk-grid uk-flex uk-flex-middle">
|
2022-06-06 16:35:26 +02:00
|
|
|
<span *ngIf="showIcon" >
|
|
|
|
<span *ngIf=" entity.result" class="material-icons uk-text-small uk-text-meta" >insert_drive_file
|
|
|
|
</span>
|
|
|
|
<span *ngIf=" entity.project"
|
|
|
|
class="material-icons uk-text-small uk-text-meta">assignment_turned_in
|
|
|
|
</span>
|
|
|
|
<span *ngIf="entity.type=='community'" style="margin-right: 2px;"
|
|
|
|
class="material-icons uk-text-small uk-text-meta">people
|
|
|
|
</span></span>
|
|
|
|
<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-padding-remove-left]="showIcon">
|
|
|
|
|
2022-04-05 17:36:08 +02:00
|
|
|
<a *ngIf="entity.result && entity.result.url" target="_blank" [href]="entity.result.url"
|
2022-05-19 12:12:59 +02:00
|
|
|
class="uk-link uk-link-heading">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</a>
|
2019-07-23 14:23:12 +02:00
|
|
|
<span
|
|
|
|
*ngIf="(entity.result && !entity.result.url)">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</span>
|
|
|
|
<span *ngIf="entity.type=='project' && entity.project">
|
2019-10-16 12:18:32 +02:00
|
|
|
<a *ngIf="entity.project && entity.project.url" target="_blank" [href]="entity.project.url"
|
2022-04-05 17:36:08 +02:00
|
|
|
class="uk-text-link">
|
2019-10-16 12:18:32 +02:00
|
|
|
<span *ngIf="!shortVersion">
|
|
|
|
{{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}}
|
|
|
|
</span>
|
|
|
|
<span *ngIf="shortVersion">
|
|
|
|
{{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}}
|
|
|
|
</span>
|
|
|
|
</a>
|
|
|
|
<span
|
|
|
|
*ngIf="(entity.project && !entity.project.url)">
|
2019-07-23 14:23:12 +02:00
|
|
|
<span *ngIf="!shortVersion">
|
|
|
|
{{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}}
|
|
|
|
</span>
|
|
|
|
<span *ngIf="shortVersion">
|
|
|
|
{{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}}
|
|
|
|
</span>
|
2019-10-16 12:18:32 +02:00
|
|
|
</span>
|
|
|
|
|
2019-07-23 14:23:12 +02:00
|
|
|
|
|
|
|
</span>
|
|
|
|
<span *ngIf="entity.type=='community' && entity.context">
|
|
|
|
<span *ngIf=" entity.context.community != entity.context.concept.label">
|
|
|
|
{{entity.context.community }} > {{entity.context.category}} >
|
|
|
|
</span>
|
|
|
|
<span> {{entity.context.concept.label}}</span>
|
|
|
|
</span>
|
2022-03-16 17:54:22 +01:00
|
|
|
</div>
|
2022-04-05 17:36:08 +02:00
|
|
|
</div>
|
2019-07-23 14:23:12 +02:00
|
|
|
`
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
export class ClaimEntityTitleComponent {
|
|
|
|
|
|
|
|
|
|
|
|
@Input() entity: ClaimEntity;
|
|
|
|
@Input() slice:boolean = false;
|
|
|
|
@Input() sliceSize:number = 45;
|
|
|
|
@Input() shortVersion: boolean = false;
|
2022-06-06 16:35:26 +02:00
|
|
|
@Input() showIcon: boolean = false;
|
2019-07-23 14:23:12 +02:00
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
sliceString(mystr:string): string {
|
|
|
|
if(this.slice){
|
2022-04-05 17:36:08 +02:00
|
|
|
// return StringUtils.sliceString(mystr,this.sliceSize);
|
2019-07-23 14:23:12 +02:00
|
|
|
}
|
|
|
|
return mystr;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|