fix forms: login and create profile

This commit is contained in:
Gustavo Maximiliano Cortez 2014-10-09 18:53:31 -03:00 committed by Matias Alejo Garcia
parent 0b7e9be611
commit 662d61d2a9
5 changed files with 64 additions and 33 deletions

View File

@ -158,6 +158,8 @@ input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill, inpu
z-index: 9999;
}
.home label,
.createProfile label,
.join label,
.open label,
.setup label {
@ -175,6 +177,8 @@ a:hover {
color: #2980b9;
}
.home input,
.createProfile input,
.open input,
.join input,
.setup input,
@ -188,6 +192,8 @@ a:hover {
color: #fff !important;
}
.home select,
.createProfile select,
.open select,
.join select,
.setup select,
@ -248,7 +254,7 @@ a:hover {
background-color: #F8F8FB;
}
.home, .open, .join, .waiting-copayers, .setup, .import, .settings {
.home, .createProfile, .open, .join, .waiting-copayers, .setup, .import, .settings {
margin-top: 15%;
color: #fff;
}

View File

@ -4,7 +4,10 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
controllerUtils.redirIfLogged();
$scope.createProfile = function(form) {
if (form && form.$invalid) {
notification.error('Error', 'Please enter the required fields');
return;
}
$scope.loading = true;
copay.Identity.create(form.email.$modelValue, form.password.$modelValue, {
pluginManager: pluginManager,

View File

@ -5,6 +5,10 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
controllerUtils.redirIfLogged();
$scope.openProfile = function(form) {
if (form && form.$invalid) {
notification.error('Error', 'Please enter the required fields');
return;
}
$scope.loading = true;
copay.Identity.open(form.email.$modelValue, form.password.$modelValue, {
pluginManager: pluginManager,

View File

@ -12,31 +12,52 @@
<div ng-include="'views/includes/version.html'"></div>
</div>
<div class="large-8 columns line-dashed-setup-v">
<div class="button-setup">
<div class="box-setup">
<h1 class="text-white line-sidebar-b" translate >Create Profile</h1>
<form name="profileForm" ng-submit="createProfile(profileForm)" novalidate>
<fieldset>
<label for="insight-livenet">email</label>
<input type="text" ng-model="profile.email" class="form-control" name="email">
<label for="insight-testnet">Password</label>
<input type="text" ng-model="profile.password" class="form-control" name="password">
<label for="insight-testnet">Repeat Password</label>
<input type="text" ng-model="profile.repeatpassword" class="form-control" name="repeatpassword">
</fieldset>
<form name="profileForm" ng-submit="createProfile(profileForm)" novalidate>
<div class="row collapse">
<div class="small-12 columns">
<input type="email" ng-model="email" class="form-control"
name="email" placeholder="Email" required>
<small class="icon-input" ng-show="!profileForm.email.$invalid &&
!profileForm.email.$pristine"><i class="fi-check"></i></small>
<small class="icon-input" ng-show="profileForm.email.$invalid &&
!profileForm.email.$pristine"><i class="fi-x"></i></small>
</div>
</div>
<input id="password" type="password" ng-model="$parent.password"
class="form-control" name="password" placeholder="{{'Choose a password'|translate}}" check-strength="passwordStrength"
tooltip-html-unsafe="Password strength: <i>{{passwordStrength}}</i><br/><span class='size-12'>Tip: Use lower and uppercase, numbers and symbols</span>" tooltip-trigger="focus" required tooltip-placement="top">
<div class="pr">
<input type="password" ng-model="repeatpassword"
class="form-control" name="repeatpassword"
placeholder="{{'Repeat password'|translate}}"
match="password" required >
<small class="icon-input"
ng-show="profileForm.repeatpassword.$dirty &&
!profileForm.repeatpassword.$invalid"><i class="fi-check"></i></small>
<small class="icon-input"
ng-show="profileForm.repeatpassword.$dirty &&
profileForm.repeatpassword.$invalid"><i class="fi-x"></i></small>
<p class="m15b text-gray size-12"
ng-show="profileForm.repeatpassword.$dirty &&
profileForm.repeatpassword.$invalid">
<i class="fi-x m5r"></i>
{{'Passwords must match'|translate}}
</p>
</div>
<div class="text-right">
<button translate type="submit" class="button primary m0 ng-binding" ng-disabled="setupForm.$invalid || loading" disabled="disabled" ng-click="save()">
<a href="#!/" class="back-button text-white m20r">&laquo; <span translate>Back</span></a>
<button translate type="submit" class="button primary m0"
ng-disabled="profileForm.$invalid || loading">
Create
</button>
</div>
</form>
</div>
<div class="button-setup">
<a translate class="text-secondary" href="#!/">Back</a>
</div>
</div>
</div>
</div>

View File

@ -13,26 +13,23 @@
<div ng-include="'views/includes/version.html'"></div>
</div>
<div class="large-8 columns line-dashed-setup-v">
<div class="button-setup">
<div class="box-setup">
<h1 class="text-white line-sidebar-b" translate >Login </h1>
<form name="loginForm" ng-submit="openProfile(loginForm)" novalidate>
<fieldset>
<label for="email">Email</label>
<input type="text" ng-model="email" class="form-control" name="email">
<label for="password">Password</label>
<input type="text" ng-model="password" class="form-control" name="password">
</fieldset>
<form name="loginForm" ng-submit="openProfile(loginForm)" novalidate>
<input type="email" ng-model="email" class="form-control"
name="email" placeholder="Email" required>
<input type="password" ng-model="password" class="form-control"
name="password" placeholder="Password" required>
<div class="text-right">
<button translate type="submit" class="button primary m0 ng-binding" ng-disabled="setupForm.$invalid || loading" disabled="disabled" ng-click="save()">
Login
<button translate type="submit" class="button primary m0"
ng-disabled="loginForm.$invalid || loading">
Login
</button>
</div>
</form>
</div>
<div class="button-setup">
<a translate class="text-secondary" href="#!/createProfile">Create a profile</a>
</div>