diff --git a/landingPages/landing-utils/landing-header/landing-header.component.ts b/landingPages/landing-utils/landing-header/landing-header.component.ts index 9e0f89de..cab6d945 100644 --- a/landingPages/landing-utils/landing-header/landing-header.component.ts +++ b/landingPages/landing-utils/landing-header/landing-header.component.ts @@ -7,8 +7,8 @@ import {AlertModal} from "../../../utils/modal/alert"; selector: 'landing-header', template: `
-
- +
+ {{entityType}} @@ -51,10 +51,10 @@ import {AlertModal} from "../../../utils/modal/alert";
- +
- +
` }) @@ -70,7 +70,7 @@ export class LandingHeaderComponent { @Input() title: string; @Input() subTitle: string; @Input() authors: Author[]; - @Input() authorLimit: number = 30; + @Input() authorLimit: number = 3; @Input() showAllAuthors: boolean = true; @Input() underCuration: boolean = false; @Input() modal: AlertModal; diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index 5b643237..9af47660 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -1,4 +1,4 @@ -import {Component, Inject, Input, PLATFORM_ID} from '@angular/core'; +import {Component, EventEmitter, Inject, Input, Output, PLATFORM_ID, ViewChild} from '@angular/core'; import {ActivatedRoute} from "@angular/router"; import {HelperFunctions} from '../HelperFunctions.class'; import {RouterHelper} from "../routerHelper.class"; @@ -11,88 +11,105 @@ import {properties} from "../../../../environments/environment"; @Component({ selector: 'showAuthors', template: ` -
- - - {{author.fullName + "; "}} - - + + + {{author.fullName + ";"}}  + + + + orcid + orcid bw  - orcid{{" "}} - orcid bw{{" "}} - - {{author.fullName + "; "}} - + {{author.fullName + ";"}}  - -
- {{author.fullName}} -
-
ORCID
- -
- {{" "}} - {{" "}} + + +
+
+
{{author.fullName}}
+
+
ORCID
- Harvested from ORCID Public Data File - Derived by OpenAIRE algorithms or harvested from 3d party repositories +
+ {{" "}} + {{" "}} + + Harvested from ORCID Public Data File + Derived by OpenAIRE algorithms or harvested from 3d party repositories +
+ + - -
-
- Search {{author.fullName}} in OpenAIRE -
- +
+ +
+
+ {{author.fullName}} in OpenAIRE +
+
- - ... +
+ + + - -
+ + + +
+ + + +
+
` }) export class ShowAuthorsComponent { @Input() authors: Author[]; - @Input() authorsLimit: number = 30; + @Input() authorsLimit: number = 3; @Input() showAll: boolean = true; - @Input() small: boolean = true; @Input() modal: AlertModal; - + @Input() viewAll: boolean = false; + public lessBtn: boolean = false; + @ViewChild('authorsModal') authorsModal; + public numberOfAuthors: number; public properties: EnvProperties = properties; public routerHelper: RouterHelper = new RouterHelper(); @@ -119,4 +136,20 @@ export class ShowAuthorsComponent { this.modal.cancel(); } } + + public viewAllClick() { + if(this.authors.length <= this.authorsLimit*2) { + this.viewAll = true; + this.lessBtn = true; + } else { + this.openAuthorsModal(); + } + } + + public openAuthorsModal() { + this.authorsModal.cancelButton = false; + this.authorsModal.okButton = false; + this.authorsModal.alertTitle = "Authors"; + this.authorsModal.open(); + } } diff --git a/utils/authors/showAuthors.module.ts b/utils/authors/showAuthors.module.ts index 0c7f72d3..a9cd2e12 100644 --- a/utils/authors/showAuthors.module.ts +++ b/utils/authors/showAuthors.module.ts @@ -4,10 +4,11 @@ import {FormsModule} from '@angular/forms'; import {RouterModule} from '@angular/router'; import {ShowAuthorsComponent} from './showAuthors.component'; +import {AlertModalModule} from "../modal/alertModal.module"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule + CommonModule, FormsModule, RouterModule, AlertModalModule ], declarations: [ ShowAuthorsComponent