File tree Expand file tree Collapse file tree 3 files changed +33
-12
lines changed
components/forgot-password Expand file tree Collapse file tree 3 files changed +33
-12
lines changed Original file line number Diff line number Diff line change 1
- < form ng-submit ="vm.submit() " class ="ForgotPassword-form ">
1
+ < form ng-submit ="vm.submit() " class ="ForgotPassword-form " name =" vm.forgotPasswordForm " novalidate >
2
2
< div class ="callout callout-danger " ng-if ="vm.errorTrigger ">
3
3
< h4 > Error:</ h4 >
4
4
< p > Please check your email and try again.</ p >
5
5
</ div >
6
- < div class ="form-group has-feedback ">
7
- < input type ="email " class ="form-control " placeholder ="Please enter your email address " ng-model ="vm.email ">
6
+ < div class ="form-group has-feedback " ng-class ="{ 'has-error': vm.forgotPasswordForm.email.$invalid && ( vm.formSubmitted || vm.forgotPasswordForm.email.$touched) } ">
7
+ < input type ="email " class ="form-control " placeholder ="Please enter your email address "
8
+ name ="email "
9
+ ng-model ="vm.email "
10
+ ng-required ="true "
11
+ ng-pattern ="/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/ ">
8
12
< span class ="glyphicon glyphicon-envelope form-control-feedback "> </ span >
13
+ < p ng-show ="vm.forgotPasswordForm.email.$error.email && ( vm.formSubmitted || vm.forgotPasswordForm.email.$touched) " class ="help-block "> This is not a valid email</ p >
14
+ < p ng-show ="vm.forgotPasswordForm.email.$error.required && ( vm.formSubmitted || vm.forgotPasswordForm.email.$touched) " class ="help-block "> Email is required.</ p >
9
15
</ div >
10
16
< div class ="row ">
11
- < div class ="col-xs-8 ">
12
- </ div >
13
- < div class =" col-xs-4 " >
14
- < button type =" submit " class =" btn btn-primary btn-block btn-flat " > Submit < /button >
17
+ < div class ="col-xs-12 ">
18
+ < button type =" submit " class =" btn btn-primary btn-block btn-flat " >
19
+ Submit
20
+ </ button >
15
21
</ div >
16
22
</ div >
17
23
</ form >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ class ForgotPasswordController {
4
4
5
5
this . API = API
6
6
this . $state = $state
7
- this . errorTrigger = false
7
+ this . formSubmitted = false
8
8
}
9
9
10
10
$onInit ( ) {
@@ -17,7 +17,7 @@ class ForgotPasswordController {
17
17
} ) . then ( ( ) => {
18
18
this . $state . go ( 'login' , { successMsg : `Please check your email for instructions on how to reset your password.` } )
19
19
} , ( ) => {
20
- this . errorTrigger = true
20
+ this . formSubmitted = true
21
21
} )
22
22
}
23
23
}
Original file line number Diff line number Diff line change 3
3
< a ui-sref ="login "> < b > Admin</ b > LTE</ a >
4
4
</ div >
5
5
< div class ="login-box-body ">
6
- < h3 > Forgot your password?</ h3 >
7
- < forgot-password > </ forgot-password >
8
- < a ui-sref ="login "> Back to Login Page</ a >
6
+ < div class ="row ">
7
+ < div class ="col-xs-12 ">
8
+ < div class ="text-center ">
9
+ < h3 > Forgot your password?</ h3 >
10
+ </ div >
11
+ </ div >
12
+ </ div >
13
+ < div class ="row ">
14
+ < div class ="col-xs-12 ">
15
+ < forgot-password > </ forgot-password >
16
+ </ div >
17
+ </ div >
18
+ < br >
19
+ < div class ="row ">
20
+ < div class ="col-xs-12 ">
21
+ < a ui-sref ="login "> Back to Login Page</ a >
22
+ </ div >
23
+ </ div >
9
24
</ div >
10
25
</ div >
You can’t perform that action at this time.
0 commit comments