86 lines
3.5 KiB
TypeScript
86 lines
3.5 KiB
TypeScript
import {Component, Input,Output} from '@angular/core';
|
|
import {PublicationTitleFormatter} from '../../common/publicationTitleFormatter.component';
|
|
@Component({
|
|
selector: 'claim-selected',
|
|
template: `
|
|
<div *ngIf="publications.length > 0 " class="publications" >
|
|
<h5>Selected Publications:</h5>
|
|
<i *ngFor="let pub of publications" >Source: {{pub.source}} - Title: <publication-title [title]="pub.title" [url]="pub.url" > </publication-title>
|
|
<p *ngIf="showAccessRights== 'true'" >
|
|
<select [(ngModel)]="pub.accessRights">
|
|
<option *ngFor="let type of accessTypes" [value]="type">{{type}}</option>
|
|
</select>
|
|
<!--<div class="dropdown">
|
|
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
|
{{pub.accessRights}}
|
|
<span class="caret"></span>
|
|
</button>
|
|
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
|
|
<li *ngFor="let type of accessTypes" ><a href="#" (click)="pub.accessRights = type " >{{type}} </a></li>
|
|
</ul>
|
|
</div>-->
|
|
</p>
|
|
</i>
|
|
</div>
|
|
<div *ngIf="contexts.length > 0 " class="concepts" >
|
|
<ul class="list-group">
|
|
<li class="list-group-item list-group-item-success">Selected Concepts:</li>
|
|
<li class="list-group-item" *ngFor="let context of contexts" >{{context.community}} - Category: {{context.category}} </li>
|
|
</ul>
|
|
</div>
|
|
<div *ngIf="projects.length > 0 " class="conprojectscepts" >
|
|
<ul class="list-group">
|
|
<li class="list-group-item list-group-item-info">Selected Projects</li>
|
|
<li class="list-group-item" *ngFor="let project of projects">
|
|
<span class="glyphicons glyphicons-remove"></span>
|
|
{{project.projectAcronym}} - {{project.projectName}}
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div *ngIf="datasets.length > 0 " class="datasets" >
|
|
<h5>Selected datasets:</h5>
|
|
<i *ngFor="let dataset of datasets" > Datasets: Source: {{dataset.source}} - Title: <publication-title [title]="dataset.title" [url]="dataset.url" > </publication-title> </i>
|
|
</div>
|
|
<div *ngIf="projects.length == 0 " class="conprojectscepts" >
|
|
<ul class="list-group">
|
|
<li class="list-group-item list-group-item-info">Selected Projects:</li>
|
|
<li class="list-group-item">Please use the form on the left to select a project</li>
|
|
</ul>
|
|
</div>
|
|
<div *ngIf="contexts.length == 0 " class="concepts" >
|
|
<ul class="list-group">
|
|
<li class="list-group-item list-group-item-success">Selected Concepts:</li>
|
|
<li class="list-group-item">Please use the form on the left to select a concept</li>
|
|
</ul>
|
|
</div>
|
|
<!-- KI <i>TODO: add more types</i> -->
|
|
`,
|
|
directives: [ PublicationTitleFormatter]
|
|
|
|
|
|
})
|
|
export class ClaimSelectedComponent {
|
|
ngOnInit() {
|
|
console.info("Show accessRights selection? :"+this.showAccessRights);
|
|
}
|
|
|
|
|
|
@Input() contexts=[];
|
|
@Input() projects=[];
|
|
@Input() publications=[];
|
|
@Input() datasets=[];
|
|
@Input() showAccessRights=false;
|
|
|
|
|
|
accessTypes = ["OPEN","CLOSED","EMBARGO","RESTRICTED"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|