From d26237cfcffdf82c97bf25948ff4d82175eca3a7 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Tue, 2 Oct 2018 10:48:44 +0000 Subject: [PATCH] Connect: initial facelift css changes git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@53367 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../communities/communities.component.html | 63 +++++++++++++++++++ src/app/community/community.module.ts | 3 +- .../results/results.component.ts | 52 +++++++-------- src/app/utils/subscribe/invite.component.ts | 63 +++++++++++++++++++ src/app/utils/subscribe/invite.module.ts | 24 +++++++ src/app/utils/subscribe/invite.service.ts | 26 ++++++++ src/assets/connect-custom.css | 28 +++++---- 7 files changed, 220 insertions(+), 39 deletions(-) create mode 100644 src/app/utils/subscribe/invite.component.ts create mode 100644 src/app/utils/subscribe/invite.module.ts create mode 100644 src/app/utils/subscribe/invite.service.ts diff --git a/src/app/communities/communities.component.html b/src/app/communities/communities.component.html index 2fb4825..d1b50d6 100644 --- a/src/app/communities/communities.component.html +++ b/src/app/communities/communities.component.html @@ -74,3 +74,66 @@ + +
+
+
+
+ +
+

+ A researcher? +

+
+ Explore all OA research results. Link all your research. Build your profile +
+ +
+ +
+

+ A content provider? +

+
+ Join OpenAIRE, use our tools and make your content more visible around the world. +
+ +
+
+

+ A research manager? +

+
+ Use our monitoring services and easily track all relevant research results. +
+ +
+
+

+ A developer? +

