Project

General

Profile

« Previous | Next » 

Revision 58717

[Trunk | Library]:
1. searchResult.component: Field 'dividerNotCard' added to show results in card or not.
2. project.component: Initial commit for landing pages redesign (more to follow).

View differences:

project.component.ts
73 73

  
74 74
  @ViewChild('statisticsModal') statisticsModal;
75 75

  
76
  @ViewChild('linkProjectModal') linkProjectModal;
77
  @ViewChild('shareResultsModal') shareResultsModal;
78
  @ViewChild('downloadReportModal') downloadReportModal;
79

  
76 80
  // Request results for publications, research data and software only the one time (first time tab is clicked)
77 81
  private reloadPublications: boolean = true;
78 82
  private reloadDatasets: boolean = true;
......
472 476
    this.statisticsModal.open();
473 477
  }
474 478

  
479
  public openLinkProjectModal() {
480
    this.linkProjectModal.cancelButton = false;
481
    this.linkProjectModal.okButton = false;
482
    this.linkProjectModal.alertTitle = "Link this project to";
483
    this.linkProjectModal.open();
484
  }
485

  
486
  public openShareResultsModal() {
487
    this.shareResultsModal.cancelButton = false;
488
    this.shareResultsModal.okButton = false;
489
    this.shareResultsModal.alertTitle = "Share results";
490
    this.shareResultsModal.open();
491
  }
492

  
493
  public openDownloadReportModal() {
494
    this.downloadReportModal.cancelButton = false;
495
    this.downloadReportModal.okButton = false;
496
    this.downloadReportModal.alertTitle = "Download report";
497
    this.downloadReportModal.open();
498
  }
499

  
475 500
  private createHeaders(type: string) {
476 501
    this.openLoading();
477 502
    this.setMessageLoading("Downloading HTML file");
......
637 662
  //   }
638 663
  // }
639 664

  
665
  public onSelectActiveTab(activeTabId) {
666
    if(this.activeTab != "activaTabId") {   // tab really changed
667
      if (activeTabId == 'summary') {
668
        this.activeTab = 'summary';
669
      } else if (activeTabId == 'publications') {
670
        this.activeTab = 'publications';
671
        this.searchPublicationsInit();
672
      } else if (activeTabId == 'datasets') {
673
        this.activeTab = 'datasets';
674
        this.searchDatasetsInit();
675
      } else if (activeTabId == 'software') {
676
        this.activeTab = 'software';
677
        this.searchSoftwareInit();
678
      } else if (activeTabId == 'other') {
679
        this.activeTab = "other";
680
        this.searchOrpsInit();
681
      } else if (activeTabId == 'statistics') {
682
        this.activeTab = 'statistics';
683
        this.statsClicked = true;
684
      }
685
    }
686
    console.log(activeTabId);
687
  }
688

  
640 689
  private updateDescription(description: string) {
641 690
    this._meta.updateTag({content: description.substring(0, 160)}, "name='description'");
642 691
    this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'");
......
696 745
    }
697 746
    return false;
698 747
  }
748

  
749
  private getEntityName (entityType:string, plural:boolean, full:boolean): string {
750
    if(entityType == "publication") {
751
      return "publication" + (plural ? "s" : "");
752
    } else if(entityType == "dataset") {
753
      return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
754
    } else if(entityType == "software") {
755
      return "software";
756
    } else if(entityType == "other") {
757
      return (full ? ("other research product" + (plural ? "s" : "")) : "other");
758
    } else if(entityType == "dataprovider") {
759
      return (full ? ("content provider" + (plural ? "s" : "")) : "dataprovider" + (plural ? "s" : ""));
760
    } else {
761
      return entityType + (plural ? "s" : "");
762
    }
763
  }
699 764
}

Also available in: Unified diff