[Trunk|Library]: 1. Add a new entity with fiels an email and recaptcha token. 2. Add a contact method on email service to send an email and recaptcha token to admin-tools
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55274 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
ed5556933f
commit
0c01cd65f7
|
@ -14,10 +14,10 @@
|
||||||
<a (click)="confirmModalOpen(result.community)" [class]="(result.isManager)?'uk-width-3-4':''">
|
<a (click)="confirmModalOpen(result.community)" [class]="(result.isManager)?'uk-width-3-4':''">
|
||||||
{{(result.community.title)?result.community.title:result.community.shortTitle}}
|
{{(result.community.title)?result.community.title:result.community.shortTitle}}
|
||||||
</a>
|
</a>
|
||||||
<manage *ngIf="result.isManager" [communityId]="result.community.communityId" class="uk-width-expand"></manage>
|
<manage *ngIf="result.isManager" [communityId]="result.community.communityId" class="uk-width-expand uk-margin-auto-right"></manage>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="result.community.description" class="uk-margin-auto">
|
<div *ngIf="result.community.description">
|
||||||
<div class="text-justify descriptionText" [title]="result.community.description">
|
<div class="text-justify descriptionText uk-margin-auto-right" [title]="result.community.description">
|
||||||
{{_formatDescription(result.community.description)}}
|
{{_formatDescription(result.community.description)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
<span *ngIf="result.community.date"><b> Creation Date: </b></span>
|
<span *ngIf="result.community.date"><b> Creation Date: </b></span>
|
||||||
<span *ngIf="result.community.date">{{result.community.date | date:'dd-MM-yyyy'}}</span>
|
<span *ngIf="result.community.date">{{result.community.date | date:'dd-MM-yyyy'}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-expand uk-align-right">
|
<div class="uk-width-expand uk-align-right uk-margin-auto-right">
|
||||||
<span *ngIf="result.community.type && result.community.type != ''" ><b> Type: </b></span>
|
<span *ngIf="result.community.type && result.community.type != ''" ><b> Type: </b></span>
|
||||||
<span *ngIf="result.community.type && result.community.type != ''" >{{(result.community.type == 'ri')? 'Research Initiative': 'Research Community'}}</span>
|
<span *ngIf="result.community.type && result.community.type != ''" >{{(result.community.type == 'ri')? 'Research Initiative': 'Research Community'}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,6 +2,7 @@ import {Injectable} from '@angular/core';
|
||||||
import {Http, Response, Headers, RequestOptions} from '@angular/http';
|
import {Http, Response, Headers, RequestOptions} from '@angular/http';
|
||||||
import {Email} from './email';
|
import {Email} from './email';
|
||||||
import {CustomOptions} from '../../services/servicesUtils/customOptions.class';
|
import {CustomOptions} from '../../services/servicesUtils/customOptions.class';
|
||||||
|
import {EmailRecaptcha} from "../entities/EmailRecaptcha";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EmailService {
|
export class EmailService {
|
||||||
|
@ -16,4 +17,12 @@ export class EmailService {
|
||||||
.map(request => request.json());
|
.map(request => request.json());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contact(url: string, email: Email, recaptcha: string) {
|
||||||
|
const data: EmailRecaptcha = new EmailRecaptcha();
|
||||||
|
data.email = email;
|
||||||
|
data.recaptcha = recaptcha;
|
||||||
|
return this.http.post(url, data)
|
||||||
|
.map(request => request.json());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import {Email} from "../email/email";
|
||||||
|
|
||||||
|
export class EmailRecaptcha {
|
||||||
|
email: Email = null;
|
||||||
|
recaptcha: string = null;
|
||||||
|
}
|
Loading…
Reference in New Issue