more pages in pub landing page - inline claiming

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@43110 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2016-07-03 20:43:40 +00:00
parent 3ea5df83cb
commit 5baa174165
4 changed files with 55 additions and 24 deletions

View File

@ -46,7 +46,7 @@ import 'rxjs/Rx';
<li class="active"><a [routerLink]=" ['/Search']" >Search <span class="sr-only">(current)</span></a></li> <li class="active"><a [routerLink]=" ['/Search']" >Search <span class="sr-only">(current)</span></a></li>
<li><a [routerLink]=" ['/Claims']">Claims</a></li> <li><a [routerLink]=" ['/Claims']">Claims</a></li>
<li><a [routerLink]=" ['/Linking']">Linking</a></li> <li><a [routerLink]=" ['/Linking']">Linking</a></li>
<li><a [routerLink]=" ['/Home']">Home</a></li> <!-- <li><a [routerLink]=" ['/Home']">Home</a></li>-->
<li><a [routerLink]=" ['/MyClaims']">My claims</a></li> <li><a [routerLink]=" ['/MyClaims']">My claims</a></li>
</ul> </ul>

View File

@ -64,7 +64,7 @@ import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component
publications; publications;
datasets; datasets;
private show = 'context'; private show = 'context';
private showComp:string = 'false'; private showComp:string = 'true';
private enableButton:boolean=true; private enableButton:boolean=true;
keyword: string = ""; keyword: string = "";

View File

@ -18,7 +18,7 @@ import {Component, Input,Output, EventEmitter} from '@angular/core';
<div *ngIf=" inlineType == 'project' " class="project" > <div *ngIf=" inlineType == 'project' " class="project" >
<a *ngIf="inlineEntity[0].url" target="_blank" href="{{inlineEntity[0].url}}" >{{inlineEntity[0].title}}</a> <a *ngIf="inlineEntity[0].url" target="_blank" href="{{inlineEntity[0].url}}" >{{inlineEntity[0].title}}</a>
<span *ngIf="!inlineEntity[0].url" >{{inlineEntity[0].title}}</span> <span *ngIf="!inlineEntity[0].url" >{{inlineEntity[0].title}}</span>
<span >{{inlineEntity[0].funderName}} | {{inlineEntity[0].projectName}} {{(inlineEntity[0].projectAcronym)?'('+inlineEntity[0].projectAcronym+')':''}}</span> <span >{{inlineEntity[0].funderName}} | {{(inlineEntity[0].projectAcronym)?inlineEntity[0].projectAcronym: inlineEntity[0].projectName}}</span>
</div> </div>
<div>Link to </div> <div>Link to </div>
</div> --> </div> -->

View File

