diff --git a/src/app/account/register.component.ts b/src/app/account/register.component.ts index a2f1f16..0e6e9c2 100644 --- a/src/app/account/register.component.ts +++ b/src/app/account/register.component.ts @@ -1,5 +1,6 @@ import { Inject, Input, Component, Output, EventEmitter, provide } from 'ng-forward'; -import {RegisterService} from "./../../lib/ng-noosfero-api/http/register.service"; +import { RegisterService } from "./../../lib/ng-noosfero-api/http/register.service"; +import { NotificationService } from "./../shared/services/notification.service"; @Component({ selector: 'noosfero-register', @@ -9,11 +10,11 @@ import {RegisterService} from "./../../lib/ng-noosfero-api/http/register.service ] }) -@Inject("$state", RegisterService) +@Inject("$state", RegisterService, NotificationService) export class RegisterComponent { @Input() account: any; - constructor(private $state: ng.ui.IStateService, public registerService: RegisterService) { + constructor(private $state: ng.ui.IStateService, public registerService: RegisterService, private notificationService: NotificationService) { this.account = {}; } @@ -22,13 +23,13 @@ export class RegisterComponent { this.registerService.createAccount(this.account).then((response) => { if (response.status === 201) { this.$state.transitionTo('main.environment'); + this.notificationService.success({ title: "account.register.success.title", message: "account.register.success.message" }); } else { throw new Error('Invalid attributes'); } }); } else { - alert("Wrong password confirmation."); + this.notificationService.error({ message: "account.register.passwordConfirmation.failed" }); } } - } diff --git a/src/app/login/login.html b/src/app/login/login.html index a4ca688..51cced5 100644 --- a/src/app/login/login.html +++ b/src/app/login/login.html @@ -21,4 +21,7 @@ +
diff --git a/src/languages/en.json b/src/languages/en.json index 801cf0f..b11ff22 100644 --- a/src/languages/en.json +++ b/src/languages/en.json @@ -28,21 +28,9 @@ "auth.form.password": "Password", "auth.form.keepLoggedIn": "Keep me logged in", "auth.form.login_button": "Login", + "auth.createAccount": "Create account", "navbar.content_viewer_actions.new_item": "New Item", "navbar.profile_actions.new_item": "New Item", - "account.register.welcomeMessage": "Nice to have you there!", - "account.register.seeMoreMessage": "See more ", - "account.register.informationsMessage": "informations", - "account.register.firstNameLabel": "First Name", - "account.register.lastNameLabel": "Last Name", - "account.register.usernameLabel": "Username", - "account.register.emailLabel": "Email", - "account.register.passwordLabel": "Password", - "account.register.passwordConfirmationLabel": "Password Confirmation", - "account.register.accountCreatingMessage": "By creating an account, you are agreeing with the ", - "account.register.signupMessage": "Create Account", - "account.register.haveAccountMessage": "Already have an account?", - "account.register.termsOfUseMessage": "terms of use", "navbar.content_viewer_actions.new_post": "New Post", "navbar.content_viewer_actions.new_discussion": "New Discussion", "navbar.profile_actions.new_discussion": "New Discussion", @@ -110,5 +98,21 @@ "block.edition.display_user.all": "All users", "block.edition.display_user.logged": "Logged", "block.edition.display_user.not_logged": "Not logged", - "block.edition.language.label": "Show for:" + "block.edition.language.label": "Show for:", + "account.register.welcomeMessage": "Nice to have you there!", + "account.register.seeMoreMessage": "See more ", + "account.register.informationsMessage": "informations", + "account.register.firstNameLabel": "First Name", + "account.register.lastNameLabel": "Last Name", + "account.register.usernameLabel": "Username", + "account.register.emailLabel": "Email", + "account.register.passwordLabel": "Password", + "account.register.passwordConfirmationLabel": "Password Confirmation", + "account.register.accountCreatingMessage": "By creating an account, you are agreeing with the ", + "account.register.signupMessage": "Create Account", + "account.register.haveAccountMessage": "Already have an account?", + "account.register.termsOfUseMessage": "terms of use", + "account.register.success.title": "Good job!", + "account.register.success.message": "Account created!", + "account.register.passwordConfirmation.failed": "Wrong password confirmation" } diff --git a/src/languages/pt.json b/src/languages/pt.json index 8d2049a..4f53eee 100644 --- a/src/languages/pt.json +++ b/src/languages/pt.json @@ -28,6 +28,7 @@ "auth.form.password": "Senha", "auth.form.keepLoggedIn": "Continuar logado", "auth.form.login_button": "Login", + "auth.createAccount": "Criar conta", "navbar.content_viewer_actions.new_item": "Novo Item", "navbar.profile_actions.new_item": "Novo Item", "navbar.content_viewer_actions.new_post": "Novo Artigo", @@ -110,5 +111,8 @@ "account.register.accountCreatingMessage": "Ao criar uma conta, você está concordando com os ", "account.register.termsOfUseMessage": "termos de uso", "account.register.signupMessage": "Criar Conta", - "account.register.haveAccountMessage": "Já possui uma conta?" + "account.register.haveAccountMessage": "Já possui uma conta?", + "account.register.success.title": "Bom trabalho!", + "account.register.success.message": "Conta criada com sucesso!", + "account.register.passwordConfirmation.failed": "A confirmação de senha não corresponde à senha" } -- libgit2 0.21.2