Project

General

Profile

« Previous | Next » 

Revision 56031

[Trunk|Connect]: Curators section on community page. Should check if route is enabled.

View differences:

modules/uoa-connect-portal/trunk/src/app/community/community.component.html
304 304
                <a [queryParams]=params routerLinkActive="router-link-active" routerLink="/participate/share-zenodo" >
305 305
                  <span class="lowOpacityColor">Zenodo communities </span> <span>
306 306
                    {{zenodoCommunityIdS.length + ((masterZenodoCommunity)?1:0)}}</span>{{" "}}
307
                  <span  class="uk-icon" uk-tooltip="title:<div class='uk-pargin'>Zenodo is a catch-all repository for OpenAIRE<hr>A zenodo community is created and curated by Zenodo users</div>">
307
                  <span  class="uk-icon" uk-tooltip="title:<div class='uk-margin'>Zenodo is a catch-all repository for OpenAIRE<hr>A zenodo community is created and curated by Zenodo users</div>">
308 308
                    <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><circle cx="10.44" cy="14.42" r="1.05"></circle><path fill="none" stroke="#000" stroke-width="1.2" d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path></svg>
309 309
                  </span>
310 310
                </a>
311 311
              </div>
312 312
          </div>
313
          <div class="uk-width-3-5@m uk-width-1-1@s">
314
            <div>
315
              Cuartors Section
316
              <div *ngIf="community.managers != null && community.managers[0] != '' && community.managers[0] != null"><span class="uk-text-bold"> Curated by:</span>
317
                <span *ngFor='let manager of community.managers; let i = index' >{{manager.substr(0, manager.indexOf('@'))}}<span *ngIf="manager.includes('@') == 0">{{manager}}</span><span *ngIf="i<(community.managers.length-1)">,</span>
318
                  </span>
319
              </div>
320
          </div>
313
          <div *ngIf="!isRouteEnabled('/curators')" class="uk-width-3-5@m uk-width-1-1@s uk-margin-top">
314
            <curators  [main]="false" [managers]="community.managers" [communityId]="communityId"></curators>
321 315
        </div>
322 316

  
323 317
      </div>
modules/uoa-connect-portal/trunk/src/app/community/community.module.ts
22 22
import {SearchProjectsServiceModule} from '../openaireLibrary/connect/projects/searchProjectsService.module';
23 23
import {SearchResearchResultsServiceModule} from "../openaireLibrary/services/searchResearchResultsService.module";
24 24
import {SearchResultsModule} from "../openaireLibrary/searchPages/searchUtils/searchResults.module";
25
import {CuratorsModule} from "../curators/curators.module";
25 26
import {AffiliationsModule} from "../affiliations/affiliations.module";
26 27

  
27 28
@NgModule({
......
29 30
    CommonModule, FormsModule, RouterModule,
30 31
    SubscribeModule, StatisticsModule, ManageModule, InviteModule,
31 32
    SearchZenodoCommunitiesServiceModule, ZenodoCommunitiesServiceModule, SearchFormModule, SearchDataprovidersServiceModule, SearchProjectsServiceModule,
32
    SearchResearchResultsServiceModule, SearchResultsModule, AffiliationsModule
33
    SearchResearchResultsServiceModule, SearchResultsModule, CuratorsModule, AffiliationsModule
33 34

  
34 35
  ],
35 36
  declarations: [
modules/uoa-connect-portal/trunk/src/app/curators/curators-routing.module.ts
1 1
import { NgModule}      from '@angular/core';
2 2
import { RouterModule } from '@angular/router';
3 3
import {CuratorsComponent} from "./curators.component";
4
import {FreeGuard} from "../openaireLibrary/login/freeGuard.guard";
5
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
6
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
4 7

  
5 8
@NgModule({
6 9
  imports: [
7 10
    RouterModule.forChild([
8
      { path: '', component: CuratorsComponent}
11
      { path: '', component: CuratorsComponent, canActivate: [FreeGuard/*, IsRouteEnabled*/], canDeactivate: [PreviousRouteRecorder]}
9 12
    ])
10 13
  ]
11 14
})
modules/uoa-connect-portal/trunk/src/app/curators/curators.component.html
1 1
<ng-container *ngIf="main else child">
2
  <div *ngIf="showLoading" class="uk-margin-large">
3
    <div class="uk-animation-fade uk-margin-top  uk-width-1-1" role="alert"><span class="loading-gif  uk-align-center" ></span></div>
4
  </div>
5
  <div *ngIf="!showLoading" class="image-front-topbar  uk-section-default uk-position-relative" uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}" tm-header-transparent="light">
2
  <div class="image-front-topbar  uk-section-default uk-position-relative" uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}" tm-header-transparent="light">
