Commit 224b593d39223d8f7cef35e2e1ea94bef4e3e4f8

Authored by Michel Felipe
1 parent 015b68e2

Added module 'angular-password' to check password confir match

bower.json
... ... @@ -39,7 +39,8 @@
39 39 "angular-click-outside": "^2.7.1",
40 40 "ng-ckeditor": "^0.2.1",
41 41 "angular-tag-cloud": "^0.3.0",
42   - "angular-ui-switch": "^0.1.1"
  42 + "angular-ui-switch": "^0.1.1",
  43 + "angular-password": "^1.0.1"
43 44 },
44 45 "devDependencies": {
45 46 "angular-mocks": "~1.5.0"
... ...
src/app/account/register-component.html
... ... @@ -51,11 +51,12 @@
51 51 <div class="form-group col-md-6 register-field" ng-class="ctrl.isInvalid(signupForm.passwordConfirm)">
52 52 <div class="input-group">
53 53 <span class="input-group-addon"><i class="fa fa-unlock-alt"></i></span>
54   - <input type="password" class="form-control" id="passwordConfirm" name="passwordConfirm" placeholder="{{'account.register.passwordConfirmationLabel' | translate}}" ng-model="ctrl.account.password_confirmation" required>
  54 + <input type="password" class="form-control" id="passwordConfirm" name="passwordConfirm" match-password="password" placeholder="{{'account.register.passwordConfirmationLabel' | translate}}" ng-model="ctrl.account.password_confirmation" required>
55 55 </div>
56 56 <div class="help-block" ng-show="signupForm.passwordConfirm.$touched" ng-messages="signupForm.passwordConfirm.$error">
57 57 <ul class="list-unstyled">
58 58 <li ng-messages-include="languages/messages.html"></li>
  59 + <li ng-message="passwordMatch" translate="messages.invalid.passwordMatch"></li>
59 60 </ul>
60 61 </div>
61 62 </div>
... ...
src/app/main/main.component.ts
1 1 import * as plugins from "../../plugins";
2   -import {bundle, Component, StateConfig, Inject} from "ng-forward";
3   -import {ArticleBlogComponent} from "./../article/types/blog/blog.component";
4   -
5   -import {ArticleViewComponent} from "./../article/article-default-view.component";
6   -
7   -import {ProfileComponent} from "../profile/profile.component";
8   -import {BoxesComponent} from "../layout/boxes/boxes.component";
9   -import {BlockContentComponent} from "../layout/blocks/block-content.component";
10   -import {BlockComponent} from "../layout/blocks/block.component";
11   -import {EnvironmentComponent} from "../environment/environment.component";
12   -import {EnvironmentHomeComponent} from "../environment/environment-home.component";
13   -import {PeopleBlockComponent} from "../layout/blocks/people/people-block.component";
14   -import {DisplayContentBlockComponent} from "../layout/blocks/display-content/display-content-block.component";
15   -import {LinkListBlockComponent} from "../layout/blocks/link-list/link-list-block.component";
16   -import {RecentDocumentsBlockComponent} from "../layout/blocks/recent-documents/recent-documents-block.component";
17   -import {ProfileImageBlockComponent} from "../layout/blocks/profile-image/profile-image-block.component";
18   -import {RawHTMLBlockComponent} from "../layout/blocks/raw-html/raw-html-block.component";
19   -import {StatisticsBlockComponent} from "../layout/blocks/statistics/statistics-block.component";
20   -import {PersonTagsPluginInterestsBlockComponent} from "../layout/blocks/person-tags-plugin-interests/person-tags-plugin-interests-block.component";
21   -import {TagsBlockComponent} from "../layout/blocks/tags/tags-block.component";
22   -import {CustomContentComponent} from "../profile/custom-content/custom-content.component";
23   -import {RecentActivitiesPluginActivitiesBlockComponent} from "../layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.component";
24   -import {RegisterComponent} from "../account/register.component";
25   -
26   -import {MembersBlockComponent} from "../layout/blocks/members/members-block.component";
27   -import {CommunitiesBlockComponent} from "../layout/blocks/communities/communities-block.component";
28   -
29   -import {LoginBlockComponent} from "../layout/blocks/login-block/login-block.component";
30   -
31   -import {NoosferoTemplate} from "../shared/pipes/noosfero-template.filter";
32   -import {DateFormat} from "../shared/pipes/date-format.filter";
33   -
34   -import {AuthService} from "../login/auth.service";
35   -import {SessionService} from "../login/session.service";
36   -import {EnvironmentService} from "./../../lib/ng-noosfero-api/http/environment.service";
37   -import {NotificationService} from "../shared/services/notification.service";
38   -import {RegisterService} from "./../../lib/ng-noosfero-api/http/register.service";
39   -
40   -import {BodyStateClassesService} from "./../layout/services/body-state-classes.service";
41   -
42   -import {Navbar} from "../layout/navbar/navbar";
43   -
44   -import {SidebarComponent} from "../layout/sidebar/sidebar.component";
45   -
46   -import {MainBlockComponent} from "../layout/blocks/main/main-block.component";
47   -import {HtmlEditorComponent} from "../shared/components/html-editor/html-editor.component";
48   -import {PermissionDirective} from "../shared/components/permission/permission.directive";
49   -import {SearchComponent} from "../search/search.component";
50   -import {SearchFormComponent} from "../search/search-form/search-form.component";
  2 +import { bundle, Component, StateConfig, Inject } from "ng-forward";
  3 +import { ArticleBlogComponent } from "./../article/types/blog/blog.component";
  4 +
  5 +import { ArticleViewComponent } from "./../article/article-default-view.component";
  6 +
  7 +import { ProfileComponent } from "../profile/profile.component";
  8 +import { BoxesComponent } from "../layout/boxes/boxes.component";
  9 +import { BlockContentComponent } from "../layout/blocks/block-content.component";
  10 +import { BlockComponent } from "../layout/blocks/block.component";
  11 +import { EnvironmentComponent } from "../environment/environment.component";
  12 +import { EnvironmentHomeComponent } from "../environment/environment-home.component";
  13 +import { PeopleBlockComponent } from "../layout/blocks/people/people-block.component";
  14 +import { DisplayContentBlockComponent } from "../layout/blocks/display-content/display-content-block.component";
  15 +import { LinkListBlockComponent } from "../layout/blocks/link-list/link-list-block.component";
  16 +import { RecentDocumentsBlockComponent } from "../layout/blocks/recent-documents/recent-documents-block.component";
  17 +import { ProfileImageBlockComponent } from "../layout/blocks/profile-image/profile-image-block.component";
  18 +import { RawHTMLBlockComponent } from "../layout/blocks/raw-html/raw-html-block.component";
  19 +import { StatisticsBlockComponent } from "../layout/blocks/statistics/statistics-block.component";
  20 +import { PersonTagsPluginInterestsBlockComponent } from "../layout/blocks/person-tags-plugin-interests/person-tags-plugin-interests-block.component";
  21 +import { TagsBlockComponent } from "../layout/blocks/tags/tags-block.component";
  22 +import { CustomContentComponent } from "../profile/custom-content/custom-content.component";
  23 +import { RecentActivitiesPluginActivitiesBlockComponent } from "../layout/blocks/recent-activities-plugin-activities/recent-activities-plugin-activities-block.component";
  24 +import { RegisterComponent } from "../account/register.component";
  25 +
  26 +import { MembersBlockComponent } from "../layout/blocks/members/members-block.component";
  27 +import { CommunitiesBlockComponent } from "../layout/blocks/communities/communities-block.component";
  28 +
  29 +import { LoginBlockComponent } from "../layout/blocks/login-block/login-block.component";
  30 +
  31 +import { NoosferoTemplate } from "../shared/pipes/noosfero-template.filter";
  32 +import { DateFormat } from "../shared/pipes/date-format.filter";
  33 +
  34 +import { AuthService } from "../login/auth.service";
  35 +import { SessionService } from "../login/session.service";
  36 +import { EnvironmentService } from "./../../lib/ng-noosfero-api/http/environment.service";
  37 +import { NotificationService } from "../shared/services/notification.service";
  38 +import { RegisterService } from "./../../lib/ng-noosfero-api/http/register.service";
  39 +
  40 +import { BodyStateClassesService } from "./../layout/services/body-state-classes.service";
  41 +
  42 +import { Navbar } from "../layout/navbar/navbar";
  43 +
  44 +import { SidebarComponent } from "../layout/sidebar/sidebar.component";
  45 +
  46 +import { MainBlockComponent } from "../layout/blocks/main/main-block.component";
  47 +import { HtmlEditorComponent } from "../shared/components/html-editor/html-editor.component";
  48 +import { PermissionDirective } from "../shared/components/permission/permission.directive";
  49 +import { SearchComponent } from "../search/search.component";
  50 +import { SearchFormComponent } from "../search/search-form/search-form.component";
51 51  
52 52 import { EVENTS_HUB_KNOW_EVENT_NAMES, EventsHubService } from "../shared/services/events-hub.service";
53 53 import { NoosferoKnownEvents } from "../known-events";
... ... @@ -124,7 +124,7 @@ export class EnvironmentContent {
124 124 "angular-bind-html-compile", "angularMoment", "angular.filter", "akoenig.deckgrid",
125 125 "angular-timeline", "duScroll", "oitozero.ngSweetAlert",
126 126 "pascalprecht.translate", "tmh.dynamicLocale", "angularLoad",
127   - "angular-click-outside", "ngTagCloud", "noosfero.init", "uiSwitch"]
  127 + "angular-click-outside", "ngTagCloud", "noosfero.init", "uiSwitch", "ngPassword"]
128 128 })
129 129 @StateConfig([
130 130 {
... ...
src/languages/en.json
... ... @@ -119,5 +119,5 @@
119 119 "messages.invalid.maxlength": "This field is too long",
120 120 "messages.invalid.minlength": "This field is too short",
121 121 "messages.invalid.email": "This needs to be a valid email",
122   - "messages.invalid.passwordConfirm": "Passwords do not match"
  122 + "messages.invalid.passwordMatch": "Your passwords did not match"
123 123 }
... ...
src/languages/pt.json
... ... @@ -122,5 +122,5 @@
122 122 "messages.invalid.maxlength": "O valor é muito longo",
123 123 "messages.invalid.minlength": "O valor é muito curto",
124 124 "messages.invalid.email": "Informe um email válido",
125   - "messages.invalid.passwordConfirm": "As senhas não coincidem"
  125 + "messages.invalid.passwordMatch": "As senhas não coincidem"
126 126 }
... ...