From 207be9ec3482b779ad224e7593dd5166a1608b48 Mon Sep 17 00:00:00 2001 From: DylanGuedes Date: Tue, 3 May 2016 10:28:19 -0300 Subject: [PATCH] Adds account register module --- src/app/account/register-component.html | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/app/account/register.component.ts | 22 ++++++++++++++++++++++ src/app/account/register.html | 10 ++++++++++ src/app/account/scss/register-component.scss | 38 ++++++++++++++++++++++++++++++++++++++ src/app/layout/navbar/navbar.html | 6 ++++++ src/app/main/main.component.ts | 13 +++++++++++++ src/languages/en.json | 13 +++++++++++++ src/languages/pt.json | 15 ++++++++++++++- 8 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 src/app/account/register-component.html create mode 100644 src/app/account/register.component.ts create mode 100644 src/app/account/register.html create mode 100644 src/app/account/scss/register-component.scss diff --git a/src/app/account/register-component.html b/src/app/account/register-component.html new file mode 100644 index 0000000..da6b922 --- /dev/null +++ b/src/app/account/register-component.html @@ -0,0 +1,56 @@ +
+
+

{{"account.register.welcomeMessage" | translate }}

+

+ "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..." + "There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..." +

+

{{"account.register.seeMoreMessage" | translate}}{{"account.register.informationsMessage" | translate}}

+
+
+
+
+ + +
+ +
+ + +
+ +
+ + +

ex: ola.coop.br/joaosilva

+
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+

{{"account.register.accountCreatingMessage" | translate}} {{"account.register.termsOfUseMessage" | translate}}.

+
+ +
+ +
+ +
+
+ +

{{"account.register.haveAccountMessage" | translate}}

+ +
diff --git a/src/app/account/register.component.ts b/src/app/account/register.component.ts new file mode 100644 index 0000000..6b33d7e --- /dev/null +++ b/src/app/account/register.component.ts @@ -0,0 +1,22 @@ +import { Inject, Input, Component, Output, EventEmitter, } from 'ng-forward'; + +@Component({ + selector: 'noosfero-register', + templateUrl: 'app/account/register-component.html', +}) + +@Inject("$http") +export class RegisterComponent { + constructor(private $http: ng.IHttpService) { } + + signup (account: any) { + if (account.password === account.passwordConfirmation) { + this.$http.post("http://localhost:3000/api/v1/register", "login="+account.login+"&email="+account.email+"&password="+account.password).then((response) => { + console.log("User " + account.login + " created, please activate your account."); + }); + } else { + alert("Wrong password confirmation."); + } + } + +} diff --git a/src/app/account/register.html b/src/app/account/register.html new file mode 100644 index 0000000..18a6fa2 --- /dev/null +++ b/src/app/account/register.html @@ -0,0 +1,10 @@ +
+
+ + +
+ +
+ +
+
diff --git a/src/app/account/scss/register-component.scss b/src/app/account/scss/register-component.scss new file mode 100644 index 0000000..99c0f2d --- /dev/null +++ b/src/app/account/scss/register-component.scss @@ -0,0 +1,38 @@ +.register-page button { + width: 100%; + text-transform: uppercase; + font-weight: 600; +} + +.register-page .light-text { + color: #BBB; + margin-top: 0px; + margin-bottom: 0px; + font-weight: 600; +} + +.register-page .terms-info { + margin-top: 30px; + margin-bottom: 30px; +} + +.register-page .welcome-message { + text-align: center; +} + +.register-page .already-registered-message { + margin-top: 60px; + text-align: center; +} + +.register-page input { + height: 40px; +} + +.register-page .register-field { + margin-bottom: 25px; +} + +.register-page input:focus { + border: 2px solid #bbb; +} diff --git a/src/app/layout/navbar/navbar.html b/src/app/layout/navbar/navbar.html index bc01adc..f1a3efa 100644 --- a/src/app/layout/navbar/navbar.html +++ b/src/app/layout/navbar/navbar.html @@ -20,6 +20,12 @@ {{"navbar.login" | translate}} +
  • + + Sign Up + +
  • +