@ -11,15 +11,18 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
//directives: [...ROUTER_DIRECTIVES], //directives: [...ROUTER_DIRECTIVES],
template: ` template: `
<div *ngIf="publicationInfo != null"> <div >
<div class="container publication"> <div class="container publication">
<div class="container-header"> <div class="container-header" >
<h2>{{publicationInfo.title}}</h2> <h2 *ngIf="publicationInfo != null" >{{publicationInfo.title}}</h2 >
</div> <div *ngIf="warningMessage.length > 0" class="alert alert-warning" role="alert">{{warningMessage}}</div>
<div class="row row-offcanvas row-offcanvas-right"> <div *ngIf="errorMessage.length > 0" class="alert alert-danger" role="alert">{{errorMessage}}</div>
<div class="col-xs-6 col-sm-9 sidebar-offcanvas"> </div>
<div class="row row-offcanvas row-offcanvas-right" >
<div class="col-xs-6 col-sm-9 sidebar-offcanvas" *ngIf="publicationInfo != null">
<p> <p>
{{publicationInfo.authors}} ({{publicationInfo.date}}) {{publicationInfo.authors}} ({{publicationInfo.date}})
</p> </p>
@ -171,7 +174,7 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
</div> </div>
</div> </div>
<div class="col-xs-12 col-sm-3"> <div class="col-xs-12 col-sm-3" *ngIf="publicationInfo != null">
<ul class="list-group mainFunctionsBlock"> <ul class="list-group mainFunctionsBlock">
<li class="list-group-item"> <li class="list-group-item">
@ -200,17 +203,29 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
<dl class="functionsSection" *ngIf="publicationInfo.fundedByProjects != undefined"> <dl class="functionsSection" *ngIf="publicationInfo.fundedByProjects != undefined">
<dt class="title">Funded By</dt> <dt class="title">Funded By</dt>
<dd class="line" *ngFor="let key of publicationInfo.fundedByProjects.values()"> <dd class="line" *ngFor="let key of publicationInfo.fundedByProjects.values()">
<a href="{{publicationInfo.fundedByProjects.get(key)}}"> <a *ngIf="!key[5]" href="{{publicationInfo.fundedByProjects.get(key)}}">
{{key}} {{key[0]?key[0]:key[1]}} | {{ (key[4])?key[4]:key[3]}} </a>
</a>
<a *ngIf="key[5]" href="{{publicationInfo.fundedByProjects.get(key)}}">
<mark>{{((key[0])?key[0]:key[1])}} | {{ ((key[4])?key[4]:key[3])}} </mark> </a>
</dd> </dd>
</dl> </dl>
<button (click)="toggleClaimProject()" class = "btn btn-default btn-xs" >Add more Projects</button> <button (click)="toggleClaimProject()" class = "btn btn-default btn-xs" >Add more Projects</button>
<inline-claim-project *ngIf="result " inline="true" inlineType ="publication" [inlineEntity]="result" (projectAdded)="projectAdded($event)" ></inline-claim-project> <inline-claim-project *ngIf="result " inline="true" inlineType ="publication" [inlineEntity]="result" (projectAdded)="projectAdded($event)" ></inline-claim-project>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<dl class="functionsSection" *ngIf="publicationInfo.fundedByProjects != undefined">
<dt class="title">Related to </dt>
<dd class="line" >
</dd>
</dl>
<button (click)=" toggleClaimContext()" class = "btn btn-default btn-xs" >Add Contexts</button> <button (click)=" toggleClaimContext()" class = "btn btn-default btn-xs" >Add Contexts</button>
<inline-claim-context *ngIf="result " inline="true" inlineType ="publication" [inlineEntity]="result" ></inline-claim-context> <inline-claim-context inline="true" inlineType ="publication" [inlineEntity]="result" ></inline-claim-context>
</li> </li>
</ul> </ul>
@ -219,10 +234,10 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/
</div> </div>
</div> </div>
`, `,
providers:[JSONP_PROVIDERS, PublicationService], providers:[JSONP_PROVIDERS, PublicationService],
directives:[InlineClaimContextComponent, InlineClaimProjectComponent] directives:[InlineClaimContextComponent, InlineClaimProjectComponent]
@ -247,17 +262,32 @@ export class PublicationComponent {
@ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; @ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ;
@ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ; @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ;
public warningMessage = "";
public errorMessage = "";
getPublicationInfo() { getPublicationInfo() {
this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe( this.warningMessage = '';
data => { this.errorMessage=""
this.publicationInfo = data; if(this.params.get("articleId")==null || this.params.get("articleId")==''){
this.result = [] this.warningMessage="No valid publication id";
let result_ ={id: this.params.get("articleId"), type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''}; console.info("novalid");
this.result.push(result_); }else{
}, console.info("do request");
err => console.error(err) this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe(
); data => {
this.publicationInfo = data;
this.result = []
let result_ ={id: this.params.get("articleId"), type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''};
this.result.push(result_);
},
err => {
console.error(err)
console.info("error");
this.errorMessage = 'No publication found';
}
);
}
} }
/* /*
@ -280,6 +310,7 @@ export class PublicationComponent {
this.publicationInfo.fundedByProjects.get(project.projectId)[1] = project.projectName; this.publicationInfo.fundedByProjects.get(project.projectId)[1] = project.projectName;
this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId; this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId;
this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName; this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName;
this.publicationInfo.fundedByProjects.get(project.projectId)[5] = "new";
} }
} }
} }