6 3
    <div style=" min-height: 650px;"  class="uk-section uk-padding-remove-bottom uk-flex uk-flex-middle">
7 4
      <div class="uk-margin-top uk-align-center">
8 5
        <div class="uk-section uk-section-small">
9 6
          <div class="uk-container uk-container-small">
10
            <div *ngIf="curators.length > 0">
7
            <div *ngIf="showLoading" class="uk-margin-large">
8
              <div class="uk-animation-fade uk-margin-top  uk-width-1-1" role="alert"><span class="loading-gif  uk-align-center" ></span></div>
9
            </div>
10
            <div *ngIf="!showLoading && curators.length > 0">
11 11
              <h4 class="uk-margin-top uk-h4">
12 12
                <span class="uk-text-bold">Curators</span>
13 13
                <span> ({{curators.length}})</span>
14 14
              </h4>
15
              <div *ngFor="let curator of curators let i=index;" class="uk-width-1-1 uk-card uk-card-default uk-card-body uk-margin-top">
16
                <div [class]="(curator.affiliations.length > 0 && curator.affiliations.length <= 2)?'uk-grid-divider':''" uk-grid>
15
              <div *ngFor="let curator of curators let i=index;" class="uk-width-1-1 uk-card uk-card-default uk-card-body uk-margin-top uk-animation-slide-top">
16
                <div [class]="(curator.affiliations.length > 0 && curator.affiliations.length <= 2)?'uk-grid-divider uk-flex uk-flex-middle':''" uk-grid>
17 17

  
18 18
                  <div class="uk-width-1-2 uk-first-column">
19 19
                    <div class="uk-flex uk-flex-middle">
......
70 70
  </div>
71 71
</ng-container>
72 72
<ng-template #child>
73

  
74
</ng-template>
75
<!--
76
<span *ngIf="authors != undefined">
77
        <div *ngIf="showAll && numberOfAuthors > authorsLimit">
78
          <a (click)="numberOfAuthors = authorsLimit;">View less authors</a>
79
        </div>
80

  
81
        <span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
82
          <i *ngIf="!author.orcid || (properties.environment != 'beta' && properties.environment != 'development')">{{author.fullName}}</i
83
          ><a *ngIf="author.orcid && (properties.environment == 'beta' || properties.environment == 'development')"><i>{{author.fullName}}</i></a
84
        ><div *ngIf="author.orcid && (properties.environment == 'beta' || properties.environment == 'development')" class=" default-dropdown uk-margin-remove-top uk-padding-medium"
85
              uk-dropdown="pos: bottom-left; mode:hover" style="min-width: 70px !important;">
86
            <b class="uk-margin-top">{{author.fullName}}</b>
87

  
88
            <div>
89
              <div class="uk-text-muted">ORCID</div>
90
              <span><code class="uk-padding-small" [id]="'orcid_clipboard_auhtor_'+i">{{author.orcid}}</code></span>
91
              <span>
92
                <button [class]="'uk-icon-clipboard uk-button uk-button-primary uk-button-small orcid_clipboard_btn_auhtor_'+i"
93
                        [attr.data-clipboard-target]="'#orcid_clipboard_auhtor_'+i" title="Copy to clipboard">
94
                  Copy
95
                </button>
96
                <a class="uk-button uk-button-primary uk-button-small" title="Visit author in Orcid"
97
                   [href]="properties.orcidURL+author.orcid" target="_blank">
98
                  Visit
99
                </a>
73
  <div uk-grid>
74
    <span class="lowOpacityColor  uk-width-1-1">
75
      Curators
76
    </span>
77
    <div *ngFor="let curator of curators let i=index;" class="uk-flex uk-flex-middle uk-width-1-2">
78
      <div>
79
        <img *ngIf="curator.photo && curator.photo !== ''" class="uk-border-circle curator-photo" src="{{downloadUrl + curator.photo}}" alt="Curator Photo">
80
        <img *ngIf="!curator.photo || curator.photo == ''" class="uk-border-circle curator-photo" src="../../assets/common-assets/curator-default.png" alt="Curator Photo">
81
      </div>
82
      <span class="uk-width-expand uk-margin-left">
83
        <a>{{curator.name}}</a>
84
        <div class="default-dropdown uk-margin-remove-top uk-padding-medium uk-width-medium communityPanelBackground"
85
             uk-dropdown="pos: bottom-left; mode:click; animation: uk-animation-slide-top-small; duration: 1000">
86
          <div uk-grid>
87
            <div class="uk-first-column uk-flex uk-flex-middle" uk-grid>
88
              <div>
89
                <img *ngIf="curator.photo && curator.photo !== ''" class="uk-border-circle curator-photo" src="{{downloadUrl + curator.photo}}" alt="Curator Photo">
90
                <img *ngIf="!curator.photo || curator.photo == ''" class="uk-border-circle curator-photo" src="../../assets/common-assets/curator-default.png" alt="Curator Photo">
91
              </div>
92
              <div class="uk-width-expand uk-h5">
93
                {{curator.name}}
94
              </div>
95
            </div>
96
            <div *ngIf="curator.affiliations.length > 0" class="uk-width-1-1">
97
              <span class="uk-text-left lowOpacityColor uk-margin">
98
                Affiliations
100 99
              </span>
100
              <div class="uk-width-1-1">
101
                <affiliations [affiliations]="curator.affiliations"
102
                              [affiliationsInSlider]="2"
103
                              [arrows]="false"
104
                              [sliderOptions]="'autoplay: true; autoplay-interval: 2000'"></affiliations>
105
              </div>
101 106
            </div>
102

  
103
            <hr>
104
            <div class="uk-margin-top">
105
              Search <b>{{author.fullName}}</b> by <b>ORCID</b> in OpenAIRE's
106
            </div>
107
            <div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
108
              <a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
109
                 [queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/publications">
110
                  Publications
107
            <div class="uk-width-1-1">
108
              <a routerLink="/curators" class="uk-align-right uk-link">
109
                Show all details
111 110
              </a>
112 111
            </div>
113
            <div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
114
              <a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
115
                 [queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/datasets">
116
                  Research Data
117
              </a>
118
            </div>
119
            <div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
120
              <a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
121
                 [queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/software">
122
                  Software
123
              </a>
124
            </div>
125
            <div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
126
              <a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
127
                 [queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])" routerLinkActive="router-link-active" routerLink="/search/advanced/other">
128
                  Other Research Products
129
              </a>
130
            </div>
131
          </div
132
          ><span>;{{" "}}</span>
133
        </span>
134
        <span *ngIf="numberOfAuthors == authorsLimit && authors.length > authorsLimit">	... </span>
135
        <span *ngIf="showAll && numberOfAuthors == authorsLimit && authors.length > authorsLimit">
136
          <a (click)="numberOfAuthors = authors.length;">
137
            view all {{authors.length | number}} authors
138
          </a>
139
        </span>
140
        <span *ngIf="showAll && numberOfAuthors > authorsLimit">
141
          <a (click)="numberOfAuthors = authorsLimit; scroll()">View less authors</a>
142
        </span>
112
          </div>
113
        </div>
143 114
      </span>
144
-->
115
    </div>
116
  </div>
117
</ng-template>
modules/uoa-connect-portal/trunk/src/app/curators/curators.component.ts
8 8
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
9 9

  
10 10
@Component({
11
  selector: 'showAuthors',
11
  selector: 'curators',
12 12
  templateUrl: './curators.component.html'
13 13

  
14 14
})
......
36 36
      this.showLoading = true;
37 37
      this.properties = data.envSpecific;
38 38
      this.downloadUrl = this.properties.downloadUrl;
39
      console.log(this.downloadUrl)
40 39
      if(!this.main) {
41 40
        let emails = this.managers.join();
42 41
        console.log(emails);
43 42
        this.curatorsService.getCurators(this.properties,
44
          this.properties.adminToolsAPIURL + 'curator?emails=' + emails).subscribe(curators => {
43
          this.properties.adminToolsAPIURL + '/curator?emails=' + emails).subscribe(curators => {
45 44
          this.curators = curators;
46 45
          for(let i = 0; i < this.curators.length; i++) {
47 46
            this.showMore[i]= false;
......
75 74
            this.managers = community[0].managers;
76 75
            let emails = this.managers.join();
77 76
            this.curatorsService.getCurators(this.properties,
78
              this.properties.adminToolsAPIURL + 'curator?emails=' + emails).subscribe(curators => {
77
              this.properties.adminToolsAPIURL + '/curator?emails=' + emails).subscribe(curators => {
79 78
              this.curators = curators;
80 79
              for(let i = 0; i < this.curators.length; i++) {
81 80
                this.showMore[i]= false;
modules/uoa-connect-portal/trunk/src/app/curators/curators.module.ts
1
import { NgModule}      from '@angular/core';
1
import { NgModule} from '@angular/core';
2 2
import { CommonModule } from '@angular/common';
3 3
import { FormsModule }  from '@angular/forms';
4 4
import { RouterModule } from '@angular/router';
......
21 21
    CuratorsComponent
22 22
  ]
23 23
})
24
export class CuratorsModule {
25
  static forChild(): NgModule {
26
    return {
27
      imports: [
28
        CommonModule, FormsModule,
29
      ],
30
      declarations: [
31
        CuratorsComponent
32
      ],
33
      providers: [CuratorService],
34
      exports: [
35
        CuratorsComponent
36
      ]
37
    }
38
  }
39
}
24
export class CuratorsModule {}
modules/uoa-connect-portal/trunk/src/app/affiliations/affiliations.component.html
69 69
<!--  </div>-->
70 70
  <!--    uk-slider="center: true"-->
71 71

  
72
  <div *ngIf="(!fullView)" class="uk-position-relative uk-visible-toggle" tabindex="-1" uk-slider>
72
  <div *ngIf="(!fullView)" class="uk-position-relative uk-visible-toggle" tabindex="-1" [attr.uk-slider]="sliderOptions">
73 73
    <ul class="uk-slider-items uk-grid-small" uk-height-match="target: > li > .uk-card" uk-grid>
74 74
      <li *ngFor="let affiliation of affiliations" [class]="'uk-width-1-'+affiliationsInSlider">
75 75
        <div class="uk-card uk-card-small uk-card-default uk-flex uk-flex-middle uk-flex-center"
......
83 83
        </div>
84 84
      </li>
85 85
    </ul>
86
    <a *ngIf="(affiliations.length > affiliationsInSlider)"
86
    <a *ngIf="(affiliations.length > affiliationsInSlider) && arrows"
87 87
        class="uk-position-center-left uk-position-small uk-hidden-hover" href="#" uk-slidenav-previous uk-slider-item="previous"></a>
88
    <a *ngIf="(affiliations.length > affiliationsInSlider)"
88
    <a *ngIf="(affiliations.length > affiliationsInSlider) && arrows"
89 89
        class="uk-position-center-right uk-position-small uk-hidden-hover" href="#" uk-slidenav-next uk-slider-item="next"></a>
90 90
  </div>
91 91
</ng-container>
92 92

  
93
<div *ngIf="affiliations.length == 0 && fullView" class="uk-animation-fade uk-alert uk-alert-primary" role="alert">
94
  No affiliations available
95
</div>
93
<!--<div *ngIf="affiliations.length == 0 && fullView" class="uk-animation-fade uk-alert uk-alert-primary" role="alert">-->
94
<!--  No affiliations available-->
95
<!--</div>-->
modules/uoa-connect-portal/trunk/src/app/affiliations/affiliations.component.ts
15 15
  @Input() fullView: boolean = false;
16 16
  @Input() affiliationsInSlider: number = 5;
17 17
  @Input() affiliations: Affiliation[] = [];
18
  @Input() sliderOptions = '';
19
  @Input() arrows = true;
18 20

  
19 21
  communityId: string;
20 22
  properties:EnvProperties;

Also available in: Unified diff