Commit 007b2c4e2a5bb6dd6bf0e5619888c2c64db9ba04

Authored by Dylan Guedes
1 parent 0e6cfa00
Exists in 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>
src/app/account/.register-component.html.swp 0 → 100644
No preview for this file type
src/app/account/register-component.html 0 → 100644
... ... @@ -0,0 +1,43 @@
  1 +<div class="register-page">
  2 + <h1>Ótimo ter você aqui!</h1>
  3 + <p>
  4 + "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
  5 + "There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
  6 + </p>
  7 + <p>Saiba mais <a href="#">informações</a></p>
  8 + <form>
  9 + <div class="row">
  10 + <div class="col-md-6">
  11 + <label for="name">First Name</label>
  12 + <input type="text" class="form-control" id="name" placeholder="joao" ng-model="ctrl.account.name">
  13 + </div>
  14 +
  15 + <div class="col-md-6">
  16 + <label for="lastName">Last Name</label>
  17 + <input type="text" class="form-control" id="lastName" placeholder="silva" ng-model="ctrl.account.lastName">
  18 + </div>
  19 +
  20 + <div class="col-md-12">
  21 + <label for="login">Username</label>
  22 + <input type="text" class="form-control" id="login" placeholder="username" ng-model="ctrl.account.login">
  23 + </div>
  24 +
  25 + <div class="col-md-12">
  26 + <label for="email">Email</label>
  27 + <input type="text" class="form-control" id="email" placeholder="Email" ng-model="ctrl.account.email">
  28 + </div>
  29 +
  30 + <div class="col-md-6">
  31 + <label for="password">Password</label>
  32 + <input type="password" class="form-control" id="password" placeholder="Password" ng-model="ctrl.account.password">
  33 + </div>
  34 +
  35 + <div class="col-md-6">
  36 + <label for="password-confirmation">Password Confirmation</label>
  37 + <input type="password" class="form-control" id="passwordConfirmation" placeholder="Password Confirmation" ng-model="ctrl.account.passwordConfirmation">
  38 + </div>
  39 + </div>
  40 +
  41 + <button type="submit" class="btn btn-default" ng-click="ctrl.signup(ctrl.account)">SignUp</button>
  42 + </form>
  43 +</div>
... ...
src/app/account/register.component.ts 0 → 100644
... ... @@ -0,0 +1,26 @@
  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", {
  15 + "login": account.login,
  16 + "email": account.email,
  17 + "password": account.password
  18 + }).then((response) => {
  19 + console.log(response);
  20 + });
  21 + } else {
  22 + alert("Wrong password confirmation.");
  23 + }
  24 + }
  25 +
  26 +}
... ...
src/app/account/register.html 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +<div class="row">
  2 + <div class="col-md-3"></div>
  3 +
  4 + <!-- component at center of page -->
  5 + <div class="col-md-6">
  6 + <noosfero-register></noosfero-register>
  7 + </div>
  8 +
  9 + <div class="col-md-3"></div>
  10 +</div>
... ...
src/app/layout/navbar/navbar.html
... ... @@ -22,6 +22,12 @@
22 22 <a ng-href="#" ng-click="ctrl.openLogin()">{{"navbar.login" | translate}}</a>
23 23 </li>
24 24  
  25 + <li ng-show="!ctrl.currentUser">
  26 + <a ui-sref="main.register">
  27 + Sign Up
  28 + </a>
  29 + </li>
  30 +
25 31 <li class="dropdown profile-menu" ng-show="ctrl.currentUser" uib-dropdown>
26 32 <a href="#" class="dropdown-toggle" aria-expanded="false" uib-dropdown-toggle>
27 33 <noosfero-profile-image [profile]="ctrl.currentUser.person" class="profile-image"></noosfero-profile-image>
... ...
src/app/main/main.component.ts
... ... @@ -7,6 +7,7 @@ import {ProfileComponent} from &quot;../profile/profile.component&quot;;
7 7 import {BoxesComponent} from "../layout/boxes/boxes.component";
8 8 import {BlockComponent} from "../layout/blocks/block.component";
9 9 import {EnvironmentComponent} from "../environment/environment.component";
  10 +import {RegisterComponent} from "../account/register.component";
10 11 import {EnvironmentHomeComponent} from "../environment/environment-home.component";
11 12 import {PeopleBlockComponent} from "../layout/blocks/people-block/people-block.component";
12 13 import {LinkListBlockComponent} from "./../layout/blocks/link-list/link-list.component";
... ... @@ -109,6 +110,18 @@ export class EnvironmentContent {
109 110 }
110 111 },
111 112 {
  113 + url: '/account/signup',
  114 + component: RegisterComponent,
  115 + name: 'main.register',
  116 + views: {
  117 + "content": {
  118 + templateUrl: "app/account/register.html",
  119 + controller: RegisterComponent,
  120 + controllerAs: "vm"
  121 + }
  122 + }
  123 + },
  124 + {
112 125 url: "^/:profile",
113 126 abstract: true,
114 127 component: ProfileComponent,
... ...