diff --git a/Content/css/dockyard.css b/Content/css/dockyard.css index c664661f11..e1b5af2a20 100644 --- a/Content/css/dockyard.css +++ b/Content/css/dockyard.css @@ -21,6 +21,17 @@ cursor: pointer; } + +.before-submit.ng-touched.ng-invalid-required { + border-color: #ebccd1; +} +.before-submit.ng-dirty.ng-invalid { + border-color: #ebccd1; +} +.before-submit.ng-untouched.ng-invalid { + border-color: #ccc; +} + .form-horizontal .control-label { text-align: left; } diff --git a/Scripts/app/controllers/ManageUserController.ts b/Scripts/app/controllers/ManageUserController.ts index b3433ad83f..85e27a327b 100644 --- a/Scripts/app/controllers/ManageUserController.ts +++ b/Scripts/app/controllers/ManageUserController.ts @@ -6,7 +6,7 @@ NewPassword: string; ConfirmNewPassword: string; Submit: (isValid: boolean) => void; - Message: string; + Message: any; } class ManageUserController { @@ -27,9 +27,10 @@ $scope.NewPassword = ""; $scope.ConfirmNewPassword = ""; $scope.CurrentPassword = ""; + $scope.Message = new Object(); } - private Submit(isValid) { + private Submit(isValid, sub) { if (isValid) { this.UserService.update({ oldPassword: this.$scope.CurrentPassword, @@ -37,13 +38,16 @@ confirmPassword: this.$scope.ConfirmNewPassword }).$promise.then( (result) => { - this.$scope.Message = "Your password has been changed!"; + this.$scope.Message.text = "Your password has been changed!"; + this.$scope.Message.type = "info"; }, (failResponse) => { - this.$scope.Message = failResponse.data.details.exception.Message; + this.$scope.Message.text = failResponse.data.details.exception.Message; + this.$scope.Message.type = "error"; }); } else { - this.$scope.Message = "There are still invalid fields below"; + this.$scope.Message.text = "There are still invalid fields below"; + this.$scope.Message.type = "error"; } }; } diff --git a/Views/AngularTemplate/ChangePassword.cshtml b/Views/AngularTemplate/ChangePassword.cshtml index 258e46748a..8bbb96205f 100644 --- a/Views/AngularTemplate/ChangePassword.cshtml +++ b/Views/AngularTemplate/ChangePassword.cshtml @@ -13,33 +13,43 @@