openaire-library/claims/claim-utils/claimResultSearchForm.compo...

227 lines
20 KiB
HTML

<form class=" uk-padding uk-padding-large uk-padding-remove-left uk-margin-left" >
<div class="uk-grid">
<div class="uk-width-expand">
<select [(ngModel)]="searchSource" name="select_source" (ngModelChange)="searchSourceChanged(searchSource)" class="uk-select uk-width-1-4">
<option value="openaire">in OpenAIRE </option>
<option value="crossref">in Crossref </option>
<option value="datacite">in Datacite </option>
<option value="orcid">in ORCID </option>
<option value="all">Search all</option>
</select>
<input class=" uk-input uk-width-1-2 form-control" [(ngModel)]="keyword" name="keyword" placeholder="Title, doi, author, orcid..."/>
<span class="input-group-btn">
<button (click)="search(false)" type="submit" class=" uk-button uk-button-default">Search</button>
</span>
</div>
<helper div="link-result-form" class="uk-width-medium"></helper>
</div>
</form>
<div *ngIf="showSearchResults" class="uk-margin-top uk-animation">
<ul class="uk-tab" uk-tab="animation: uk-animation-fade">
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openairePub')" ><a>Publications <span class="uk-badge uk-badge-notification">{{ (openairePubsNum)?openairePubsNum:0 }}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openaireData')" ><a>Research Data <span class="uk-badge uk-badge-notification">{{(openaireDataNum==null)?'0':openaireDataNum}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'openaire'" (click)="clickTab('openaireSoftware')" ><a>Software <span class="uk-badge uk-badge-notification">{{(openaireSoftwareNum==null)?'0':openaireSoftwareNum}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'crossref'" (click)="clickTab('crossref')" ><a>Crossref <span class="uk-badge uk-badge-notification">{{(crossrefResultsNum)?crossrefResultsNum:0}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'datacite'" (click)="clickTab('datacite')"><a>Datacite <span class="uk-badge uk-badge-notification">{{(dataciteResultsNum==null)?'0':dataciteResultsNum}}</span></a></li>
<li *ngIf="searchSource == 'all' || searchSource == 'orcid'" (click)="clickTab('orcid')"><a>Orcid <span class="uk-badge uk-badge-notification">{{(orcidResultsNum)?orcidResultsNum:0}}</span></a></li>
</ul>
<div *ngIf="activeTab == 'crossref'" id="crossref" >
<div class="uk-margin-top" >
<div *ngIf="crossrefStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<div *ngIf="crossrefStatus != errorCodes.LOADING && crossrefResults.length == 0" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="crossrefStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="crossrefStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div *ngIf="crossrefResultsNum != null && crossrefResultsNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="crossrefPage" [totalResults]="crossrefResultsNum" [term]="keyword" [size]="size" (pageChange)="crossrefPageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<ul *ngIf="crossrefResults.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let item of crossrefResults " [class]="(isSelected(item.DOI))?'uk-block-muted':''">
<div >
<a *ngIf="item.URL" target="_blank" href="{{item.URL}}" > <span class="custom-external"></span> {{item.title}}</a>
<span *ngIf="!item.URL" >{{item.title}}</span>
<a class="uk-button-default uk-align-right" *ngIf="!isSelected(item.DOI)" (click)="add(item, item.DOI, 'crossref', 'publication', item.URL, item.title, item.created['date-time'],'OPEN')" class="uk-icon-button"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg></a>
</div>
<span *ngIf="item.publisher" class="uk-article-meta">Publisher: {{item.publisher}}</span><span class="uk-article-meta" *ngIf="(item['published-print'] && item['published-print']['date-parts'] && item['published-print']['date-parts'][0])">({{(item['published-print']['date-parts'][0][0])?item['published-print']['date-parts'][0][0]:item['published-print']['date-parts'][0]}})</span>
<div *ngIf="item.author && item.author.length > 0" class="uk-article-meta">Authors: <span *ngFor="let author of item.author.slice(0,10) let i = index">{{author.family}} {{author.given}}{{(i < (item.author.slice(0,10).length-1))?"; ":""}}{{(i == item.author.slice(0,10).length-1 && item.author.length > 10)?"...":""}}</span></div>
<div *ngIf="item.editor && item.editor.length > 0" class="uk-article-meta">Editors: <span *ngFor="let author of item.editor.slice(0,10) let i = index">{{author.family}} {{author.given}}{{(i < (item.editor.slice(0,10).length-1))?"; ":""}}{{(i == item.editor.slice(0,10).length-1 && item.editor.length > 10)?"...":""}}</span></div>
</li>
</ul>
</div>
</div>
</div>
<div *ngIf="activeTab == 'openairePub'" id="openairePubs" class="uk-animation-fade" >
<div class = "uk-margin-top">
<div *ngIf="openairePubsStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<div *ngIf="openairePubsStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="openairePubsStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="openairePubsStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div *ngIf="openairePubsNum != null && openairePubsNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="openairePubsPage" [totalResults]="openairePubsNum" [term]="keyword" [size]="size" (pageChange)="openairePubsPageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<ul *ngIf="openairePubs.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let result of openairePubs " [class]="(isSelected(result.id))?'uk-block-muted':''">
<div >
<a *ngIf="result['title'].url" target="_blank" [href]="result['title'].url" >{{result['title'].name}}</a>
<span *ngIf="!result['title'].url" >{{result['title'].name}}</span>
<a *ngIf="!isSelected(result.id)" (click)="add(result, result.id, 'openaire', 'publication', result['title'].url, result['title'].name, result.year,result['title'].accessMode)" class="uk-icon-button"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg></a>
</div>
<span *ngIf="result.publisher" class="uk-article-meta">Publisher: {{result.publisher}}</span><span class="uk-article-meta" *ngIf="(result.year)">({{result.year}})</span>
<div *ngIf="result.authors && result.authors.length >0 " class="uk-article-meta">Authors: <span *ngFor="let author of result.authors.slice(0,10) let i = index">{{author}}{{(i < (result.authors.slice(0,10).length-1))?"; ":""}}{{(i == result.authors.slice(0,10).length-1 && result.authors.length > 10)?"...":""}}</span></div>
</li>
</ul>
</div>
</div>
</div>
<div *ngIf="activeTab == 'orcid'" id="orcid" class="uk-animation-fade">
<div class="uk-margin-top" >
<div *ngIf="orcidStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<div *ngIf="orcidStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="orcidStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div *ngIf="orcidStatus == errorCodes.NONE && (!authorIds ||authorIds.length == 0)" class = "uk-alert uk-alert-primary " > No results found </div>
<div *ngIf="orcidResultsNum != null" class="panel-body">
<span>Results for
<a target="_blank" href="http://orcid.org/{{authorId}}"> <span class="custom-external"></span> {{authorGivenName}} {{authorFamilyName}} - {{authorId}} </a> :
</span>
<div class = "uk-alert uk-alert-warning " > Not the author you are looking for?
<span class="dropdown">
<select [(ngModel)]="selectAuthorId" name="select_author" (ngModelChange)="getOrcidResultsById(selectAuthorId)" >
<option [value]="0">Choose another one: </option>
<option *ngFor=" let item of authorIds let i = index" [value]="authorIds[i]">{{authorGivenNames[i]}} {{authorFamilyNames[i]}} : {{item}} </option>
</select>
</span>
</div>
<div *ngIf=" ((orcidResultsNum >0) && (totalPages > 1) && ( 0 < page && page <= totalPages )) " class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="orcidPage" [totalResults]="orcidResultsNum" [term]="keyword" [size]="size" (pageChange)="orcidPageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<ul *ngIf="orcidResultsNum >0 && orcidResultsToShow.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let item of orcidResultsToShow " [class]="(isSelected(authorId+'-'+item['put-code']))?'uk-block-muted':''">
<div>
<span *ngIf="!item.URL" >{{item['work-title']['title'].value}}</span>
<a class="uk-button-default uk-align-right" *ngIf="!isSelected(authorId+item['put-code'])" (click)="add(item,authorId+'-'+item['put-code'],'orcid', 'publication', '', item['work-title']['title'].value, item['publication-date']?item['publication-date'].year.value :null,'OPEN')" class="uk-icon-button"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg></a>
</div>
<span *ngIf="item['journal-title'] && item['journal-title'].value " class="uk-article-meta">Journal: {{item['journal-title'].value}}</span><span class="uk-article-meta" *ngIf="(item['publication-date']&&item['publication-date'].year&&item['publication-date'].year.value)"> ({{item['publication-date'].year.value}})</span>
<div *ngIf="item.contributors && item.contributors.length > 0" class="uk-article-meta">Authors: <span *ngFor="let author of item.contributors.slice(0,10) let i = index">{{author}}{{(i < (item.contributors.slice(0,10).length-1))?"; ":""}}{{(i == item.contributors.slice(0,10).length-1 && item.contributors.length > 10)?"...":""}}</span></div>
</li>
</ul>
<div *ngIf="orcidResultsNum == 0" class = "uk-alert uk-alert-primary " > No results found </div>
</div>
</div>
</div>
</div>
<div *ngIf="activeTab == 'datacite'" id="datacite" class="uk-animation-fade">
<div *ngIf="dataciteStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<div *ngIf="dataciteStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="dataciteStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="dataciteStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div class = "uk-margin-top">
<div *ngIf="dataciteResultsNum != null && dataciteResultsNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="datacitePage" [totalResults]="dataciteResultsNum" [term]="keyword" [size]="size" (pageChange)="datacitePageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<ul *ngIf="dataciteResults.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let item of dataciteResults " [class]="(isSelected(item.attributes.doi))?'uk-block-muted':''" >
<div >
<a *ngIf="item.attributes.doi" target="_blank" href="{{'http://dx.doi.org/'+item.attributes.doi}}" > <span class="custom-external"></span> {{item.attributes.title}}</a>
<span *ngIf="!item.attributes.doi" >{{item.attributes.title}}</span>
<a class="uk-button-default uk-align-right" *ngIf="!isSelected(item.attributes.doi)" (click)="add(item, item.attributes.doi,'datacite','dataset', 'http://dx.doi.org/'+item.attributes.doi, item.attributes.title, item.attributes.published,'OPEN')" class="uk-icon-button"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg></a>
</div>
<span *ngIf="item.attributes['container-title']" class="uk-article-meta">Publisher: {{item.attributes['container-title']}}</span><span *ngIf="(item.attributes.published)" class="uk-article-meta">({{item.attributes.published}})</span>
<div *ngIf="item.attributes.author && item.attributes.author.length > 0" class="uk-article-meta">Authors:
<span *ngFor="let author of item.attributes.author.slice(0,10) let i = index">{{(author.family)?author.family+', '+author.given:author.literal}}{{(i < (item.attributes.author.slice(0,10).length-1))?"; ":""}}{{(i == item.attributes.author.slice(0,10).length-1 && item.attributes.author.length > 10)?"...":""}}</span></div>
</li>
</ul>
</div>
</div>
</div>
<div *ngIf="activeTab == 'openaireData'" id="openaireData" class="uk-animation-fade">
<div *ngIf="openaireDataStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<div *ngIf="openaireDataStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="openaireDataStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="openaireDataStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div class = "uk-margin-top">
<div *ngIf="openaireDataNum != null && openaireDataNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="openaireDataPage" [totalResults]="openaireDataNum" [term]="keyword" [size]="size" (pageChange)="openaireDataPageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<ul *ngIf="openaireData.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let result of openaireData " [class]="(isSelected(result.id))?'uk-block-muted':''">
<div >
<a *ngIf="result['title'].url" target="_blank" [href]="result['title'].url" >{{result['title'].name}}</a>
<span *ngIf="!result['title'].url" >{{result['title'].name}}</span>
<a class="uk-button-default uk-align-right" *ngIf="!isSelected(result.id)"
(click)="add(result, result.id, 'openaire','dataset', result['title'].url, result['title'].name, result.year, result['title'].accessMode)" class="uk-icon-button"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect>
<rect x="1" y="9" width="17" height="1"></rect></svg></a>
</div>
<span *ngIf="result.publisher" class="uk-article-meta">Publisher: {{result.publisher}}</span><span *ngIf="(result.year)" class="uk-article-meta">({{result.year}})</span>
<div *ngIf="result.authors && result.authors.length >0 " class="uk-article-meta">Authors: <span *ngFor="let author of result.authors.slice(0,10) let i = index">{{author}}{{(i < (result.authors.slice(0,10).length-1))?"; ":""}}{{(i == result.authors.slice(0,10).length-1 && result.authors.length > 10)?"...":""}}</span></div>
</li>
</ul>
</div>
</div>
</div>
<div *ngIf="activeTab == 'openaireSoftware'" id="openaireSoftware" class="uk-animation-fade">
<div *ngIf="openaireSoftwareStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
<div *ngIf="openaireSoftwareStatus == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
<div *ngIf="openaireSoftwareStatus == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
<div *ngIf="openaireSoftwareStatus == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
<div class = "uk-margin-top">
<div *ngIf="openaireSoftwareNum != null && openaireSoftwareNum > 0" class="uk-clearfix">
<div class="uk-float-right">
<paging-no-load [currentPage]="openaireSoftwarePage" [totalResults]="openaireSoftwareNum" [term]="keyword" [size]="size" (pageChange)="openaireSoftwarePageChange($event)"> </paging-no-load>
</div>
</div>
<div >
<ul *ngIf="openaireSoftware.length > 0 " class="uk-list uk-list-divider">
<li *ngFor=" let result of openaireSoftware " [class]="(isSelected(result.id))?'uk-block-muted':''">
<div >
<a *ngIf="result['title'].url" target="_blank" [href]="result['title'].url" >{{result['title'].name}}</a>
<span *ngIf="!result['title'].url" >{{result['title'].name}}</span>
<a class="uk-button-default uk-align-right" *ngIf="!isSelected(result.id)"
(click)="add(result, result.id, 'openaire','software', result['title'].url, result['title'].name, result.year, result['title'].accessMode)" class="uk-icon-button"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect>
<rect x="1" y="9" width="17" height="1"></rect></svg></a>
</div>
<span *ngIf="result.publisher" class="uk-article-meta">Publisher: {{result.publisher}}</span><span *ngIf="(result.year)" class="uk-article-meta">({{result.year}})</span>
<div *ngIf="result.authors && result.authors.length >0 " class="uk-article-meta">Authors: <span *ngFor="let author of result.authors.slice(0,10) let i = index">{{author}}{{(i < (result.authors.slice(0,10).length-1))?"; ":""}}{{(i == result.authors.slice(0,10).length-1 && result.authors.length > 10)?"...":""}}</span></div>
</li>
</ul>
</div>
</div>
</div>
</div>