diff --git a/src/Umbraco.Web.UI.Client/src/less/panel.less b/src/Umbraco.Web.UI.Client/src/less/panel.less index 620099fb84..b8732f5b13 100644 --- a/src/Umbraco.Web.UI.Client/src/less/panel.less +++ b/src/Umbraco.Web.UI.Client/src/less/panel.less @@ -155,3 +155,27 @@ h1.headline{height: 40px; padding: 30px 0 0 20px;} } + // Utility classes + + //SD: Had to add these because if we want to use the bootstrap text colors + // in a panel/editor they'll all show up as white on white - so we need to use the + // form styles +.umb-panel .muted { color: @grayLight; } +.umb-panel a.muted:hover, +.umb-panel a.muted:focus { color: darken(@grayLight, 10%); } + +.umb-panel .text-warning { color: @formWarningText; } +.umb-panel a.text-warning:hover, +.umb-panel a.text-warning:focus { color: darken(@formWarningText, 10%); } + +.umb-panel .text-error { color: @formErrorText; } +.umb-panel a.text-error:hover, +.umb-panel a.text-error:focus { color: darken(@formErrorText, 10%); } + +.umb-panel .text-info { color: @formInfoText; } +.umb-panel a.text-info:hover, +.umb-panel a.text-info:focus { color: darken(@formInfoText, 10%); } + +.umb-panel .text-success { color: @formSuccessText; } +.umb-panel a.text-success:hover, +.umb-panel a.text-success:focus { color: darken(@formSuccessText, 10%); } \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js index e5d8739d51..5dab4f62e7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js @@ -1,45 +1,50 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.ChangePasswordController", function($scope) { - //the model config will contain an object, if it does not we'll create defaults - //NOTE: We will not support doing the password regex on the client side because the regex on the server side - //based on the membership provider cannot always be ported to js from .net directly. - /* - { - hasPassword: true/false, - requiresQuestionAnswer: true/false, - enableReset: true/false, - enablePasswordRetrieval: true/false, - minPasswordLength: 10 - } - */ + function resetModel() { + //the model config will contain an object, if it does not we'll create defaults + //NOTE: We will not support doing the password regex on the client side because the regex on the server side + //based on the membership provider cannot always be ported to js from .net directly. + /* + { + hasPassword: true/false, + requiresQuestionAnswer: true/false, + enableReset: true/false, + enablePasswordRetrieval: true/false, + minPasswordLength: 10 + } + */ - //set defaults if they are not available - if (!$scope.model.config || $scope.model.config.hasPassword === undefined) { - $scope.model.config.hasPassword = false; + //set defaults if they are not available + if (!$scope.model.config || $scope.model.config.hasPassword === undefined) { + $scope.model.config.hasPassword = false; + } + if (!$scope.model.config || $scope.model.config.enablePasswordRetrieval === undefined) { + $scope.model.config.enablePasswordRetrieval = true; + } + if (!$scope.model.config || $scope.model.config.requiresQuestionAnswer === undefined) { + $scope.model.config.requiresQuestionAnswer = false; + } + if (!$scope.model.config || $scope.model.config.enableReset === undefined) { + $scope.model.config.enableReset = true; + } + if (!$scope.model.config || $scope.model.config.minPasswordLength === undefined) { + $scope.model.config.minPasswordLength = 0; + } + + //set the model defaults - we never get supplied a password from the server so this is ok to overwrite. + $scope.model.value = { + newPassword: "", + oldPassword: null, + reset: null, + answer: null + }; + + //the value to compare to match passwords + $scope.model.confirm = ""; } - if (!$scope.model.config || $scope.model.config.enablePasswordRetrieval === undefined) { - $scope.model.config.enablePasswordRetrieval = true; - } - if (!$scope.model.config || $scope.model.config.requiresQuestionAnswer === undefined) { - $scope.model.config.requiresQuestionAnswer = false; - } - if (!$scope.model.config || $scope.model.config.enableReset === undefined) { - $scope.model.config.enableReset = true; - } - if (!$scope.model.config || $scope.model.config.minPasswordLength === undefined) { - $scope.model.config.minPasswordLength = 0; - } - - //set the model defaults - we never get supplied a password from the server so this is ok to overwrite. - $scope.model.value = { - newPassword: "", - oldPassword: null, - reset: null, - answer: null - }; - //the value to compare to match passwords - $scope.confirm = ""; + + resetModel(); //if there is no password saved for this entity , it must be new so we do not allow toggling of the change password, it is always there //with validators turned on. @@ -52,4 +57,11 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.ChangePasswordCont $scope.cancelChange = function() { $scope.changing = false; }; + + //listen for the saved event, when that occurs we'll + //change to changing = false; + $scope.$on("saved", function() { + $scope.changing = false; + resetModel(); + }); }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.html index fa67b50b53..e73757e382 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.html @@ -1,10 +1,10 @@