Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme
This commit is contained in:
commit
8205f303a7
|
@ -89,125 +89,172 @@
|
||||||
<div *ngIf="dataProviderInfo != null">
|
<div *ngIf="dataProviderInfo != null">
|
||||||
|
|
||||||
<!-- *ngIf="numberOfTabs > 0; else loadingBlock"-->
|
<!-- *ngIf="numberOfTabs > 0; else loadingBlock"-->
|
||||||
<div class="main-tabs-div">
|
<div class="main-tabs-div" uk-sticky="offset: 100; ">
|
||||||
<ng-template #summary_tab>
|
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" >
|
||||||
<div class="uk-grid uk-margin-remove">
|
|
||||||
<div *ngIf="hasPrimaryInfo || (!aggregationStatusIsInitialized || hasAggregationStatusInfo)"
|
<my-tab
|
||||||
class="uk-width-expand uk-padding uk-inline">
|
[tabTitle]="'Summary'" [tabId]="'summary'" [active]="true">
|
||||||
<!-- Description -->
|
|
||||||
<div *ngIf="dataProviderInfo.description" class="uk-margin-medium-bottom">
|
</my-tab>
|
||||||
<div class="uk-text-muted">Description</div>
|
<my-tab *ngIf="fetchProjects.searchUtils.totalResults > 0"
|
||||||
<div class="uk-text-justify uk-height-max-medium uk-overflow-auto">
|
[tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
|
||||||
<span>{{dataProviderInfo.description.substring(0, showNumDescription)}}</span>
|
[tabId]="'projects'" >
|
||||||
<span *ngIf="showNumDescription == thresholdDescription &&
|
</my-tab>
|
||||||
|
<my-tab *ngIf="fetchDataproviders.searchUtils.totalResults > 0"
|
||||||
|
[tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
|
||||||
|
[tabId]="'datasources'" >
|
||||||
|
</my-tab>
|
||||||
|
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||||
|
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||||
|
[tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
|
||||||
|
>
|
||||||
|
</my-tab>
|
||||||
|
<my-tab *ngIf="fetchPublications.searchUtils.totalResults > 0"
|
||||||
|
[tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
|
||||||
|
[tabId]="'publications'" >
|
||||||
|
|
||||||
|
</my-tab>
|
||||||
|
<my-tab *ngIf="fetchDatasets.searchUtils.totalResults > 0"
|
||||||
|
[tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
|
||||||
|
[tabId]="'datasets'" >
|
||||||
|
</my-tab>
|
||||||
|
<my-tab *ngIf="fetchSoftware.searchUtils.totalResults > 0"
|
||||||
|
[tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
|
||||||
|
[tabId]="'software'">
|
||||||
|
</my-tab>
|
||||||
|
<my-tab *ngIf="fetchOrps.searchUtils.totalResults > 0"
|
||||||
|
[tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults"
|
||||||
|
[tabId]="'other'">
|
||||||
|
|
||||||
|
</my-tab>
|
||||||
|
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||||
|
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
||||||
|
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'" [active]="false"
|
||||||
|
>
|
||||||
|
</my-tab>
|
||||||
|
</my-tabs>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--Summary-->
|
||||||
|
<div #summary_tab>
|
||||||
|
<div id="summary" class="uk-grid uk-margin-remove landing-section">
|
||||||
|
<div *ngIf="hasPrimaryInfo || (!aggregationStatusIsInitialized || hasAggregationStatusInfo)"
|
||||||
|
class="uk-width-expand uk-padding uk-inline">
|
||||||
|
<!-- Description -->
|
||||||
|
<div *ngIf="dataProviderInfo.description" class="uk-margin-medium-bottom">
|
||||||
|
<div class="uk-text-muted">Description</div>
|
||||||
|
<div class="uk-text-justify uk-height-max-medium uk-overflow-auto">
|
||||||
|
<span>{{dataProviderInfo.description.substring(0, showNumDescription)}}</span>
|
||||||
|
<span *ngIf="showNumDescription == thresholdDescription &&
|
||||||
dataProviderInfo.description.length > thresholdDescription">...</span>
|
dataProviderInfo.description.length > thresholdDescription">...</span>
|
||||||
</div>
|
|
||||||
<div *ngIf="showNumDescription == thresholdDescription &&
|
|
||||||
dataProviderInfo.description.length > thresholdDescription" class="uk-text-right">
|
|
||||||
<a (click)="showNumDescription = dataProviderInfo.description.length;">
|
|
||||||
Read more
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="dataProviderInfo.description && showNumDescription > thresholdDescription"
|
|
||||||
class="uk-text-right">
|
|
||||||
<a (click)="showNumDescription = thresholdDescription;">
|
|
||||||
Read less
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="showNumDescription == thresholdDescription &&
|
||||||
|
dataProviderInfo.description.length > thresholdDescription" class="uk-text-right">
|
||||||
|
<a (click)="showNumDescription = dataProviderInfo.description.length;">
|
||||||
|
Read more
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="dataProviderInfo.description && showNumDescription > thresholdDescription"
|
||||||
|
class="uk-text-right">
|
||||||
|
<a (click)="showNumDescription = thresholdDescription;">
|
||||||
|
Read less
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul *ngIf="hasJournalInfo" class="uk-list uk-margin-medium-bottom uk-margin-remove-top">
|
<ul *ngIf="hasJournalInfo" class="uk-list uk-margin-medium-bottom uk-margin-remove-top">
|
||||||
<showPublisher [journal]="dataProviderInfo.journal" [properties]="properties"></showPublisher>
|
<showPublisher [journal]="dataProviderInfo.journal" [properties]="properties"></showPublisher>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div *ngIf="hasAggregationStatusInfo || dataProviderInfo.fundedContent"
|
<div *ngIf="hasAggregationStatusInfo || dataProviderInfo.fundedContent"
|
||||||
class="uk-margin-medium-bottom uk-animation-fade uk-animation-fast">
|
class="uk-margin-medium-bottom uk-animation-fade uk-animation-fast">
|
||||||
<span *ngIf="dataProviderInfo.aggregationStatus?.fulltexts && dataProviderInfo.aggregationStatus?.fulltexts != -1"
|
<span *ngIf="dataProviderInfo.aggregationStatus?.fulltexts && dataProviderInfo.aggregationStatus?.fulltexts != -1"
|
||||||
class="uk-margin-right">
|
class="uk-margin-right">
|
||||||
<span class="uk-text-muted">Collected full-texts: </span>
|
<span class="uk-text-muted">Collected full-texts: </span>
|
||||||
{{dataProviderInfo.aggregationStatus.fulltexts | number}}
|
{{dataProviderInfo.aggregationStatus.fulltexts | number}}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="dataProviderInfo.fundedContent && dataProviderInfo.fundedContent > 0"
|
<span *ngIf="dataProviderInfo.fundedContent && dataProviderInfo.fundedContent > 0"
|
||||||
class="uk-display-inline-block">
|
class="uk-display-inline-block">
|
||||||
<span class="uk-text-muted">Results with funding information: </span>
|
<span class="uk-text-muted">Results with funding information: </span>
|
||||||
{{dataProviderInfo.fundedContent | number}}
|
{{dataProviderInfo.fundedContent | number}}
|
||||||
</span>
|
</span>
|
||||||
<!-- <span *ngIf="dataProviderInfo.aggregationStatus.lastUpdateDate"-->
|
<!-- <span *ngIf="dataProviderInfo.aggregationStatus.lastUpdateDate"-->
|
||||||
<!-- class="uk-display-inline-block">-->
|
<!-- class="uk-display-inline-block">-->
|
||||||
<!-- <span class="uk-text-muted">Latest data aggregation: </span>-->
|
<!-- <span class="uk-text-muted">Latest data aggregation: </span>-->
|
||||||
<!-- {{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}-->
|
<!-- {{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}-->
|
||||||
<!-- </span>-->
|
<!-- </span>-->
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!aggregationStatusIsInitialized || !dataProviderInfo.fundedContent"
|
<div *ngIf="!aggregationStatusIsInitialized || !dataProviderInfo.fundedContent"
|
||||||
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
|
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">
|
||||||
<span class="loading-gif uk-align-center"></span>
|
<span class="loading-gif uk-align-center"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"
|
<div *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"
|
||||||
class="uk-margin-medium-bottom">
|
class="uk-margin-medium-bottom">
|
||||||
<span class="uk-text-muted">Countries:</span>
|
<span class="uk-text-muted">Countries:</span>
|
||||||
{{dataProviderInfo.countries.join(", ")}}
|
{{dataProviderInfo.countries.join(", ")}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Subjects -->
|
<!-- Subjects -->
|
||||||
<div *ngIf="dataProviderInfo.subjects && dataProviderInfo.subjects.length > 0"
|
<div *ngIf="dataProviderInfo.subjects && dataProviderInfo.subjects.length > 0"
|
||||||
class="uk-margin-medium-bottom uk-margin-bottom">
|
class="uk-margin-medium-bottom uk-margin-bottom">
|
||||||
<div class="uk-height-max-medium uk-overflow-auto">
|
<div class="uk-height-max-medium uk-overflow-auto">
|
||||||
<div class="uk-text-muted">Subjects </div>
|
<div class="uk-text-muted">Subjects </div>
|
||||||
<span *ngFor="let subject of dataProviderInfo.subjects.slice(0, showNumSubjects) let i=index">
|
<span *ngFor="let subject of dataProviderInfo.subjects.slice(0, showNumSubjects) let i=index">
|
||||||
<span>{{subject}}</span>
|
<span>{{subject}}</span>
|
||||||
<span *ngIf="(i < dataProviderInfo.subjects.length-1)">, </span>
|
<span *ngIf="(i < dataProviderInfo.subjects.length-1)">, </span>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"> ... </span>
|
<span *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"> ... </span>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"
|
<div *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"
|
||||||
class="uk-width-1-1 uk-text-right">
|
class="uk-width-1-1 uk-text-right">
|
||||||
<a (click)="showNumSubjects = dataProviderInfo.subjects.length;">
|
<a (click)="showNumSubjects = dataProviderInfo.subjects.length;">
|
||||||
View all {{dataProviderInfo.subjects.length | number}} subjects
|
View all {{dataProviderInfo.subjects.length | number}} subjects
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="showNumSubjects > thresholdSubjects" class="uk-width-1-1 uk-text-right">
|
<div *ngIf="showNumSubjects > thresholdSubjects" class="uk-width-1-1 uk-text-right">
|
||||||
<a (click)="showNumSubjects = thresholdSubjects;">View less subjects</a>
|
<a (click)="showNumSubjects = thresholdSubjects;">View less subjects</a>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div *ngIf="hasSecondaryInfo"
|
<div *ngIf="hasSecondaryInfo"
|
||||||
[class]="'uk-padding uk-inline ' + (hasPrimaryInfo?'uk-width-1-3@m right-column': 'uk-width-expand')">
|
[class]="'uk-padding uk-inline ' + (hasPrimaryInfo?'uk-width-1-3@m right-column': 'uk-width-expand')">
|
||||||
<div *ngIf="dataProviderInfo.oaiPmhURL || dataProviderInfo.openDoarId || dataProviderInfo.r3DataId"
|
<div *ngIf="dataProviderInfo.oaiPmhURL || dataProviderInfo.openDoarId || dataProviderInfo.r3DataId"
|
||||||
class="uk-margin-medium-bottom">
|
class="uk-margin-medium-bottom">
|
||||||
<div *ngIf="dataProviderInfo.oaiPmhURL">
|
<div *ngIf="dataProviderInfo.oaiPmhURL">
|
||||||
<span class="uk-text-muted">OAI-PMH: </span>
|
<span class="uk-text-muted">OAI-PMH: </span>
|
||||||
<a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}">
|
<a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}">
|
||||||
{{dataProviderInfo.oaiPmhURL}}
|
{{dataProviderInfo.oaiPmhURL}}
|
||||||
<span class="custom-external custom-icon space"></span>
|
<span class="custom-external custom-icon space"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="dataProviderInfo.openDoarId" class="uk-display-inline-block">
|
<div *ngIf="dataProviderInfo.openDoarId" class="uk-display-inline-block">
|
||||||
<span class="uk-text-muted">Detailed information @ </span>
|
<span class="uk-text-muted">Detailed information @ </span>
|
||||||
<a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">
|
<a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">
|
||||||
OpenDOAR
|
OpenDOAR
|
||||||
<span class="custom-external custom-icon space"></span>
|
<span class="custom-external custom-icon space"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<span *ngIf="dataProviderInfo.r3DataId" class="uk-display-inline-block">
|
<span *ngIf="dataProviderInfo.r3DataId" class="uk-display-inline-block">
|
||||||
<span class="uk-text-muted">Detailed information @ </span>
|
<span class="uk-text-muted">Detailed information @ </span>
|
||||||
<a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}">
|
<a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}">
|
||||||
re3data.org
|
re3data.org
|
||||||
<span class="custom-external custom-icon space"></span>
|
<span class="custom-external custom-icon space"></span>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- Organizations -->
|
<!-- Organizations -->
|
||||||
<!-- <div class="uk-text-muted uk-text-small">Organizations</div>-->
|
<!-- <div class="uk-text-muted uk-text-small">Organizations</div>-->
|
||||||
<!-- <div class="uk-height-max-medium uk-overflow-auto">-->
|
<!-- <div class="uk-height-max-medium uk-overflow-auto">-->
|
||||||
<div *ngIf="dataProviderInfo.organizations && dataProviderInfo.organizations.length > 0"
|
<div *ngIf="dataProviderInfo.organizations && dataProviderInfo.organizations.length > 0"
|
||||||
class="uk-margin-medium-bottom">
|
class="uk-margin-medium-bottom">
|
||||||
<div class="uk-height-max-medium uk-overflow-auto">
|
<div class="uk-height-max-medium uk-overflow-auto">
|
||||||
<span class="uk-text-muted">Organizations: </span>
|
<span class="uk-text-muted">Organizations: </span>
|
||||||
<span *ngFor="let organization of dataProviderInfo.organizations.slice(0, showNumOrganizations) let i=index"
|
<span *ngFor="let organization of dataProviderInfo.organizations.slice(0, showNumOrganizations) let i=index"
|
||||||
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
[title]="organization.name">
|
[title]="organization.name">
|
||||||
<a *ngIf="organization.id"
|
<a *ngIf="organization.id"
|
||||||
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
|
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
|
||||||
[routerLink]="properties.searchLinkToOrganization.split('?')[0]">
|
[routerLink]="properties.searchLinkToOrganization.split('?')[0]">
|
||||||
|
@ -221,255 +268,142 @@
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="(i < dataProviderInfo.organizations.length-1)">, </span>
|
<span *ngIf="(i < dataProviderInfo.organizations.length-1)">, </span>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"> ... </span>
|
<span *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"> ... </span>
|
||||||
</div>
|
|
||||||
<div *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"
|
|
||||||
class="uk-width-1-1 uk-text-right">
|
|
||||||
<a (click)="showNumOrganizations = dataProviderInfo.organizations.length;">
|
|
||||||
View all {{dataProviderInfo.organizations.length | number}} organizations
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="showNumOrganizations > thresholdOrganizations" class="uk-width-1-1 uk-text-right">
|
|
||||||
<a (click)="showNumOrganizations = thresholdOrganizations;">View less organizations</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"
|
||||||
<div *ngIf="!hasPrimaryInfo && (aggregationStatusIsInitialized && !hasAggregationStatusInfo) && !hasSecondaryInfo" class="uk-width-expand uk-padding">
|
class="uk-width-1-1 uk-text-right">
|
||||||
<div class="uk-animation-fade uk-alert uk-alert-primary" role="alert">
|
<a (click)="showNumOrganizations = dataProviderInfo.organizations.length;">
|
||||||
No summary information available
|
View all {{dataProviderInfo.organizations.length | number}} organizations
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="showNumOrganizations > thresholdOrganizations" class="uk-width-1-1 uk-text-right">
|
||||||
|
<a (click)="showNumOrganizations = thresholdOrganizations;">View less organizations</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
<div *ngIf="!hasPrimaryInfo && (aggregationStatusIsInitialized && !hasAggregationStatusInfo) && !hasSecondaryInfo" class="uk-width-expand uk-padding">
|
||||||
<ng-template #projects_tab>
|
<div class="uk-animation-fade uk-alert uk-alert-primary" role="alert">
|
||||||
<div class="uk-grid uk-margin-remove">
|
No summary information available
|
||||||
<div class="uk-width-expand uk-padding">
|
|
||||||
<search-tab [fetch]="fetchProjects" resultType="project"
|
|
||||||
[params]="getParamsForSearchLink()"
|
|
||||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects"
|
|
||||||
[properties]="properties">
|
|
||||||
</search-tab>
|
|
||||||
</div>
|
|
||||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
<ng-template #datasources_tab>
|
|
||||||
<div class="uk-grid uk-margin-remove">
|
|
||||||
<div class="uk-width-expand uk-padding">
|
|
||||||
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
|
|
||||||
[params]="getParamsForSearchLink()"
|
|
||||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
|
|
||||||
[properties]="properties">
|
|
||||||
</search-tab>
|
|
||||||
</div>
|
|
||||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
<ng-template #relatedDatasources_tab>
|
|
||||||
<div class="uk-grid uk-margin-remove">
|
|
||||||
<div class="uk-width-expand uk-padding">
|
|
||||||
<relatedDatasourcesTab
|
|
||||||
[dataproviderId]="datasourceId"
|
|
||||||
[results]="dataProviderInfo.relatedDatasources"
|
|
||||||
[loading]="loadingRelatedDatasources"
|
|
||||||
[fetchResults]="fetchAggregatorsResults"
|
|
||||||
[collectedFromName]="dataProviderInfo.title.name"
|
|
||||||
[properties]=properties
|
|
||||||
[modal]="relatedDatasourcesModal">
|
|
||||||
</relatedDatasourcesTab>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</div>
|
||||||
<ng-template #publications_tab>
|
</div>
|
||||||
<div class="uk-grid uk-margin-remove">
|
<!--Projects-->
|
||||||
<div class="uk-width-expand uk-padding">
|
<ng-container *ngIf="fetchProjects.searchUtils.totalResults > 0">
|
||||||
<search-tab [fetch]="fetchPublications" resultType="publication"
|
<div id="projects" class="uk-grid uk-margin-remove landing-section">
|
||||||
[params]="getParamsForSearchLink('publications')"
|
<div class="uk-width-expand uk-padding">
|
||||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
<search-tab [fetch]="fetchProjects" resultType="project"
|
||||||
[properties]="properties">
|
[params]="getParamsForSearchLink()"
|
||||||
</search-tab>
|
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects"
|
||||||
</div>
|
[properties]="properties">
|
||||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
</search-tab>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||||
<ng-template #datasets_tab>
|
</div>
|
||||||
<div class="uk-grid uk-margin-remove">
|
</ng-container>
|
||||||
<div class="uk-width-expand uk-padding">
|
<!--Content Providers-->
|
||||||
<search-tab [fetch]="fetchDatasets" resultType="dataset"
|
<ng-container *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
|
||||||
[params]="getParamsForSearchLink('datasets')"
|
<div id="datasources" class="uk-grid uk-margin-remove landing-section">
|
||||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
<div class="uk-width-expand uk-padding">
|
||||||
[properties]="properties">
|
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
|
||||||
</search-tab>
|
[params]="getParamsForSearchLink()"
|
||||||
</div>
|
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
|
||||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
[properties]="properties">
|
||||||
|
</search-tab>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||||
<ng-template #software_tab>
|
</div>
|
||||||
<div class="uk-grid uk-margin-remove">
|
</ng-container>
|
||||||
<div class="uk-width-expand uk-padding">
|
<!--Related Content Providers-->
|
||||||
<search-tab [fetch]="fetchSoftware" resultType="software"
|
<ng-container *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||||
[params]="getParamsForSearchLink('software')"
|
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)">
|
||||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
<div id="relatedDatasources" class="uk-grid uk-margin-remove landing-section">
|
||||||
[properties]="properties">
|
<div class="uk-width-expand uk-padding">
|
||||||
</search-tab>
|
<relatedDatasourcesTab
|
||||||
</div>
|
[dataproviderId]="datasourceId"
|
||||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
[results]="dataProviderInfo.relatedDatasources"
|
||||||
|
[loading]="loadingRelatedDatasources"
|
||||||
|
[fetchResults]="fetchAggregatorsResults"
|
||||||
|
[collectedFromName]="dataProviderInfo.title.name"
|
||||||
|
[properties]=properties
|
||||||
|
[modal]="relatedDatasourcesModal">
|
||||||
|
</relatedDatasourcesTab>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</div>
|
||||||
<ng-template #other_tab>
|
</ng-container>
|
||||||
<div class="uk-grid uk-margin-remove">
|
<!--Publications-->
|
||||||
<div class="uk-width-expand uk-padding">
|
<ng-container *ngIf="fetchPublications.searchUtils.totalResults > 0">
|
||||||
<search-tab [fetch]="fetchOrps" resultType="other"
|
<div id="publications" class="uk-grid uk-margin-remove landing-section">
|
||||||
[params]="getParamsForSearchLink('other')"
|
<div class="uk-width-expand uk-padding">
|
||||||
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
<search-tab [fetch]="fetchPublications" resultType="publication"
|
||||||
[properties]="properties">
|
[params]="getParamsForSearchLink('publications')"
|
||||||
</search-tab>
|
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||||
</div>
|
[properties]="properties">
|
||||||
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
</search-tab>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||||
<ng-template #statistics_tab>
|
</div>
|
||||||
<div class="">
|
</ng-container>
|
||||||
<div class="uk-width-expand uk-padding">
|
<!--Research Data-->
|
||||||
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status,
|
<ng-container *ngIf="fetchDatasets.searchUtils.totalResults > 0">
|
||||||
fetchSoftware.searchUtils.status, fetchOrps.searchUtils.status]"
|
<div id="datasets" class="uk-grid uk-margin-remove">
|
||||||
[type]="'statistics'" tab_error_class=true></errorMessages>
|
<div class="uk-width-expand uk-padding">
|
||||||
|
<search-tab [fetch]="fetchDatasets" resultType="dataset"
|
||||||
|
[params]="getParamsForSearchLink('datasets')"
|
||||||
|
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||||
|
[properties]="properties">
|
||||||
|
</search-tab>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
<!--Software-->
|
||||||
|
<ng-container *ngIf="fetchSoftware.searchUtils.totalResults > 0">
|
||||||
|
<div id="software" class="uk-grid uk-margin-remove">
|
||||||
|
<div class="uk-width-expand uk-padding">
|
||||||
|
<search-tab [fetch]="fetchSoftware" resultType="software"
|
||||||
|
[params]="getParamsForSearchLink('software')"
|
||||||
|
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||||
|
[properties]="properties">
|
||||||
|
</search-tab>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
<!--Other-->
|
||||||
|
<ng-container *ngIf="fetchOrps.searchUtils.totalResults > 0">
|
||||||
|
<div id="other" class="uk-grid uk-margin-remove">
|
||||||
|
<div class="uk-width-expand uk-padding">
|
||||||
|
<search-tab [fetch]="fetchOrps" resultType="other"
|
||||||
|
[params]="getParamsForSearchLink('other')"
|
||||||
|
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
|
||||||
|
[properties]="properties">
|
||||||
|
</search-tab>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
<!--Statistics-->
|
||||||
|
<ng-container *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
||||||
|
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)">
|
||||||
|
|
||||||
<div
|
<div id="statistics" class="uk-width-expand uk-padding">
|
||||||
*ngIf="statsClicked &&
|
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status,
|
||||||
|
fetchSoftware.searchUtils.status, fetchOrps.searchUtils.status]"
|
||||||
|
[type]="'statistics'" tab_error_class=true></errorMessages>
|
||||||
|
|
||||||
|
<div
|
||||||
|
*ngIf="statsClicked &&
|
||||||
(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE
|
(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE
|
||||||
|| fetchSoftware.searchUtils.status == errorCodes.DONE || fetchOrps.searchUtils.status == errorCodes.DONE)">
|
|| fetchSoftware.searchUtils.status == errorCodes.DONE || fetchOrps.searchUtils.status == errorCodes.DONE)">
|
||||||
<statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"
|
<statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"
|
||||||
[fetchSoftware]="fetchSoftware" [fetchOther]="fetchOrps"
|
[fetchSoftware]="fetchSoftware" [fetchOther]="fetchOrps"
|
||||||
[datasourceId]="datasourceId">
|
[datasourceId]="datasourceId">
|
||||||
</statisticsTab>
|
</statisticsTab>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
|
||||||
|
|
||||||
<!-- [class]="numberOfTabs > 2 ? 'uk-visible@m' : ''"-->
|
</ng-container>
|
||||||
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
|
||||||
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
|
|
||||||
<!-- [class]="(firstTab === 'summary')?'uk-active':''"-->
|
|
||||||
<my-tab
|
|
||||||
[tabTitle]="'Summary'" [tabId]="'summary'" class="uk-active">
|
|
||||||
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'projects')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchProjects.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
|
|
||||||
[tabId]="'projects'" >
|
|
||||||
<ng-container *ngTemplateOutlet="projects_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'datasources')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchDataproviders.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
|
|
||||||
[tabId]="'datasources'" >
|
|
||||||
<ng-container *ngTemplateOutlet="datasources_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'relatedDatasources')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
|
||||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
|
||||||
[tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
|
|
||||||
>
|
|
||||||
<ng-container *ngTemplateOutlet="relatedDatasources_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'publications')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchPublications.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
|
|
||||||
[tabId]="'publications'" >
|
|
||||||
<ng-container *ngTemplateOutlet="publications_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'datasets')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchDatasets.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
|
|
||||||
[tabId]="'datasets'" >
|
|
||||||
<ng-container *ngTemplateOutlet="datasets_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'software')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchSoftware.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
|
|
||||||
[tabId]="'software'">
|
|
||||||
<ng-container *ngTemplateOutlet="software_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'other')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchOrps.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults"
|
|
||||||
[tabId]="'other'">
|
|
||||||
<ng-container *ngTemplateOutlet="other_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'statistics')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
|
||||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
|
||||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
|
|
||||||
>
|
|
||||||
<ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
</my-tabs>
|
|
||||||
|
|
||||||
<!-- <div *ngIf="numberOfTabs() > 2">TEST!!!</div>-->
|
|
||||||
|
|
||||||
<!-- *ngIf="numberOfTabs > 2"-->
|
|
||||||
<my-small-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
|
||||||
<!-- *ngIf="hasPrimaryInfo || hasSecondaryInfo"-->
|
|
||||||
<!-- [class]="(firstTab === 'summary')?'uk-active':''"-->
|
|
||||||
<my-tab
|
|
||||||
[tabTitle]="'Summary'" [tabId]="'summary'" class="uk-active">
|
|
||||||
<ng-container *ngTemplateOutlet="summary_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'projects')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchProjects.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Projects'" [tabNumber]="fetchProjects.searchUtils.totalResults"
|
|
||||||
[tabId]="'projects'" >
|
|
||||||
<ng-container *ngTemplateOutlet="projects_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'datasources')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchDataproviders.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Content Providers'" [tabNumber]="fetchDataproviders.searchUtils.totalResults"
|
|
||||||
[tabId]="'datasources'" >
|
|
||||||
<ng-container *ngTemplateOutlet="datasources_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'relatedDatasources')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
|
||||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
|
||||||
[tabTitle]="'Related Content Providers'" [tabId]="'relatedDatasources'"
|
|
||||||
>
|
|
||||||
<ng-container *ngTemplateOutlet="relatedDatasources_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'publications')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchPublications.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Publications'" [tabNumber]="fetchPublications.searchUtils.totalResults"
|
|
||||||
[tabId]="'publications'" >
|
|
||||||
<ng-container *ngTemplateOutlet="publications_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'datasets')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchDatasets.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Research Data'" [tabNumber]="fetchDatasets.searchUtils.totalResults"
|
|
||||||
[tabId]="'datasets'" >
|
|
||||||
<ng-container *ngTemplateOutlet="datasets_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'software')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchSoftware.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Software'" [tabNumber]="fetchSoftware.searchUtils.totalResults"
|
|
||||||
[tabId]="'software'">
|
|
||||||
<ng-container *ngTemplateOutlet="software_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'other')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="fetchOrps.searchUtils.totalResults > 0"
|
|
||||||
[tabTitle]="'Other Research'" [tabNumber]="fetchOrps.searchUtils.totalResults"
|
|
||||||
[tabId]="'other'">
|
|
||||||
<ng-container *ngTemplateOutlet="other_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
<!-- [class]="(firstTab === 'statistics')?'uk-active':''"-->
|
|
||||||
<my-tab *ngIf="(fetchPublications.searchUtils.totalResults > 0 || fetchDatasets.searchUtils.totalResults > 0
|
|
||||||
|| fetchSoftware.searchUtils.totalResults > 0 || fetchOrps.searchUtils.totalResults > 0)"
|
|
||||||
[tabTitle]="'Statistics'" customClass="statistics" [tabId]="'statistics'"
|
|
||||||
>
|
|
||||||
<ng-container *ngTemplateOutlet="statistics_tab;"></ng-container>
|
|
||||||
</my-tab>
|
|
||||||
</my-small-tabs>
|
|
||||||
</div>
|
|
||||||
<!-- <ng-template #loadingBlock>-->
|
<!-- <ng-template #loadingBlock>-->
|
||||||
<!-- <div *ngIf="!tabsAreInitialized" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">-->
|
<!-- <div *ngIf="!tabsAreInitialized" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert">-->
|
||||||
<!-- <span class="loading-gif uk-align-center" ></span>-->
|
<!-- <span class="loading-gif uk-align-center" ></span>-->
|
||||||
|
|
|
@ -26,6 +26,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview";
|
||||||
import {IndexInfoService} from "../../utils/indexInfo.service";
|
import {IndexInfoService} from "../../utils/indexInfo.service";
|
||||||
import {properties} from "../../../../environments/environment";
|
import {properties} from "../../../../environments/environment";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
|
import {TabComponent} from "../../utils/tabs/tab.component";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -596,7 +597,7 @@ export class DataProviderComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public onSelectActiveTab(activeTabId) {
|
public onSelectActiveTab(activeTabId) {
|
||||||
if (this.activeTab != "activaTabId") { // tab really changed
|
if (this.activeTab != activeTabId) { // tab really changed
|
||||||
if (activeTabId == 'summary') {
|
if (activeTabId == 'summary') {
|
||||||
this.activeTab = 'summary';
|
this.activeTab = 'summary';
|
||||||
} else if (activeTabId == 'publications') {
|
} else if (activeTabId == 'publications') {
|
||||||
|
|
|
@ -27,4 +27,6 @@ export class TabComponent {
|
||||||
@Input('customClass') customClass:string = "";
|
@Input('customClass') customClass:string = "";
|
||||||
@Input('tabId') tabId: string;
|
@Input('tabId') tabId: string;
|
||||||
@Input('tabIcon') tabIcon: TabIcon;
|
@Input('tabIcon') tabIcon: TabIcon;
|
||||||
|
@Input ('active') active: boolean = false;
|
||||||
|
@Input ('disabled') disabled: boolean = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,43 +2,147 @@
|
||||||
* The main component that renders single TabComponent
|
* The main component that renders single TabComponent
|
||||||
* instances.
|
* instances.
|
||||||
*/
|
*/
|
||||||
import {AfterContentInit, Component, ContentChildren, EventEmitter, Input, Output, QueryList,} from '@angular/core';
|
import {
|
||||||
|
AfterContentInit,
|
||||||
|
Component,
|
||||||
|
ContentChildren,
|
||||||
|
EventEmitter,
|
||||||
|
HostListener,
|
||||||
|
Output,
|
||||||
|
QueryList,
|
||||||
|
} from '@angular/core';
|
||||||
import {TabComponent} from './tab.component';
|
import {TabComponent} from './tab.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-tabs',
|
selector: 'my-tabs',
|
||||||
template: `
|
template: `
|
||||||
<ul class="uk-tab" [ngClass]="customClass" uk-tab="connect: .tabs-content">
|
<div class="uk-grid uk-margin-remove-left">
|
||||||
<!-- [class.uk-active]="selected === tab.tabId"-->
|
|
||||||
<li *ngFor="let tab of tabs.toArray(); let i=index" [ngClass]="tab.customClass" (click)="selectTab(tab)">
|
<div class="uk-margin-medium-right uk-padding-small uk-width-expand" >
|
||||||
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center" [ngClass]="tab.tabIcon ? 'uk-flex-column' : ''">
|
<div class=" uk-width-1-1" uk-slider="finite: true">
|
||||||
<icon *ngIf="tab.tabIcon" [svg]="tab.tabIcon.svg" [ratio]="tab.tabIcon.ratio?tab.tabIcon.ratio:1" class="uk-margin-small-bottom"
|
<div class="uk-position-relative " >
|
||||||
[ngClass]="(selected === tab.tabId)?tab.tabIcon.active:null"></icon>
|
<div class="uk-slider-container ">
|
||||||
<div>{{tab.title}}</div>
|
<ul class=" uk-slider-items " style="flex-wrap: nowrap !important;" >
|
||||||
<div *ngIf="tab.num" class="number">{{tab.num | number}}</div>
|
<ng-container *ngFor="let tab of tabs.toArray(); let i=index">
|
||||||
</a>
|
<ng-container *ngIf="!tab.customClass">
|
||||||
</li>
|
<li [ngClass]="tab.customClass" (click)="selectTab(tab)" >
|
||||||
</ul>
|
<ul class="uk-tab">
|
||||||
<div class="uk-switcher tabs-content">
|
<li [class.uk-active]="tab.active" [class.uk-disabled]="tab.disabled">
|
||||||
<ng-content></ng-content>
|
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center" [ngClass]="tab.tabIcon ? 'uk-flex-column' : ''">
|
||||||
|
<icon *ngIf="tab.tabIcon" [svg]="tab.tabIcon.svg" [ratio]="tab.tabIcon.ratio?tab.tabIcon.ratio:1" class="uk-margin-small-bottom"
|
||||||
|
[ngClass]="(selected === tab.tabId)?tab.tabIcon.active:null"></icon>
|
||||||
|
<div>{{tab.title}}</div>
|
||||||
|
<div *ngIf="tab.num && !tab.disabled" class="">({{tab.num | number}})</div>
|
||||||
|
<div *ngIf="tab.disabled" class="">(-)</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="">
|
||||||
|
<a class="uk-position-center-left-out" uk-slider-item="previous"><span uk-icon="chevron-left"></span></a>
|
||||||
|
<a class="uk-position-center-right-out" uk-slider-item="next"><span uk-icon="chevron-right"></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ng-container *ngFor="let tab of tabs.toArray(); let i=index">
|
||||||
|
<ng-container *ngIf="tab.customClass">
|
||||||
|
<div class="uk-width-small uk-padding-small">
|
||||||
|
<ul class="uk-tab">
|
||||||
|
<li [ngClass]="tab.customClass" (click)="selectTab(tab)" [class.uk-active]="tab.active" >
|
||||||
|
<a class="uk-width-1-1 uk-height-1-1 uk-flex uk-flex-center" [ngClass]="tab.tabIcon ? 'uk-flex-column' : ''">
|
||||||
|
<icon *ngIf="tab.tabIcon" [svg]="tab.tabIcon.svg" [ratio]="tab.tabIcon.ratio?tab.tabIcon.ratio:1" class="uk-margin-small-bottom"
|
||||||
|
[ngClass]="(selected === tab.tabId)?tab.tabIcon.active:null"></icon>
|
||||||
|
<div>{{tab.title}}</div>
|
||||||
|
<div *ngIf="tab.num" class="number">{{tab.num | number}}</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class TabsComponent implements AfterContentInit {
|
export class TabsComponent implements AfterContentInit {
|
||||||
@Input()
|
|
||||||
public customClass: string;
|
public customClass: string;
|
||||||
@ContentChildren(TabComponent) tabs: QueryList<TabComponent>;
|
@ContentChildren(TabComponent) tabs: QueryList<TabComponent>;
|
||||||
@Output() public selectedActiveTab: EventEmitter<any> = new EventEmitter();
|
@Output() public selectedActiveTab: EventEmitter<any> = new EventEmitter();
|
||||||
public selected: string;
|
public selected: string;
|
||||||
|
disableScroll = false;
|
||||||
|
@HostListener("window:scroll", [])
|
||||||
|
onWindowScroll() {
|
||||||
|
this.scroll();
|
||||||
|
}
|
||||||
ngAfterContentInit() {
|
ngAfterContentInit() {
|
||||||
if(this.tabs.length > 0) {
|
if(this.tabs.length > 0) {
|
||||||
this.selected = this.tabs.get(0).tabId;
|
this.selected = this.tabs.get(0).tabId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectTab(tab: TabComponent){
|
selectTab(tab: TabComponent, scroll=true){
|
||||||
|
console.log("Select tab ",tab.tabId);
|
||||||
|
this.unSelectTab(this.selected, tab.tabId);
|
||||||
|
tab.active = true;
|
||||||
this.selected = tab.tabId;
|
this.selected = tab.tabId;
|
||||||
this.selectedActiveTab.emit(tab.tabId);
|
this.selectedActiveTab.emit(tab.tabId);
|
||||||
|
if(scroll) {
|
||||||
|
this.disableScroll = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
window.scrollTo({
|
||||||
|
top: document.getElementById(tab.tabId) ? document.getElementById(tab.tabId).offsetTop - 180 : 250,
|
||||||
|
behavior: 'smooth'
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
this.disableScroll = false;
|
||||||
|
}, 600);
|
||||||
|
console.log(window.scrollY, tab.tabId, document.getElementById(tab.tabId))
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scroll(){
|
||||||
|
if(this.disableScroll){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// console.log(window.scrollY)
|
||||||
|
let currentTabView = null;
|
||||||
|
let windowInnerHeight = window && window.innerHeight ? window.innerHeight : 300;
|
||||||
|
// console.log("find CT", windowInnerHeight)
|
||||||
|
for (let tab of this.tabs) {
|
||||||
|
|
||||||
|
let distanceFromCurrentViewTop = document.getElementById(tab.tabId) ? document.getElementById(tab.tabId).getBoundingClientRect().top : null;
|
||||||
|
// console.log(pos, distanceFromCurrentViewTop, windowInnerHeight/2);
|
||||||
|
if (distanceFromCurrentViewTop != null && distanceFromCurrentViewTop <= windowInnerHeight / 2) {
|
||||||
|
currentTabView = tab;
|
||||||
|
|
||||||
|
} else if (distanceFromCurrentViewTop != null && distanceFromCurrentViewTop > windowInnerHeight) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log("current currentTabView", currentTabView.tabId)
|
||||||
|
if (currentTabView && this.selected != currentTabView.tabId) {
|
||||||
|
this.selectTab(currentTabView, false);
|
||||||
|
this.disableScroll =true;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.disableScroll = false;
|
||||||
|
}, 600);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unSelectTab(oldTabId, newTabId){
|
||||||
|
for (let tab of this.tabs) {
|
||||||
|
if(tab.tabId == oldTabId){
|
||||||
|
tab.active = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.selected = newTabId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue