1 |
55412
|
konstantin
|
import {Component, Input, OnInit} from '@angular/core';
|
2 |
57073
|
k.triantaf
|
import {Session, User} from '../../openaireLibrary/login/utils/helper.class';
|
3 |
56290
|
k.triantaf
|
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
4 |
|
|
import {ActivatedRoute} from '@angular/router';
|
5 |
|
|
import {EnvironmentSpecificService} from '../../openaireLibrary/utils/properties/environment-specific.service';
|
6 |
|
|
import {CommunitiesService} from '../../openaireLibrary/connect/communities/communities.service';
|
7 |
|
|
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo';
|
8 |
|
|
import {HelperFunctions} from '../../openaireLibrary/utils/HelperFunctions.class';
|
9 |
57073
|
k.triantaf
|
import {UserManagementService} from '../../openaireLibrary/services/user-management.service';
|
10 |
58371
|
k.triantaf
|
import {Title} from '@angular/platform-browser';
|
11 |
53600
|
argiro.kok
|
|
12 |
|
|
@Component({
|
13 |
56290
|
k.triantaf
|
selector: 'wellcome',
|
14 |
|
|
template: `
|
15 |
56753
|
k.triantaf
|
<div
|
16 |
|
|
class="image-front-topbar wellcomePage uk-background-norepeat uk-background-cover uk-background-top-center uk-section uk-padding-remove-bottom"
|
17 |
|
|
uk-scrollspy="{"target":"[uk-scrollspy-class]","cls":"uk-animation-fade","delay":false}"
|
18 |
|
|
tm-header-transparent="light" tm-header-transparent-placeholder=""
|
19 |
|
|
uk-height-viewport="offset-top: true">
|
20 |
57020
|
k.triantaf
|
<div class="uk-container uk-container-large uk-section">
|
21 |
57090
|
k.triantaf
|
<div *ngIf="showLoading" class="uk-animation-fade uk-container uk-container-large uk-section uk-margin-top uk-width-1-1" role="alert"><span
|
22 |
57020
|
k.triantaf
|
class="loading-gif uk-align-center"></span></div>
|
23 |
|
|
<div *ngIf="communities.length == 0 && !showLoading" class="uk-container uk-container-large uk-section uk-margin-top">
|
24 |
|
|
<div class="uk-width-1-2@m uk-width-1-1@s">
|
25 |
|
|
<div class="uk-h1">Build an Open Research <b>Gateway</b> for your <b>Community</b></div>
|
26 |
|
|
<h4 class="uk-margin-remove-top">Turn Open Science into practice</h4>
|
27 |
|
|
<div class="uk-h5 uk-margin-top">Share and link your research results.<br>
|
28 |
|
|
Across organizations, across borders.<br>Customized to your needs.
|
29 |
|
|
</div>
|
30 |
56290
|
k.triantaf
|
</div>
|
31 |
57020
|
k.triantaf
|
<div class="uk-width-1-1 uk-inline uk-margin-large-top uk-margin-large-bottom">
|
32 |
|
|
<a class="uk-button portal-button" href="https://beta.connect.openaire.eu/about"> LEARN
|
33 |
|
|
HOW</a>
|
34 |
|
|
</div>
|
35 |
56753
|
k.triantaf
|
</div>
|
36 |
57020
|
k.triantaf
|
<div *ngIf="communities.length > 0 && !showLoading" class="uk-container uk-container-large uk-section-small">
|
37 |
|
|
<div class="uk-container">
|
38 |
|
|
<div class="uk-grid-match uk-grid-small uk-child-width-1-4@m uk-child-width-1-2@s uk-child-width-1-1@xs
|
39 |
56753
|
k.triantaf
|
uk-text-center uk-margin-large-top" uk-grid uk-height-match="div > div > .uk-card-media-top">
|
40 |
57020
|
k.triantaf
|
<div *ngFor="let community of communities;">
|
41 |
|
|
<div class="uk-padding-small uk-card uk-card-small uk-card-default communityCard">
|
42 |
|
|
<div class="uk-container uk-text-small" *ngIf="community">
|
43 |
|
|
<div class="uk-card-media-top uk-padding uk-padding-remove-vertical target uk-flex uk-flex-center uk-flex-middle">
|
44 |
|
|
<a [queryParams]="{communityId: community.communityId}" routerLinkActive="router-link-active"
|
45 |
|
|
routerLink="/dashboard">
|
46 |
|
|
<div>
|
47 |
|
|
<img *ngIf="community.logoUrl != null && community.logoUrl != '' " src="{{community.logoUrl}}"
|
48 |
|
|
alt="{{(community.title)?community.title:community.shortTitle}} logo">
|
49 |
|
|
<span *ngIf="community.logoUrl == null || community.logoUrl == '' " class="uk-icon">
|
50 |
56753
|
k.triantaf
|
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="2.5"> <circle fill="none"
|
51 |
|
|
stroke="#000"
|
52 |
|
|
stroke-width="1.1"
|
53 |
|
|
cx="7.7"
|
54 |
|
|
cy="8.6"
|
55 |
|
|
r="3.5"></circle> <path
|
56 |
|
|
fill="none" stroke="#000" stroke-width="1.1"
|
57 |
|
|
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path> <path fill="none"
|
58 |
|
|
stroke="#000"
|
59 |
|
|
stroke-width="1.1"
|
60 |
|
|
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg>
|
61 |
|
|
</span>
|
62 |
57020
|
k.triantaf
|
</div>
|
63 |
|
|
</a>
|
64 |
|
|
</div>
|
65 |
|
|
<div class="uk-card-body uk-padding-remove-horizontal uk-padding-remove-top uk-margin-small-top target">
|
66 |
|
|
<a [queryParams]="{communityId: community.communityId}" routerLinkActive="router-link-active"
|
67 |
|
|
routerLink="/dashboard">
|
68 |
|
|
<div class="uk-text-center uk-text-bold">
|
69 |
56753
|
k.triantaf
|
<span class="uk-text-small uk-margin-small" *ngIf="community.title">
|
70 |
|
|
{{community.title}}
|
71 |
|
|
</span>
|
72 |
57020
|
k.triantaf
|
<span class="uk-text-small uk-margin-small" *ngIf="!community.title && community.shortTitle">
|
73 |
56753
|
k.triantaf
|
{{community.shortTitle}}
|
74 |
|
|
</span>
|
75 |
57020
|
k.triantaf
|
</div>
|
76 |
|
|
</a>
|
77 |
|
|
</div>
|
78 |
56753
|
k.triantaf
|
</div>
|
79 |
56290
|
k.triantaf
|
</div>
|
80 |
|
|
</div>
|
81 |
|
|
</div>
|
82 |
|
|
</div>
|
83 |
56753
|
k.triantaf
|
</div>
|
84 |
56290
|
k.triantaf
|
</div>
|
85 |
56753
|
k.triantaf
|
</div>
|
86 |
56290
|
k.triantaf
|
`
|
87 |
53600
|
argiro.kok
|
})
|
88 |
|
|
|
89 |
55412
|
konstantin
|
export class WellcomeComponent implements OnInit {
|
90 |
|
|
properties: EnvProperties = null;
|
91 |
|
|
public communities: CommunityInfo[] = [];
|
92 |
57020
|
k.triantaf
|
showLoading: boolean;
|
93 |
57073
|
k.triantaf
|
private user: User;
|
94 |
53600
|
argiro.kok
|
|
95 |
57073
|
k.triantaf
|
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService, private _communitiesService: CommunitiesService,
|
96 |
58371
|
k.triantaf
|
private title: Title,
|
97 |
57073
|
k.triantaf
|
private userManagementService: UserManagementService) {
|
98 |
56290
|
k.triantaf
|
}
|
99 |
55412
|
konstantin
|
|
100 |
|
|
ngOnInit() {
|
101 |
57020
|
k.triantaf
|
this.showLoading = true;
|
102 |
58371
|
k.triantaf
|
this.title.setTitle('Administration Dashboard | OpenAIRE-Connect');
|
103 |
55412
|
konstantin
|
this.propertiesService.loadEnvironment().then(es => {
|
104 |
|
|
this.propertiesService.setEnvProperties(es);
|
105 |
|
|
this.properties = this.propertiesService.envSpecific;
|
106 |
55416
|
konstantin
|
HelperFunctions.scroll();
|
107 |
57947
|
k.triantaf
|
this.userManagementService.getUserInfo().subscribe(user => {
|
108 |
57073
|
k.triantaf
|
this.user = user;
|
109 |
|
|
this._communitiesService.getCommunitiesState().subscribe(
|
110 |
|
|
communities => {
|
111 |
58584
|
k.triantaf
|
this.communities = [];
|
112 |
57073
|
k.triantaf
|
if (!communities || communities.length === 0) {
|
113 |
|
|
return;
|
114 |
|
|
}
|
115 |
|
|
var countCommunities = 0;
|
116 |
|
|
var index_managerOfCommunity = null;
|
117 |
|
|
for (var i = 0; i < communities.length; i++) {
|
118 |
|
|
var com = communities[i];
|
119 |
|
|
if (Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user)) {
|
120 |
|
|
this.communities.push(communities[i]);
|
121 |
|
|
} else {
|
122 |
|
|
for (var manager of com.managers) {
|
123 |
|
|
if (this.user && manager == this.user.email) {
|
124 |
|
|
countCommunities++;
|
125 |
|
|
index_managerOfCommunity = i;
|
126 |
|
|
this.communities.push(communities[i]);
|
127 |
|
|
break;
|
128 |
|
|
}
|
129 |
55412
|
konstantin
|
}
|
130 |
|
|
}
|
131 |
|
|
}
|
132 |
57073
|
k.triantaf
|
this.showLoading = false;
|
133 |
|
|
});
|
134 |
|
|
});
|
135 |
55412
|
konstantin
|
});
|
136 |
|
|
}
|
137 |
53600
|
argiro.kok
|
}
|