59 lines
2.1 KiB
TypeScript
59 lines
2.1 KiB
TypeScript
import {Component, Input} from '@angular/core';
|
|
import {Router, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
|
|
|
|
|
|
@Component({
|
|
selector: 'tabTable',
|
|
template: `
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Title</th>
|
|
<th>Trust</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr *ngFor="let item of info" class="{{item['class']}}">
|
|
<td *ngIf="item != undefined">
|
|
<span *ngIf="item['class'] == 'dataset'" class="glyphicon glyphicon-star" aria-hidden="true">
|
|
|
|
</span>
|
|
<a *ngIf="item['url'] != '' && item['name'] != ''" class="custom-external" href="{{item['url']}}" target="_blank">
|
|
{{item['name']}}
|
|
</a>
|
|
<p *ngIf="item['url'] == '' && item['name'] != ''">{{item['name']}}</p>
|
|
<span *ngIf="item['date'] != ''">
|
|
({{item['date']}})
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<div *ngIf="item['trust'] != ''" class="progress">
|
|
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="29" aria-valuemin="0" aria-valuemax="100" [style.width] = "item['trust']">
|
|
{{item['trust']}}
|
|
</div>
|
|
</div>
|
|
<div *ngIf="item['trust'] == ''">
|
|
<p>no trust found</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
`
|
|
,
|
|
directives: [
|
|
...ROUTER_DIRECTIVES
|
|
]
|
|
})
|
|
|
|
export class TabTableComponent {
|
|
@Input() info: { "name": string, "url": string, "date": string, "trust": string}[];//Map<string, string[]>;
|
|
|
|
constructor (private _router: Router) {
|
|
console.info('tabTable constructor');
|
|
}
|
|
|
|
ngOnInit() {
|
|
}
|
|
}
|