Project

General

Profile

1
import {Component, Input} from '@angular/core';
2

    
3
@Component({
4
    selector: 'showDataProviders',
5
    template: `
6

    
7
        <div *ngIf="dataProviders == undefined" class = "alert alert-info ">
8
            There are no data providers
9
        </div>
10
        <div *ngIf="dataProviders != undefined">
11

    
12
            <div role="separator" class="divider" *ngFor="let item of dataProviders">
13
                <p *ngIf="item['url'] != undefined && item['url']">
14
                    <a href="{{item['url']}}" target="_blank" class="custom-external custom-icon">
15
                        {{item['name']}}
16
                    </a>
17
                </p>
18
                <p *ngIf="item['url'] == undefined || item['url'] == ''">
19
                    {{item['name']}}
20
                </p>
21

    
22
                <p>
23
                    <span *ngFor="let item of dataProviders.organizations">
24
                        <a *ngIf="item['url']!=''" href="{{item['url']}}" target="_blank"
25
                            class="custom-external custom-icon">
26
                            {{item['name']}}
27
                        </a>
28
                        <p *ngIf="item['url']==''">
29
                            {{item['name']}}
30
                        </p>
31
                    </span>
32
                </p>
33

    
34

    
35
                <p *ngIf="item['type'] != undefined && item['type'] != ''">
36
                    Type: {{item['type']}}
37
                </p>
38

    
39
                <p *ngIf="item['websiteUrl'] != null && item['websiteUrl'] != ''">
40
                    Website URL:
41
                    <a href="{{item['websiteUrl']}}" target="_blank"
42
                        class="custom-external custom-icon">
43
                        {{item['websiteUrl']}}
44
                    </a>
45
                </p>
46
                <hr>
47
            </div>
48
        </div>
49
    `
50
})
51

    
52
// Possibly should be deleted. Not used anywhere.
53
export class ShowDataProvidersComponent {
54
@Input() dataProviders: { "name": string, "url": string, "type": string, "websiteUrl": string,
55
                    "organizations": {"name": string, "url": string}[]}[];
56

    
57
constructor () {
58
}
59

    
60
ngOnInit() {}
61
}
(12-12/13)