[Trunk|Connect]: Add help texts on home,about,learnInDepth and contact us. Add new page /helper-test for testing.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@56621 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-07-18 11:36:05 +00:00
parent 8c5a145351
commit 5158bac47e
14 changed files with 396 additions and 251 deletions

View File

@ -54,6 +54,7 @@ const routes: Routes = [
{ path: 'user-info', loadChildren: './login/libUser.module#LibUserModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'error', component: OpenaireErrorPageComponent, resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'theme', component: ThemeComponent},
{ path: 'helper-test', loadChildren: './helper-test/helper-test.module#HelperTestModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: '**',pathMatch: 'full',component: OpenaireErrorPageComponent, resolve: { envSpecific: EnvironmentSpecificResolver }}
];

View File

@ -1,4 +1,4 @@
<div [ngClass]="(managerOfCommunities.length > 0 || subscriberOfCommunities.length > 0)?'banner-background':'home-banner'" class="image-front-topbar uk-section uk-background-norepeat uk-background-bottom-center uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color" 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" tm-header-transparent-placeholder="">
<div *ngIf="(managerOfCommunities.length > 0 || subscriberOfCommunities.length > 0)" class="banner-background image-front-topbar uk-section uk-background-norepeat uk-background-bottom-center uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color" 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" tm-header-transparent-placeholder="">
<div class=" uk-section uk-padding-remove-bottom">
<div class="uk-position-cover"></div>
<div class="uk-position-relative uk-panel">
@ -59,7 +59,17 @@
<img width="296" height="285" src="../../assets/banner/login.png">
</div>
</div>
<div *ngIf="managerOfCommunities.length == 0 && subscriberOfCommunities.length == 0" class="uk-grid">
</div>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['top']" [texts]="pageContents['top']"></helper>
<div *ngIf="(managerOfCommunities.length == 0 && subscriberOfCommunities.length == 0)" class="home-banner image-front-topbar uk-section uk-background-norepeat uk-background-bottom-center uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color" 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" tm-header-transparent-placeholder="">
<div class=" uk-section uk-padding-remove-bottom">
<div class="uk-position-cover"></div>
<div class="uk-position-relative uk-panel">
<div class="uk-container uk-container-large uk-section">
<div class="uk-grid">
<div class="uk-width-1-2@m uk-width-1-1@s">
<h1 class="font-41">Build an Open Research <b>Gateway</b> for your <b>Community</b></h1>
<h4 class="uk-margin-remove-top">Turn Open Science into practice</h4>
@ -67,25 +77,23 @@
Across organizations, across borders.<br>Customized to your needs.</div>
</div>
<div class="uk-width-1-1 uk-inline uk-margin-medium-top uk-margin-medium-bottom">
<a class="uk-button portal-button" routerLink="/about" routerLinkActive="router-link-active"> LEARN
HOW</a>
<a class="uk-button portal-button" routerLink="/about" routerLinkActive="router-link-active"> LEARN
HOW</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div *ngIf="!loading">
<div class="uk-margin-large-bottom uk-margin-large-top">
<div class="uk-container uk-container-large uk-margin-medium-bottom">
<h1 class="uk-text-center uk-text-bold">Open and FAIR science is our mission</h1>
</div>
<div class="uk-container uk-container-large" uk-height-match=".target">
<div>
<div class="uk-container uk-container-large uk-margin-large-top">
<h1 class="uk-text-center uk-text-bold">Open and FAIR science is our mission</h1>
<div class="uk-margin-medium-top" uk-height-match=".target">
<div class="uk-child-width-1-3@m uk-child-width-1-1@s uk-grid-match uk-grid-medium uk-grid-margin" uk-grid>
<div>
<div class="uk-card uk-card-default connectInfoCard">
<div class="uk-card-media-top uk-margin-top target">
<img src="../../assets/home/1.png" class="uk-align-center" width="111" height="138">
<img src="assets/home/1.png" class="uk-align-center" width="111" height="138">
</div>
<div class="uk-card-body uk-grid-divider uk-margin-top" uk-grid>
<div class="uk-width-1-1 uk-text-center target">
@ -182,48 +190,46 @@
</div>
</div>
</div>
</div>
<div class="uk-margin-large-top home-background uk-section uk-background-norepeat uk-background-top-center uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color">
<div class="uk-container uk-container-large">
<gif-slider [gifs]="gifs" [link]="true" [linkTitle]="'learn more'" [route]="'/about'">
</gif-slider>
</div>
</div>
<div class="uk-container uk-container-large">
<errorMessages [status]="[status]" [type]="'communities'"></errorMessages>
</div>
<div class="uk-container uk-container-large uk-margin-large-top">
<errorMessages [status]="[status]" [type]="'communities'"></errorMessages>
</div>
</div>
<div *ngIf="loading" class="uk-container uk-container-large uk-height-large">
<div class="uk-animation-fade uk-margin-top uk-width-1-2" role="alert"><span class="loading-gif uk-align-center" ></span></div>
</div>
<div *ngIf= "!loading && researchCommunities.length > 0" class="uk-container uk-container-large">
<h1 class="uk-text-bold">Community Gateways in Action</h1>
<div [class]="'uk-margin-medium-top' + (researchCommunities.length <= 5 ? ' uk-margin-medium-bottom' : '')">
<div *ngIf="loading" class="uk-container uk-container-large uk-height-large uk-margin-large-top uk-margin-medium-bottom">
<div class="uk-animation-fade uk-margin-top uk-width-1-2" role="alert"><span class="loading-gif uk-align-center" ></span></div>
</div>
<div *ngIf= "!loading && researchCommunities.length > 0" class="uk-container uk-container-large uk-margin-large-top uk-margin-medium-bottom">
<h1 class="uk-text-bold">Community Gateways in Action</h1>
<div [class]="'uk-margin-medium-top' + (researchCommunities.length <= 5 ? ' uk-margin-medium-bottom' : '')">
<div class="uk-grid-match uk-grid-medium uk-child-width-1-5@m uk-child-width-1-2@s uk-child-width-1-1@xs uk-text-center" uk-grid uk-height-match=".community">
<div *ngFor="let community of researchCommunities.slice(0, 5); let i = index">
<div class="uk-padding-small uk-padding-remove-vertical uk-height-max-large uk-card uk-card-default communityCard">
<browse-community [community]=community></browse-community>
</div>
</div>
</div>
</div>
<div class="uk-text-right uk-margin-top">
<!--[queryParams]="{type: quote('community')}"-->
<a *ngIf="researchCommunities.length > 5" class="portal-color uk-text-uppercase uk-text-bold"
routerLinkActive="router-link-active" routerLink="/search/find/communities">
Browse All >
</a>
<div class="uk-grid-match uk-grid-medium uk-child-width-1-5@m uk-child-width-1-2@s uk-child-width-1-1@xs uk-text-center" uk-grid uk-height-match=".community">
<div *ngFor="let community of researchCommunities.slice(0, 5); let i = index">
<div class="uk-padding-small uk-padding-remove-vertical uk-height-max-large uk-card uk-card-default communityCard">
<browse-community [community]=community></browse-community>
</div>
</div>
</div>
</div>
<div class="uk-text-right uk-margin-top">
<a *ngIf="researchCommunities.length > 5" class="portal-color uk-text-uppercase uk-text-bold"
routerLinkActive="router-link-active" routerLink="/search/find/communities">
Browse All >
</a>
</div>
</div>
<helper div="home-news"></helper>
<div class="contact-banner uk-background-norepeat uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color">
<helper *ngIf="pageContents && pageContents['bottom']" [texts]="pageContents['bottom']"></helper>
<div class="contact-banner uk-background-norepeat uk-background-cover uk-section-secondary uk-section-overlap uk-position-relative uk-preserve-color uk-margin-large-top">
<div class="uk-container uk-container-large uk-section">
<div class="uk-flex uk-flex-middle uk-padding" uk-grid>
<div class="uk-text-center uk-width-1-1@s uk-width-1-3@m">
<img width="237" height="250" src="../../assets/contact/1.png">
<img width="237" height="250" src="assets/contact/1.png">
</div>
<div class="uk-width-expand">
<h1 class="uk-text-bold">
@ -239,7 +245,7 @@
</div>
</div>
<div class="uk-section-muted" uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}">
<div class="uk-container uk-container-large">
<other-portals [properties]="properties"></other-portals>
</div>
<div class="uk-container uk-container-large">
<other-portals [properties]="properties"></other-portals>
</div>
</div>

View File

@ -12,10 +12,11 @@ import {StringUtils} from '../openaireLibrary/utils/string-utils.class';
import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component';
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
@Component({
selector: 'communities',
templateUrl: 'communities.component.html',
selector: 'communities',
templateUrl: 'communities.component.html',
})
export class CommunitiesComponent {
@ -27,8 +28,9 @@ export class CommunitiesComponent {
public researchInitiatives = [];
public subscriberOfCommunities = [];
public managerOfCommunities = [];
public gifs: {"gif": string, "header": string, "text"}[] = [];
public gifs: { "gif": string, "header": string, "text" }[] = [];
public pageContents = null;
public divContents = null;
// Message variables
public status: number;
public loading: boolean = true;
@ -36,210 +38,225 @@ export class CommunitiesComponent {
public errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent;
properties:EnvProperties;
public keyword:string="";
public type:string="all";
constructor (
private route: ActivatedRoute,
private _router: Router,
private _meta: Meta,
private _title: Title,
private _piwikService:PiwikService,
private _communitiesService:CommunitiesService,
private _subscribeService: SubscribeService) {
properties: EnvProperties;
public keyword: string = "";
public type: string = "all";
var description = "OpenAIRE - Connect, Community Dashboard, research community";
var title = "OpenAIRE - Connect";
constructor(
private route: ActivatedRoute,
private _router: Router,
private _meta: Meta,
private _title: Title,
private _piwikService: PiwikService,
private _communitiesService: CommunitiesService,
private _subscribeService: SubscribeService,
private helper: HelperService) {
this._meta.updateTag({content:description},"name='description'");
this._meta.updateTag({content:description},"property='og:description'");
this._meta.updateTag({content:title},"property='og:title'");
this._title.setTitle(title);
var description = "OpenAIRE - Connect, Community Dashboard, research community";
var title = "OpenAIRE - Connect";
this.errorCodes = new ErrorCodes();
this.errorMessages = new ErrorMessagesComponent();
this.status = this.errorCodes.LOADING;
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
this._meta.updateTag({content: title}, "property='og:title'");
this._title.setTitle(title);
this.errorCodes = new ErrorCodes();
this.errorMessages = new ErrorMessagesComponent();
this.status = this.errorCodes.LOADING;
}
public ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
var url = data.envSpecific.baseLink+this._router.url
this._meta.updateTag({content:url},"property='og:url'");
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe();
}
this.getCommunities();
this.createGifs();
});
}
public getCommunities() {
this.loading = true;
this.status = this.errorCodes.LOADING;
this.subscriberErrorMessage = "";
this.researchCommunities = [];
this.researchInitiatives = [];
this.subscriberOfCommunities = [];
this.managerOfCommunities = [];
this._communitiesService.getCommunitiesState().subscribe(
communitiesResults => {
//this.communitiesResults = communitiesResults;
//this.communitiesToShow = this.communitiesResults.slice();
//console.log(communitiesResults);
this.sort(communitiesResults);
var subscribedLoading = communitiesResults.length;
var mail = Session.getUserEmail();
communitiesResults.forEach((community, index) => {
let showCommunity: boolean = true;
let isManager: boolean = false;
let isSubscriber: boolean = false;
if(community['status'] == "hidden"){
showCommunity = false;
}else {
if(mail == null && community['status'] == "manager"){ // no user
showCommunity = false;
}else if(Session.isCommunityCurator() || Session.isPortalAdministrator()){
isManager = true;
}else if(community.managers.indexOf(mail)!=-1){
isManager = true;
} else if(community['status'] == "manager") {
showCommunity = false;
}
}
if(showCommunity) {
// TODO remove
/*if(community.type == "community"){
this.researchCommunities.push(community);
} else if(community.type == "ri") {
this.researchInitiatives.push(community);
}*/
this.researchCommunities.push(community);
if(isManager) {
community.isManager = true;
this.managerOfCommunities.push(community);
}
}
this.status = this.errorCodes.DONE;
if(mail != null && showCommunity) {
this._subscribeService.isSubscribedToCommunity( this.properties, community.communityId, mail).subscribe (
res => {
isSubscriber = res;
if(isSubscriber) {
community.isSubscribed = true;
if(isManager) {
this.subscriberOfCommunities.push(community);
} else {
this.subscriberOfCommunities.unshift(community);
}
}
subscribedLoading--;
if(subscribedLoading == 0) {
this.loading = false;
}
},
error => {
// if(this.properties.environment == "development") {
// this.subscriberErrorMessage = "Error fetching communities you are subscribed to";
// }
this.handleError("Error getting response if email: "+mail+" is subscribed to community with id: "+community.communityId, error);
subscribedLoading--;
if(subscribedLoading == 0) {
this.loading = false;
}
});
} else {
subscribedLoading--;
if(subscribedLoading == 0) {
this.loading = false;
}
}
});
},
error => {
this.status = this.handleError("Error getting communities", error);
this.loading = false;
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
var url = data.envSpecific.baseLink + this._router.url
this._meta.updateTag({content: url}, "property='og:url'");
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect", this.properties.piwikSiteId).subscribe();
}
);
}
this.getCommunities();
this.createGifs();
//this.getDivContents();
this.getPageContents();
});
}
private createGifs() {
this.gifs.push({
gif: "assets/home/gifs/deposit.gif",
header: "Find a repository to deposit your research outcome",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
this.gifs.push({
gif: "assets/home/gifs/link.gif",
header: "Link your research output with your community, funding, and other research products",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
this.gifs.push({
gif: "assets/home/gifs/overview.gif",
header: "View community's overview at a glance",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
this.gifs.push({
gif: "assets/home/gifs/results.gif",
header: "Search & browse your community's research products. ",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
this.gifs.push({
gif: "assets/home/gifs/graph-analysis.gif",
header: "View statistics for your community's research products.",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
}
public getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.pageContents = contents;
})
}
private sort(results: CommunityInfo[]) {
results.sort((left, right): number => {
if (!right.date || left.date > right.date) {
return -1;
} else if (!left.date || left.date < right.date) {
return 1;
} else {
if (left.title > right.title) {
return 1;
} else if (left.title < right.title) {
return -1;
public getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.divContents = contents;
})
}
public getCommunities() {
this.loading = true;
this.status = this.errorCodes.LOADING;
this.subscriberErrorMessage = "";
this.researchCommunities = [];
this.researchInitiatives = [];
this.subscriberOfCommunities = [];
this.managerOfCommunities = [];
this._communitiesService.getCommunitiesState().subscribe(
communitiesResults => {
//this.communitiesResults = communitiesResults;
//this.communitiesToShow = this.communitiesResults.slice();
//console.log(communitiesResults);
this.sort(communitiesResults);
var subscribedLoading = communitiesResults.length;
var mail = Session.getUserEmail();
communitiesResults.forEach((community, index) => {
let showCommunity: boolean = true;
let isManager: boolean = false;
let isSubscriber: boolean = false;
if (community['status'] == "hidden") {
showCommunity = false;
} else {
return 0;
if (mail == null && community['status'] == "manager") { // no user
showCommunity = false;
} else if (Session.isCommunityCurator() || Session.isPortalAdministrator()) {
isManager = true;
} else if (community.managers.indexOf(mail) != -1) {
isManager = true;
} else if (community['status'] == "manager") {
showCommunity = false;
}
}
}
})
}
public quote(param: string): string {
return StringUtils.quote(param);
}
if (showCommunity) {
// TODO remove
/*if(community.type == "community"){
this.researchCommunities.push(community);
} else if(community.type == "ri") {
this.researchInitiatives.push(community);
}*/
this.researchCommunities.push(community);
if (isManager) {
community.isManager = true;
this.managerOfCommunities.push(community);
}
}
public ngOnDestroy() {
if(this.piwiksub){
this.piwiksub.unsubscribe();
this.status = this.errorCodes.DONE;
if (mail != null && showCommunity) {
this._subscribeService.isSubscribedToCommunity(this.properties, community.communityId, mail).subscribe(
res => {
isSubscriber = res;
if (isSubscriber) {
community.isSubscribed = true;
if (isManager) {
this.subscriberOfCommunities.push(community);
} else {
this.subscriberOfCommunities.unshift(community);
}
}
subscribedLoading--;
if (subscribedLoading == 0) {
this.loading = false;
}
},
error => {
// if(this.properties.environment == "development") {
// this.subscriberErrorMessage = "Error fetching communities you are subscribed to";
// }
this.handleError("Error getting response if email: " + mail + " is subscribed to community with id: " + community.communityId, error);
subscribedLoading--;
if (subscribedLoading == 0) {
this.loading = false;
}
});
} else {
subscribedLoading--;
if (subscribedLoading == 0) {
this.loading = false;
}
}
});
},
error => {
this.status = this.handleError("Error getting communities", error);
this.loading = false;
}
}
);
}
private handleError(message: string, error): number {
var code = "";
if(!error.status) {
var error = error.json();
code = error.code;
private createGifs() {
this.gifs.push({
gif: "assets/home/gifs/deposit.gif",
header: "Find a repository to deposit your research outcome",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
this.gifs.push({
gif: "assets/home/gifs/link.gif",
header: "Link your research output with your community, funding, and other research products",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
this.gifs.push({
gif: "assets/home/gifs/overview.gif",
header: "View community's overview at a glance",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
this.gifs.push({
gif: "assets/home/gifs/results.gif",
header: "Search & browse your community's research products. ",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
this.gifs.push({
gif: "assets/home/gifs/graph-analysis.gif",
header: "View statistics for your community's research products.",
text: "This is OpenAIREs key service for research communities, both established and emerging ones. Our service helps you reach out and engage all your researchers to practice open science out-of-the-box."
});
}
private sort(results: CommunityInfo[]) {
results.sort((left, right): number => {
if (!right.date || left.date > right.date) {
return -1;
} else if (!left.date || left.date < right.date) {
return 1;
} else {
code = error.status;
if (left.title > right.title) {
return 1;
} else if (left.title < right.title) {
return -1;
} else {
return 0;
}
}
})
}
console.error("Communities (component): "+message, error);
public quote(param: string): string {
return StringUtils.quote(param);
}
return this.errorMessages.getErrorCode(code);
public ngOnDestroy() {
if (this.piwiksub) {
this.piwiksub.unsubscribe();
}
}
private handleError(message: string, error): number {
var code = "";
if (!error.status) {
var error = error.json();
code = error.code;
} else {
code = error.status;
}
console.error("Communities (component): " + message, error);
return this.errorMessages.getErrorCode(code);
}
}

View File

@ -21,7 +21,8 @@ import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-port
imports: [
CommonModule, FormsModule, RouterModule,
ManageModule, ErrorMessagesModule,
SearchFormModule, BrowseCommunityModule, HelperModule, GifSliderModule, OtherPortalsModule
SearchFormModule, BrowseCommunityModule, HelperModule, GifSliderModule, OtherPortalsModule,
HelperModule
],
declarations: [
CommunitiesComponent

View File

@ -1,7 +1,7 @@
import {Component} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {ConnectHelper} from '..//openaireLibrary/connect/connectHelper';
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
@Component({
selector: 'community-wrapper',

View File

@ -1,4 +1,5 @@
<ng-template #info>
<helper *ngIf="pageContents && pageContents['right']" [texts]="pageContents['right']"></helper>
<h1 class="uk-margin-auto-top uk-margin-remove-bottom uk-text-bold">OpenAIRE gives you the virtual environment and services designed for your community to:</h1>
<ul class="uk-list uk-list-divider uk-padding uk-padding-remove-left uk-margin-auto-top">
<li><h5><span class="uk-text-bold">Create and Manage</span> your

View File

@ -9,6 +9,7 @@ import {Composer} from "../openaireLibrary/utils/email/composer";
import {Title} from "@angular/platform-browser";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
@Component({
selector: 'contact',
@ -26,6 +27,8 @@ export class ContactComponent implements OnInit {
public email: Email;
public note = '';
public properties: EnvProperties = null;
public pageContents = null;
public divContents = null;
public contactForm: ContactForm = new ContactForm();
@ViewChild('AlertModal') modal;
@ -41,7 +44,8 @@ export class ContactComponent implements OnInit {
private _router: Router,
private _emailService: EmailService,
private _title: Title,
private _piwikService: PiwikService) {
private _piwikService: PiwikService,
private helper: HelperService) {
}
@ -53,11 +57,25 @@ export class ContactComponent implements OnInit {
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect|Contact Us", this.properties.piwikSiteId).subscribe();
}
//this.getDivContents();
this.getPageContents();
HelperFunctions.scroll();
this.showLoading = false;
});
}
public getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.pageContents = contents;
})
}
public getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.divContents = contents;
})
}
public send() {
HelperFunctions.scroll();
if(!this.name.invalid && !this.surname.invalid && !this.sender.invalid &&

View File

@ -9,12 +9,13 @@ import {EmailService} from "../openaireLibrary/utils/email/email.service";
import {RecaptchaModule} from "ng-recaptcha";
import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
@NgModule({
imports: [
ContactRoutingModule, CommonModule, FormsModule, RouterModule,
AlertModalModule, RecaptchaModule.forRoot()
AlertModalModule, RecaptchaModule.forRoot(), HelperModule
],
declarations: [
ContactComponent

View File

@ -0,0 +1 @@
<helper *ngIf="pageContents && pageContents['top']" [texts]="pageContents['top']"></helper>

View File

@ -0,0 +1,37 @@
import {Component, OnInit} from '@angular/core';
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {ActivatedRoute, Router} from "@angular/router";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
@Component({
selector: 'theme',
templateUrl: 'helper-test.component.html',
})
export class HelperTestComponent implements OnInit{
public pageContents = null;
properties:EnvProperties;
constructor(private route: ActivatedRoute,
private _router: Router,
private helper: HelperService) {
}
ngOnInit(): void {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.getPageContents();
});
}
public getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.pageContents = contents;
})
}
}

View File

@ -0,0 +1,26 @@
import { NgModule } from '@angular/core';
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {HelperTestComponent} from "./helper-test.component";
import {CommonModule} from "@angular/common";
import {RouterModule} from "@angular/router";
@NgModule({
imports: [
HelperModule,
CommonModule,
RouterModule.forChild([
{path: '', component: HelperTestComponent}
])
],
declarations: [
HelperTestComponent
],
providers:[],
exports: [
HelperTestComponent
]
})
export class HelperTestModule{}

View File

@ -3,11 +3,12 @@ import {ActivatedRoute, Router} from '@angular/router';
import {Title} from '@angular/platform-browser';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
import {FAQ} from "../openaireLibrary/utils/entities/FAQ";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
@Component({
selector: 'learn-how',
template: `
<helper *ngIf="pageContents && pageContents['top']" [texts]="pageContents['top']"></helper>
<ng-template #one>
<h5 class="uk-text-bold uk-margin-small-bottom">1. Understanding your needs</h5>
<div>
@ -96,13 +97,14 @@ import {FAQ} from "../openaireLibrary/utils/entities/FAQ";
</div>
</div>
</div>
<helper position="bottom"></helper>
</div>
`
})
export class LearnHowComponent {
public piwiksub: any;
public gifs: {"gif": string, "header": string, "text"}[] = [];
public pageContents = null;
public divContents = null;
private pageTitle = "OpenAIRE - Connect | Learn How";
@ -113,8 +115,8 @@ export class LearnHowComponent {
private route: ActivatedRoute,
private _router: Router,
private _title: Title,
private _piwikService: PiwikService) {
var description = "OpenAIRE - Connect, Community Dashboard, research community";
private _piwikService: PiwikService,
private helper: HelperService) {
this._title.setTitle(this.pageTitle);
}
@ -125,10 +127,24 @@ export class LearnHowComponent {
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect | Create and manage your community page", this.properties.piwikSiteId).subscribe();
}
//this.getDivContents();
this.getPageContents();
});
this.createGifs();
}
public getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.pageContents = contents;
})
}
public getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.divContents = contents;
})
}
public ngOnDestroy() {
if(this.piwiksub){
this.piwiksub.unsubscribe();

View File

@ -3,10 +3,12 @@ import {ActivatedRoute, Router} from '@angular/router';
import {Title} from '@angular/platform-browser';
import {PiwikService} from '../../openaireLibrary/utils/piwik/piwik.service';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {HelperService} from "../../openaireLibrary/utils/helper/helper.service";
@Component({
selector: 'learn-in-depth',
template: `
<helper *ngIf="pageContents && pageContents['top']" [texts]="pageContents['top']"></helper>
<div class="image-front-topbar uk-section-overlap uk-position-relative uk-preserve-color" 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" tm-header-transparent-placeholder="">
<div class="cloud-background uk-background-norepeat uk-background-cover uk-section uk-padding-remove-bottom" >
<div class="uk-container uk-container-large uk-section">
@ -21,7 +23,7 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env
</div>
</div>
<div class="uk-margin-large-top uk-width-expand">
<img width="308" height="285" src="../../assets/banner/together.png">
<img width="308" height="285" src="assets/banner/together.png">
</div>
</div>
</div>
@ -35,8 +37,8 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env
</ul>
<div uk-grid>
<div class="uk-width-1-6 uk-position-relative uk-flex uk-flex-column">
<img src="../../assets/about/1.png" class="uk-align-center" width="100px" height="100px">
<img src="../../assets/sketch_line_arrow.svg" class="uk-align-center">
<img src="assets/about/1.png" class="uk-align-center" width="100px" height="100px">
<img src="assets/sketch_line_arrow.svg" class="uk-align-center">
</div>
<div class="uk-width-expand">
<h1 class="uk-margin-medium uk-text-bold">1. Analyse your needs</h1>
@ -72,8 +74,8 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env
<div uk-grid uk-height-match>
<div class="uk-width-1-6 uk-position-relative uk-flex uk-flex-column">
<img src="../../assets/about/2.png" class="uk-align-center" width="100px" height="100px">
<img src="../../assets/sketch_line_arrow.svg" class="uk-align-center">
<img src="assets/about/2.png" class="uk-align-center" width="100px" height="100px">
<img src="assets/sketch_line_arrow.svg" class="uk-align-center">
</div>
<div class="uk-width-expand">
<h1 class="uk-margin-medium uk-text-bold">2. Develop a pilot</h1>
@ -94,8 +96,8 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env
</div>
<div uk-grid uk-height-match>
<div class="uk-width-1-6 uk-position-relative uk-flex uk-flex-column">
<img src="../../assets/about/3.png" class="uk-align-center" width="100px" height="100px">
<img src="../../assets/sketch_line_arrow_large.svg" class="uk-align-center">
<img src="assets/about/3.png" class="uk-align-center" width="100px" height="100px">
<img src="assets/sketch_line_arrow_large.svg" class="uk-align-center">
</div>
<div class="uk-width-expand">
<h1 class="uk-margin-medium uk-text-bold">3. Test and Validate</h1>
@ -115,13 +117,13 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env
</p>
<div class="uk-width-1-1 uk-text-center uk-margin-medium ">
<img src="../../assets/OpenAIRE-RCD_howtos.png" width="auto" height="auto">
<img src="assets/OpenAIRE-RCD_howtos.png" width="auto" height="auto">
</div>
</div>
</div>
<div uk-grid uk-height-match>
<div class="uk-width-1-6 uk-position-relative">
<img src="../../assets/about/4.png" class="uk-align-center" width="100px" height="100px">
<img src="assets/about/4.png" class="uk-align-center" width="100px" height="100px">
</div>
<div class="uk-width-expand">
<h1 class="uk-margin-medium uk-text-bold">4. Roll out the service</h1>
@ -149,7 +151,7 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env
<div class="uk-container uk-container-large uk-section">
<div class="uk-flex uk-flex-middle uk-padding" uk-grid>
<div class="uk-text-center uk-width-1-1@s uk-width-1-2@m">
<img width="329" height="250" src="../../assets/contact/2.png">
<img width="329" height="250" src="assets/contact/2.png">
</div>
<div class="uk-width-expand">
<h1 class="uk-text-bold">
@ -170,6 +172,8 @@ import {EnvProperties} from '../../openaireLibrary/utils/properties/env
})
export class LearnInDepthComponent {
public piwiksub: any;
public pageContents = null;
public divContents = null;
private pageTitle = "OpenAIRE - Connect | Learn In Depth";
@ -179,7 +183,8 @@ export class LearnInDepthComponent {
private route: ActivatedRoute,
private _router: Router,
private _title: Title,
private _piwikService: PiwikService) {
private _piwikService: PiwikService,
private helper: HelperService) {
var description = "OpenAIRE - Connect, Community Dashboard, research community";
this._title.setTitle(this.pageTitle);
}
@ -191,9 +196,23 @@ export class LearnInDepthComponent {
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE Connect | Create and manage your community page - learn in depth", this.properties.piwikSiteId).subscribe();
}
//this.getDivContents();
this.getPageContents();
});
}
public getPageContents() {
this.helper.getPageHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.pageContents = contents;
})
}
public getDivContents() {
this.helper.getDivHelpContents(this._router.url, this.properties, 'connect').subscribe(contents => {
this.divContents = contents;
})
}
public ngOnDestroy() {
if(this.piwiksub){
this.piwiksub.unsubscribe();

View File

@ -8,10 +8,11 @@ import {PiwikService} from '../../openaireLibrary/utils/piwik/piwik.ser
import {LearnInDepthComponent} from "./learn-in-depth.component";
import {LearnInDepthRoutingModule} from "./learn-in-depth-routing.module";
import {HelperModule} from "../../openaireLibrary/utils/helper/helper.module";
@NgModule({
imports: [
CommonModule, RouterModule, LearnInDepthRoutingModule
CommonModule, RouterModule, LearnInDepthRoutingModule, HelperModule
],
declarations: [
LearnInDepthComponent