Revision 57239
Added by Konstantina Galouni over 4 years ago
showAuthors.component.ts | ||
---|---|---|
1 |
import {Component, Input} from '@angular/core';
|
|
1 |
import {Component, Inject, Input, PLATFORM_ID} from '@angular/core';
|
|
2 | 2 |
import {ActivatedRoute} from "@angular/router"; |
3 | 3 |
import {HelperFunctions} from '../HelperFunctions.class'; |
4 | 4 |
import {RouterHelper} from "../routerHelper.class"; |
5 | 5 |
import {EnvProperties} from '../properties/env-properties'; |
6 |
import {isPlatformBrowser} from "@angular/common"; |
|
6 | 7 |
|
7 | 8 |
@Component({ |
8 | 9 |
selector: 'showAuthors', |
... | ... | |
13 | 14 |
</div--> |
14 | 15 |
|
15 | 16 |
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index"> |
16 |
<i *ngIf="!author.orcid || (properties.environment == 'production')">{{author.fullName}}</i |
|
17 |
><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 |
|
17 |
<i *ngIf="!author.orcid || (properties.environment == 'production') || !testBrowser">{{author.fullName}}</i
|
|
18 |
><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
|
|
18 | 19 |
><div *ngIf="author.orcid && (properties.environment != 'production')" class=" default-dropdown uk-margin-remove-top uk-padding-medium" |
19 | 20 |
uk-dropdown="pos: bottom-left; mode:click" style="min-width: 70px !important;"> |
20 | 21 |
<b class="uk-margin-top">{{author.fullName}}</b> |
... | ... | |
92 | 93 |
public properties:EnvProperties; |
93 | 94 |
public routerHelper:RouterHelper = new RouterHelper(); |
94 | 95 |
|
95 |
constructor (private route: ActivatedRoute) {}
|
|
96 |
testBrowser: boolean;
|
|
96 | 97 |
|
98 |
constructor (private route: ActivatedRoute, @Inject(PLATFORM_ID) private platformId: string) { |
|
99 |
this.testBrowser = isPlatformBrowser(platformId); |
|
100 |
} |
|
101 |
|
|
97 | 102 |
ngOnInit() { |
98 | 103 |
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => { |
99 | 104 |
this.properties = data.envSpecific; |
Also available in: Unified diff
[Trunk | Library]: showAuthors.component.ts: Show modal with ORCID only if available and only on client mode (on server just the name).