1 |
55570
|
argiro.kok
|
import {Component, Input} from '@angular/core';
|
2 |
|
|
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
3 |
50169
|
argiro.kok
|
|
4 |
|
|
@Component({
|
5 |
|
|
selector: 'availableOn',
|
6 |
|
|
template: `
|
7 |
|
|
<dl class="uk-description-list-line">
|
8 |
52769
|
argiro.kok
|
<dt class="sideInfoTitle ">Download from</dt>
|
9 |
52060
|
konstantin
|
<dd class="line" *ngFor="let available of availableOn.slice(0, showNum) let i=index" >
|
10 |
|
|
<div>
|
11 |
52606
|
konstantin
|
<!--div class="{{available['bestAccessMode']}}"-->
|
12 |
|
|
<div [class]="available['bestAccessMode'] ? available['bestAccessMode'] : 'UNKNOWN ACCESSMODE'">
|
13 |
50169
|
argiro.kok
|
<span *ngIf="available.downloadUrl.length > 1"
|
14 |
|
|
class="custom-external custom-icon">
|
15 |
|
|
{{available.downloadName}}
|
16 |
|
|
<span *ngFor="let url of available.downloadUrl; let i=index;">
|
17 |
|
|
<a href="{{url}}" target="_blank"
|
18 |
52606
|
konstantin
|
|
19 |
|
|
attr.uk-tooltip="pos:right; delay:10"
|
20 |
|
|
[title]="available.accessMode[i] ? available.accessMode[i] : 'UNKNOWN ACCESSMODE'">
|
21 |
52096
|
konstantin
|
[{{(i+1) | number}}]
|
22 |
50169
|
argiro.kok
|
</a>
|
23 |
|
|
</span>
|
24 |
|
|
</span>
|
25 |
|
|
<a class="custom-external custom-icon"
|
26 |
|
|
*ngIf="available['downloadUrl'].length == 1"
|
27 |
|
|
href="{{available['downloadUrl']}}"
|
28 |
|
|
target="_blank"
|
29 |
52606
|
konstantin
|
|
30 |
|
|
attr.uk-tooltip="pos:right; delay:10"
|
31 |
|
|
[title]="available.bestAccessMode ? available.bestAccessMode : 'UNKNOWN ACCESSMODE'">
|
32 |
50169
|
argiro.kok
|
{{available.downloadName}}
|
33 |
|
|
</a>
|
34 |
|
|
<span *ngIf="available.collectedName" class="uk-text-bold">via</span>
|
35 |
|
|
<a *ngIf="available.collectedName"
|
36 |
|
|
[queryParams]="{datasourceId: available.collectedId}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
|
37 |
|
|
{{available.collectedName}}
|
38 |
|
|
</a>
|
39 |
50728
|
konstantin
|
<span *ngIf="available.type || available.year">(<span *ngIf="available.type">{{available.type}}<span *ngIf="available.year">, </span></span><span *ngIf="available.year">{{available.year}}</span>)</span>
|
40 |
50169
|
argiro.kok
|
</div>
|
41 |
|
|
</div>
|
42 |
|
|
</dd>
|
43 |
|
|
</dl>
|
44 |
52060
|
konstantin
|
|
45 |
|
|
<div *ngIf="showNum > threshold" class="uk-text-right">
|
46 |
|
|
<a (click)="showNum = threshold; scroll()">
|
47 |
|
|
View less
|
48 |
|
|
</a>
|
49 |
|
|
</div>
|
50 |
|
|
<div *ngIf="showNum == threshold && availableOn && availableOn.length > 5">...</div>
|
51 |
|
|
<div *ngIf="showNum == threshold && availableOn && availableOn.length > 5" class="uk-text-right">
|
52 |
|
|
<a (click)="showNum = availableOn.length;">
|
53 |
|
|
View more
|
54 |
|
|
</a>
|
55 |
|
|
</div>
|
56 |
50169
|
argiro.kok
|
`
|
57 |
|
|
})
|
58 |
|
|
|
59 |
|
|
export class AvailableOnComponent {
|
60 |
|
|
@Input() availableOn: { "downloadName": string, "downloadUrl": string[],
|
61 |
|
|
"collectedName": string, "collectedId": string,
|
62 |
|
|
"accessMode": string[], "bestAccessMode": string,
|
63 |
|
|
"type": string, "year":string }[];
|
64 |
|
|
|
65 |
52060
|
konstantin
|
public threshold: number = 5;
|
66 |
|
|
public showNum: number = 5;
|
67 |
50169
|
argiro.kok
|
|
68 |
55570
|
argiro.kok
|
constructor () {}
|
69 |
50169
|
argiro.kok
|
|
70 |
|
|
ngOnInit() {}
|
71 |
|
|
|
72 |
|
|
public scroll() {
|
73 |
55570
|
argiro.kok
|
HelperFunctions.scroll();
|
74 |
50169
|
argiro.kok
|
}
|
75 |
|
|
}
|