Commit 72e8222b78bf15396f640b7f5fb001364c1b8e9a
1 parent
63828075
Exists in
updated_signup_page
Adds account register module
Signed-off-by: DylanGuedes <djmgguedes@gmail.com> Signed-off-by: Omar Junior <omarroinuj@gmail.com> Signed-off-by: Sabryna Sousa <sabryna.sousa1323@gmail.com> Adjusts the style of the component according with its prototype Signed-off-by: DylanGuedes <djmgguedes@gmail.com> Signed-off-by: Omar Junior <omarroinuj@gmail.com> Signed-off-by: Sabryna Sousa <sabryna.sousa1323@gmail.com> Translations for the signup module Translates messages of the signup page. Signed-off-by: DylanGuedes <djmgguedes@gmail.com> Signed-off-by: Sabryna Sousa <sabryna.sousa1323@gmail.com> Signed-off-by: Victor Arnaud <victorhad@gmail.com> Fixes the post request, using the 2nd parameter as string instead of object. Signed-off-by: DylanGuedes <djmgguedes@gmail.com> Signed-off-by: Omar Junior <omarroinuj@gmail.com>
Showing
8 changed files
with
171 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,56 @@ |
1 | +<div class="register-page"> | |
2 | + <div class="welcome-message"> | |
3 | + <h1>{{"account.register.welcomeMessage" | translate }}</h1> | |
4 | + <p> | |
5 | + "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..." | |
6 | + "There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..." | |
7 | + </p> | |
8 | + <p>{{"account.register.seeMoreMessage" | translate}}<a href="#">{{"account.register.informationsMessage" | translate}}</a></p> | |
9 | + </div> | |
10 | + <form> | |
11 | + <div class="row"> | |
12 | + <div class="col-md-6 register-field"> | |
13 | + <label for="name">{{"account.register.firstNameLabel" | translate }}</label> | |
14 | + <input type="text" class="form-control" id="name" placeholder="joao" ng-model="ctrl.account.name"> | |
15 | + </div> | |
16 | + | |
17 | + <div class="col-md-6 register-field"> | |
18 | + <label for="lastName">{{"account.register.lastNameLabel" | translate }}</label> | |
19 | + <input type="text" class="form-control" id="lastName" placeholder="silva" ng-model="ctrl.account.lastName"> | |
20 | + </div> | |
21 | + | |
22 | + <div class="col-md-12 register-field"> | |
23 | + <label for="login">{{"account.register.usernameLabel" | translate }}</label> | |
24 | + <input type="text" class="form-control" id="login" placeholder="username" ng-model="ctrl.account.login"> | |
25 | + <p class="light-text">ex: ola.coop.br/joaosilva</p> | |
26 | + </div> | |
27 | + | |
28 | + <div class="col-md-12 register-field"> | |
29 | + <label for="email">{{"account.register.emailLabel" | translate }}</label> | |
30 | + <input type="text" class="form-control" id="email" placeholder="Email" ng-model="ctrl.account.email"> | |
31 | + </div> | |
32 | + | |
33 | + <div class="col-md-6 register-field"> | |
34 | + <label for="password">{{"account.register.passwordLabel" | translate }}</label> | |
35 | + <input type="password" class="form-control" id="password" placeholder="Password" ng-model="ctrl.account.password"> | |
36 | + </div> | |
37 | + | |
38 | + <div class="col-md-6 register-field"> | |
39 | + <label for="password-confirmation">{{"account.register.passwordConfirmationLabel" | translate}}</label> | |
40 | + <input type="password" class="form-control" id="passwordConfirmation" placeholder="Password Confirmation" ng-model="ctrl.account.passwordConfirmation"> | |
41 | + </div> | |
42 | + | |
43 | + <div class="col-md-12"> | |
44 | + <p class="terms-info">{{"account.register.accountCreatingMessage" | translate}} <a href="#">{{"account.register.termsOfUseMessage" | translate}}</a>.</p> | |
45 | + </div> | |
46 | + | |
47 | + <div class="col-md-12"> | |
48 | + <button type="submit" class="btn btn-default" ng-click="ctrl.signup(ctrl.account)">{{"account.register.signupMessage" | translate}}</button> | |
49 | + </div> | |
50 | + | |
51 | + </div> | |
52 | + </form> | |
53 | + | |
54 | + <p class="already-registered-message">{{"account.register.haveAccountMessage" | translate}}</p> | |
55 | + | |
56 | +</div> | ... | ... |
... | ... | @@ -0,0 +1,22 @@ |
1 | +import { Inject, Input, Component, Output, EventEmitter, } from 'ng-forward'; | |
2 | + | |
3 | +@Component({ | |
4 | + selector: 'noosfero-register', | |
5 | + templateUrl: 'app/account/register-component.html', | |
6 | +}) | |
7 | + | |
8 | +@Inject("$http") | |
9 | +export class RegisterComponent { | |
10 | + constructor(private $http: ng.IHttpService) { } | |
11 | + | |
12 | + signup (account: any) { | |
13 | + if (account.password === account.passwordConfirmation) { | |
14 | + this.$http.post("http://localhost:3000/api/v1/register", "login="+account.login+"&email="+account.email+"&password="+account.password).then((response) => { | |
15 | + console.log("User " + account.login + " created, please activate your account."); | |
16 | + }); | |
17 | + } else { | |
18 | + alert("Wrong password confirmation."); | |
19 | + } | |
20 | + } | |
21 | + | |
22 | +} | ... | ... |
... | ... | @@ -0,0 +1,38 @@ |
1 | +.register-page button { | |
2 | + width: 100%; | |
3 | + text-transform: uppercase; | |
4 | + font-weight: 600; | |
5 | +} | |
6 | + | |
7 | +.register-page .light-text { | |
8 | + color: #BBB; | |
9 | + margin-top: 0px; | |
10 | + margin-bottom: 0px; | |
11 | + font-weight: 600; | |
12 | +} | |
13 | + | |
14 | +.register-page .terms-info { | |
15 | + margin-top: 30px; | |
16 | + margin-bottom: 30px; | |
17 | +} | |
18 | + | |
19 | +.register-page .welcome-message { | |
20 | + text-align: center; | |
21 | +} | |
22 | + | |
23 | +.register-page .already-registered-message { | |
24 | + margin-top: 60px; | |
25 | + text-align: center; | |
26 | +} | |
27 | + | |
28 | +.register-page input { | |
29 | + height: 40px; | |
30 | +} | |
31 | + | |
32 | +.register-page .register-field { | |
33 | + margin-bottom: 25px; | |
34 | +} | |
35 | + | |
36 | +.register-page input:focus { | |
37 | + border: 2px solid #bbb; | |
38 | +} | ... | ... |
src/app/layout/navbar/navbar.html
... | ... | @@ -20,6 +20,12 @@ |
20 | 20 | <a ng-href="#" ng-click="ctrl.openLogin()">{{"navbar.login" | translate}}</a> |
21 | 21 | </li> |
22 | 22 | |
23 | + <li ng-show="!ctrl.currentUser"> | |
24 | + <a ui-sref="main.register"> | |
25 | + Sign Up | |
26 | + </a> | |
27 | + </li> | |
28 | + | |
23 | 29 | <li class="dropdown profile-menu" ng-show="ctrl.currentUser" uib-dropdown> |
24 | 30 | <a href="#" class="dropdown-toggle" aria-expanded="false" uib-dropdown-toggle> |
25 | 31 | <noosfero-profile-image [profile]="ctrl.currentUser.person" class="profile-image"></noosfero-profile-image> | ... | ... |
src/app/main/main.component.ts
... | ... | @@ -8,6 +8,7 @@ import {ProfileComponent} from "../profile/profile.component"; |
8 | 8 | import {BoxesComponent} from "../layout/boxes/boxes.component"; |
9 | 9 | import {BlockComponent} from "../layout/blocks/block.component"; |
10 | 10 | import {EnvironmentComponent} from "../environment/environment.component"; |
11 | +import {RegisterComponent} from "../account/register.component"; | |
11 | 12 | import {EnvironmentHomeComponent} from "../environment/environment-home.component"; |
12 | 13 | import {PeopleBlockComponent} from "../layout/blocks/people/people-block.component"; |
13 | 14 | import {DisplayContentBlockComponent} from "../layout/blocks/display-content/display-content-block.component"; |
... | ... | @@ -126,6 +127,18 @@ export class EnvironmentContent { |
126 | 127 | } |
127 | 128 | }, |
128 | 129 | { |
130 | + url: '/account/signup', | |
131 | + component: RegisterComponent, | |
132 | + name: 'main.register', | |
133 | + views: { | |
134 | + "content": { | |
135 | + templateUrl: "app/account/register.html", | |
136 | + controller: RegisterComponent, | |
137 | + controllerAs: "vm" | |
138 | + } | |
139 | + } | |
140 | + }, | |
141 | + { | |
129 | 142 | url: "^/:profile", |
130 | 143 | abstract: true, |
131 | 144 | component: ProfileComponent, | ... | ... |
src/languages/en.json
... | ... | @@ -26,6 +26,19 @@ |
26 | 26 | "auth.form.login_button": "Login", |
27 | 27 | "navbar.content_viewer_actions.new_item": "New Item", |
28 | 28 | "navbar.profile_actions.new_item": "New Item", |
29 | + "account.register.welcomeMessage": "Nice to have you there!", | |
30 | + "account.register.seeMoreMessage": "See more ", | |
31 | + "account.register.informationsMessage": "informations", | |
32 | + "account.register.firstNameLabel": "First Name", | |
33 | + "account.register.lastNameLabel": "Last Name", | |
34 | + "account.register.usernameLabel": "Username", | |
35 | + "account.register.emailLabel": "Email", | |
36 | + "account.register.passwordLabel": "Password", | |
37 | + "account.register.passwordConfirmationLabel": "Password Confirmation", | |
38 | + "account.register.accountCreatingMessage": "By creating an account, you are agreeing with the ", | |
39 | + "account.register.signupMessage": "Create Account", | |
40 | + "account.register.haveAccountMessage": "Already have an account?", | |
41 | + "account.register.termsOfUseMessage": "terms of use", | |
29 | 42 | "navbar.content_viewer_actions.new_post": "New Post", |
30 | 43 | "//TODO": "Create a way to load plugin translatios - Move plugins translations to the plugins translations files", |
31 | 44 | "navbar.content_viewer_actions.new_discussion": "New Discussion", | ... | ... |
src/languages/pt.json
... | ... | @@ -25,6 +25,19 @@ |
25 | 25 | "auth.form.password": "Senha", |
26 | 26 | "auth.form.login_button": "Login", |
27 | 27 | "navbar.content_viewer_actions.new_item": "Novo Item", |
28 | + "account.register.welcomeMessage": "Ótimo ter você aqui!", | |
29 | + "account.register.seeMoreMessage": "Saiba mais ", | |
30 | + "account.register.informationsMessage": "informações", | |
31 | + "account.register.firstNameLabel": "Nome", | |
32 | + "account.register.lastNameLabel": "Sobrenome", | |
33 | + "account.register.usernameLabel": "Nome de usuário", | |
34 | + "account.register.emailLabel": "Email", | |
35 | + "account.register.passwordLabel": "Senha", | |
36 | + "account.register.passwordConfirmationLabel": "Confirmar senha", | |
37 | + "account.register.accountCreatingMessage": "Ao criar uma conta, você está concordando com os ", | |
38 | + "account.register.termsOfUseMessage": "termos de uso", | |
39 | + "account.register.signupMessage": "Criar Conta", | |
40 | + "account.register.haveAccountMessage": "Já possui uma conta?", | |
28 | 41 | "navbar.content_viewer_actions.new_post": "Novo Artigo", |
29 | 42 | "navbar.content_viewer_actions.new_discussion": "Nova Discussão", |
30 | 43 | "notification.error.default.message": "Algo deu errado!", | ... | ... |