[Trunk | Library]: showAuthors.component.ts: Show modal with ORCID only if available and only on client mode (on server just the name).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57239 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
a8f4a8f438
commit
6105b39302
|
@ -1,8 +1,9 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Inject, Input, PLATFORM_ID} from '@angular/core';
|
||||||
import {ActivatedRoute} from "@angular/router";
|
import {ActivatedRoute} from "@angular/router";
|
||||||
import {HelperFunctions} from '../HelperFunctions.class';
|
import {HelperFunctions} from '../HelperFunctions.class';
|
||||||
import {RouterHelper} from "../routerHelper.class";
|
import {RouterHelper} from "../routerHelper.class";
|
||||||
import {EnvProperties} from '../properties/env-properties';
|
import {EnvProperties} from '../properties/env-properties';
|
||||||
|
import {isPlatformBrowser} from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'showAuthors',
|
selector: 'showAuthors',
|
||||||
|
@ -13,8 +14,8 @@ import {EnvProperties} from '../properties/env-properties';
|
||||||
</div-->
|
</div-->
|
||||||
|
|
||||||
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
|
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
|
||||||
<i *ngIf="!author.orcid || (properties.environment == 'production')">{{author.fullName}}</i
|
<i *ngIf="!author.orcid || (properties.environment == 'production') || !testBrowser">{{author.fullName}}</i
|
||||||
><a *ngIf="author.orcid && (properties.environment != 'production')" class="cursor-default"> <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}<i>{{author.fullName}}</i></a
|
><a *ngIf="author.orcid && (properties.environment != 'production') && testBrowser" class="cursor-default"> <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}<i>{{author.fullName}}</i></a
|
||||||
><div *ngIf="author.orcid && (properties.environment != 'production')" class=" default-dropdown uk-margin-remove-top uk-padding-medium"
|
><div *ngIf="author.orcid && (properties.environment != 'production')" class=" default-dropdown uk-margin-remove-top uk-padding-medium"
|
||||||
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;">
|
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;">
|
||||||
<b class="uk-margin-top">{{author.fullName}}</b>
|
<b class="uk-margin-top">{{author.fullName}}</b>
|
||||||
|
@ -92,7 +93,11 @@ export class ShowAuthorsComponent {
|
||||||
public properties:EnvProperties;
|
public properties:EnvProperties;
|
||||||
public routerHelper:RouterHelper = new RouterHelper();
|
public routerHelper:RouterHelper = new RouterHelper();
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute) {}
|
testBrowser: boolean;
|
||||||
|
|
||||||
|
constructor (private route: ActivatedRoute, @Inject(PLATFORM_ID) private platformId: string) {
|
||||||
|
this.testBrowser = isPlatformBrowser(platformId);
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
|
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||||
|
|
Loading…
Reference in New Issue