2019-07-23 14:23:12 +02:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {ClaimEntity} from '../../claim-utils/claimHelper.class';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'claim-title',
|
2023-07-04 09:16:08 +02:00
|
|
|
template: `
|
|
|
|
<div class="uk-grid uk-flex uk-flex-middle">
|
|
|
|
<span *ngIf="showIcon" class="uk-flex">
|
|
|
|
<span *ngIf="entity.result" class="material-icons uk-text-small uk-text-meta">
|
|
|
|
insert_drive_file
|
2019-07-23 14:23:12 +02:00
|
|
|
</span>
|
2023-07-04 09:16:08 +02:00
|
|
|
<span *ngIf="entity.project" class="material-icons uk-text-small uk-text-meta">
|
|
|
|
assignment_turned_in
|
2019-07-23 14:23:12 +02:00
|
|
|
</span>
|
2023-07-04 09:16:08 +02:00
|
|
|
<span *ngIf="entity.type=='community'" class="material-icons uk-text-small uk-text-meta" style="margin-right: 2px;">
|
|
|
|
people
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<div class="uk-width-expand multi-line-ellipsis lines-3" style="word-break: break-word;"
|
|
|
|
[class.uk-padding-remove-left]="showIcon" [class.uk-text-truncate]="shortVersion">
|
|
|
|
<div class="uk-margin-remove uk-text-break uk-inline-block"
|
|
|
|
[class.uk-h6]="!shortVersion" [class.uk-text-bold]="shortVersion">
|
|
|
|
<a *ngIf="entity.result && entity.result.url" target="_blank" [href]="entity.result.url"
|
|
|
|
class="uk-link uk-text-decoration-none uk-width-expand">
|
|
|
|
{{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">
|
|
|
|
<a *ngIf="entity.project && entity.project.url" target="_blank" [href]="entity.project.url"
|
|
|
|
class="uk-link uk-text-decoration-none uk-width-expand">
|
|
|
|
<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)">
|
|
|
|
<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>
|
|
|
|
</span>
|
|
|
|
</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>
|
|
|
|
</div>
|
2022-03-16 17:54:22 +01:00
|
|
|
</div>
|
2023-07-04 09:16: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() {
|
|
|
|
}
|
2023-07-04 09:16:08 +02:00
|
|
|
|
2019-07-23 14:23:12 +02:00
|
|
|
sliceString(mystr:string): string {
|
2023-07-04 09:16:08 +02:00
|
|
|
if(this.slice){
|
2022-04-05 17:36:08 +02:00
|
|
|
// return StringUtils.sliceString(mystr,this.sliceSize);
|
2023-07-04 09:16:08 +02:00
|
|
|
}
|
|
|
|
return mystr;
|
2019-07-23 14:23:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|