+
+ Get access to OpenAIRE data and capitalize on Europe's open linked research. +
+ +
+
+
+
+
diff --git a/src/app/community/community.module.ts b/src/app/community/community.module.ts index 5049c0b..d53620b 100644 --- a/src/app/community/community.module.ts +++ b/src/app/community/community.module.ts @@ -15,6 +15,7 @@ import {CommunityService} from '../openaireLibrary/connect/community/community.s import {FreeGuard} from '../openaireLibrary/login/freeGuard.guard'; import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; import {SubscribeModule} from '../utils/subscribe/subscribe.module'; +import {InviteModule} from '../utils/subscribe/invite.module'; import {ManageModule} from '../utils/manage/manage.module'; import {StatisticsModule} from "../statistics/statistics.module"; @@ -23,7 +24,7 @@ import {StatisticsModule} from "../statistics/statistics.module"; imports: [ CommonModule, FormsModule, RouterModule, // CommunityRoutingModule, - SubscribeModule, StatisticsModule, ManageModule + SubscribeModule, StatisticsModule, ManageModule, InviteModule ], declarations: [ CommunityComponent, ResultsComponent diff --git a/src/app/searchEntries/results/results.component.ts b/src/app/searchEntries/results/results.component.ts index 5b431d6..d2f93ed 100644 --- a/src/app/searchEntries/results/results.component.ts +++ b/src/app/searchEntries/results/results.component.ts @@ -6,7 +6,31 @@ import { CommunityInfo } from '../../openaireLibrary/connect/community/community selector: 'results-comp', template: `
- +
+
  • @@ -48,32 +72,8 @@ import { CommunityInfo } from '../../openaireLibrary/connect/community/community
    No results available
    -
    - ` + ` }) diff --git a/src/app/utils/subscribe/invite.component.ts b/src/app/utils/subscribe/invite.component.ts new file mode 100644 index 0000000..79eda4e --- /dev/null +++ b/src/app/utils/subscribe/invite.component.ts @@ -0,0 +1,63 @@ +import { Component, Input, ViewChild } from '@angular/core'; +import { Location } from '@angular/common'; +import {ActivatedRoute} from '@angular/router'; +import { EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; + +import {InviteService} from './invite.service'; +import {Session} from '../../openaireLibrary/login/utils/helper.class'; +@Component({ + selector: 'invite', + template: ` +
    +
    + + +
    +
    +
    Message
    + +
    + Invite +
    + + ` +}) + +export class InviteComponent { + @Input() communityName:boolean; + @Input() communityId:string; + properties:EnvProperties; + + subject:string; + body:string; + recipients:string[] = []; + + constructor (private route: ActivatedRoute, + private _inviteService: InviteService + ) { + } + + public ngOnInit() { + this.route.data + .subscribe((data: { envSpecific: EnvProperties }) => { + this.properties = data.envSpecific; + this.subject = "["+this.communityName+"] Invitation to join community"; + this.body = "Dear sir or madame, \n\nWe would like to invite you to join "+this.communityName + + " OpenAIRE community (beta."+this.communityId+".openaire.eu)"; + }); + + + } + + invite(){ + var email = Session.getUserEmail(); + //TODO + this._inviteService.inviteUsers( this.properties.adminToolsAPIURL,this.subject, this.body, ["argirok@di.uoa.gr"]).subscribe ( + res => { + console.log(res); + + }); + } + + +} diff --git a/src/app/utils/subscribe/invite.module.ts b/src/app/utils/subscribe/invite.module.ts new file mode 100644 index 0000000..8819261 --- /dev/null +++ b/src/app/utils/subscribe/invite.module.ts @@ -0,0 +1,24 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; +import {FormsModule} from '@angular/forms'; + +import { InviteService } from './invite.service'; +import {InviteComponent} from './invite.component'; +import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module'; + +@NgModule({ + imports: [ + CommonModule, RouterModule, AlertModalModule, FormsModule + ], + declarations: [ + InviteComponent + ], + providers:[ + InviteService + ], + exports: [ + InviteComponent + ] +}) +export class InviteModule { } diff --git a/src/app/utils/subscribe/invite.service.ts b/src/app/utils/subscribe/invite.service.ts new file mode 100644 index 0000000..fd54def --- /dev/null +++ b/src/app/utils/subscribe/invite.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@angular/core'; +import { Http, Response, Headers, RequestOptions } from '@angular/http'; +import { Observable } from 'rxjs/Rx'; +import {COOKIE} from "../../openaireLibrary/login/utils/helper.class" + + +@Injectable() +export class InviteService { + + constructor(private http:Http) { + } + inviteUsers(url:string, subject:string, body:string, recipients:string[]){ + var email = {"subject":subject, "body":body, recipients: recipients }; + return this.http.post(url+"/email", JSON.stringify(email), this.getAuthOptionsWithBody()) + .map(res => res.json()) + .do(res => {console.log("Response is "+res)}); + } + public getAuthOptionsWithBody():RequestOptions{ + let headers = new Headers(); + headers.append('Content-Type', 'application/json'); + headers.append('X-XSRF-TOKEN', COOKIE.getCookie(COOKIE.cookieName_id)); + let options = new RequestOptions({ headers: headers, withCredentials:true }); + return options; + } + +} diff --git a/src/assets/connect-custom.css b/src/assets/connect-custom.css index 80a1b10..9e39d54 100644 --- a/src/assets/connect-custom.css +++ b/src/assets/connect-custom.css @@ -1,19 +1,23 @@ -.tm-toolbar .uk-subnav-line .custom-connect-li { - display: block; - background:#2C57D7 !important; color:#fff !important; +:root { + --portal-main-color: #EBB13E; + --portal-main-contrast: #2E2E2E; + --portal-dark-color: #4687E6; + --openaire-main-color: #313179; + + --explore-portal-color: #D95F2D; + --provide-portal-color: #37C7E9; + --monitor-portal-color: #9ABB55; + --connect-portal-color: #EBB13E; + --develop-portal-color: #DA65AB; } -.custom-connect-toolbar ul.uk-subnav.uk-subnav-line{ - background-color: #FFC700 !important; - } - .custom-connect-toolbar .inner { - background-color: #FFC700 !important; - } - .custom-connect-toolbar{ - border-top-color:#FFC700 !important; - } + +.tm-toolbar .uk-subnav-line .custom-connect-li { + background:var(--portal-main-color) !important; +} + .uk-button-default:hover,.uk-button-default:focus,.btn:hover,.btn:focus { background-color:#fff !important; color:#5b5b5b !important;