updates for account-settings of UI.

This commit is contained in:
kunw 2016-05-13 19:16:57 +08:00
parent 1c9e1e9eca
commit fe8761cc7f
3 changed files with 55 additions and 27 deletions

View File

@ -354,5 +354,33 @@ var global_messages = {
'system_management': {
'en-US': 'System Management',
'zh-CN': '系统管理'
},
'change_password': {
'en-US': 'Change Password',
'zh-CN': '修改密码'
},
'old_password': {
'en-US': 'Old Password',
'zh-CN': '原密码'
},
'old_password_is_required': {
'en-US': 'Old password is required.',
'zh-CN': '原密码为必填项。'
},
'old_password_is_incorrect': {
'en-US': 'Old password is incorrect.',
'zh-CN': '原密码不正确。'
},
'new_password_is_required': {
'en-US': 'New password is required.',
'zh-CN': '新密码为必填项。'
},
'new_password_is_invalid': {
'en-US': 'New password is invalid. At least 7 characters with 1 lowercase letter, 1 capital letter and 1 numeric character.',
'zh-CN': '新密码无效。至少输入 7个字符且包含 1个小写字母1个大写字母和 1个数字。'
},
'new_password': {
'en-US': 'New Password',
'zh-CN': '新密码'
}
};

View File

@ -18,7 +18,7 @@
return tr;
function tr() {
return {
'setCurrentLanguage': function(language) {
'setCurrentLanguage': function(language) {
if(!language){
language = defaultLanguage;
}

View File

@ -2,18 +2,18 @@
<div class="container container-custom">
<div class="row extend-height">
<div class="section">
<h1 class="col-md-12 col-md-offset-2 main-title title-color">Account Settings</h1>
<h1 class="col-md-12 col-md-offset-2 main-title title-color">// 'account_setting' | tr //</h1>
<div class="row">
<div class="col-md-12 col-md-offset-2 main-content">
<form name="form" class="form-horizontal" ng-submit="form.$valid && vm.changeProile(user)" >
<div class="form-group">
<label for="username" class="col-sm-3 control-label">Username:</label>
<label for="username" class="col-sm-3 control-label">// 'username' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="username" ng-model="user.username" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.username" name="uUsername" required maxlength="20" invalid-chars>
<div ng-messages="form.$submitted && form.uUsername.$error">
<span ng-message="required">Username is required.</span>
<span ng-message="maxlength">Username maximum length is 20.</span>
<span ng-message="invalidChars">Username contains invalid characters.</span>
<span ng-message="required">// 'username_is_required' | tr //</span>
<span ng-message="maxlength">// 'username_is_too_long' | tr //</span>
<span ng-message="invalidChars">// 'username_contains_illegal_chars' | tr //</span>
</div>
</div>
<div class="col-sm-2">
@ -21,12 +21,12 @@
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label">Email:</label>
<label for="email" class="col-sm-3 control-label">// 'email' | tr //:</label>
<div class="col-sm-7">
<input type="email" class="form-control" id="email" ng-model="user.email" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.email" name="uEmail" required>
<div ng-messages="form.$submitted && form.uEmail.$error">
<span ng-message="required">Email is required.</span>
<span ng-message="email">Email address is illegal.</span>
<span ng-message="required">// 'email_is_required' | tr //</span>
<span ng-message="email">// 'email_content_illegal' | tr //</span>
</div>
</div>
<div class="col-sm-2">
@ -34,13 +34,13 @@
</div>
</div>
<div class="form-group">
<label for="fullName" class="col-sm-3 control-label">Full Name:</label>
<label for="fullName" class="col-sm-3 control-label">// 'full_name' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="fullName" ng-model="user.fullName" ng-model-options="{ updateOn: 'blur' }" name="uFullName" ng-value="vm.user.realname" required maxlength="20" invalid-chars>
<div ng-messages="form.$submitted && form.uFullName.$error">
<span ng-message="required">Full name is required.</span>
<span ng-message="invalidChars">Full name contains invalid characters.</span>
<span ng-message="maxlength">Full name maximum length is 20.</span>
<span ng-message="required">// 'full_name_is_required' | tr //</span>
<span ng-message="invalidChars">// 'full_name_contains_illegal_chars' | tr //</span>
<span ng-message="maxlength">// 'full_name_is_too_long' | tr //</span>
</div>
</div>
<div class="col-sm-2">
@ -48,23 +48,23 @@
</div>
</div>
<div class="form-group">
<label for="comments" class="col-sm-3 control-label">Comments:</label>
<label for="comments" class="col-sm-3 control-label">// 'comments' | tr //:</label>
<div class="col-sm-7">
<input type="text" class="form-control" id="comments" ng-model="user.comment" name="uComments" ng-value="vm.user.comment" ng-model-options="{ updateOn: 'blur' }" maxlength="20">
<div ng-messages="form.$submitted && form.uComments.$error">
<span ng-show="maxlength">Comments maximum length is 20.</span>
<span ng-show="maxlength">// 'comment_is_too_long' | tr //</span>
</div>
</div>
</div>
</form>
<form name="form" class="form-horizontal css-form" ng-submit="form.$valid && vm.changePassword(user)" novalidate>
<div class="form-group">
<label for="toggleChangePassword" class="col-sm-3 control-label"><a id="toggleChangePassword" href="#" ng-click="vm.toggleChangePassword()">Change Password</a></label>
<label for="toggleChangePassword" class="col-sm-3 control-label"><a id="toggleChangePassword" href="#" ng-click="vm.toggleChangePassword()">// 'change_password' | tr //</a></label>
</div>
<div ng-show="vm.isOpen">
<hr/>
<div class="form-group">
<label for="oldPassword" class="col-sm-3 control-label">Old Password:</label>
<label for="oldPassword" class="col-sm-3 control-label">// 'old_password' | tr //:</label>
<div class="col-sm-7">
<input type="password" class="form-control" id="oldPassword" ng-model="user.oldPassword" ng-model-options="{ updateOn: 'blur' }" name="uOldPassword" required>
</div>
@ -73,17 +73,17 @@
</div>
</div>
<div class="form-group">
<label for="password" class="col-sm-3 control-label">Password:</label>
<label for="password" class="col-sm-3 control-label">// 'new_password' | tr //:</label>
<div class="col-sm-7">
<input type="password" class="form-control" id="password" ng-model="user.password" ng-model-options="{ updateOn: 'blur' }" name="uPassword" required password>
<p class="help-block small-size-fonts">At least 7 characters with 1 lowercase letter, 1 capital letter and 1 numeric character.</p>
<p class="help-block small-size-fonts">// 'password_desc' | tr //</p>
</div>
<div class="col-sm-2">
<span class="asterisk">*</span>
</div>
</div>
<div class="form-group">
<label for="confirmPassword" class="col-sm-3 control-label">Confirm Password:</label>
<label for="confirmPassword" class="col-sm-3 control-label">// 'confirm_password' | tr //:</label>
<div class="col-sm-7">
<input type="password" class="form-control" id="confirmPassword" ng-model="user.confirmPassword" ng-model-options="{ updateOn: 'blur' }" name="uConfirmPassword" compare-to="user.password">
</div>
@ -94,23 +94,23 @@
</div>
<div class="form-group">
<div class="col-md-offset-7 col-md-10">
<input type="submit" class="btn btn-default" ng-click="vm.cancel()" value="Cancel">
<input type="submit" class="btn btn-primary" ng-disabled="form.$invalid" value="Save">
<input type="submit" class="btn btn-default" ng-click="vm.cancel()" value="// 'cancel' | tr //">
<input type="submit" class="btn btn-primary" ng-disabled="form.$invalid" value="// 'save' | tr //">
</div>
</div>
<div class="error-message">
<div ng-messages="form.$dirty && form.uOldPassword.$error">
<span ng-message="required">Old password is required.</span>
<span ng-message="required">// 'old_password_is_required' | tr //</span>
</div>
<div ng-messages="form.$dirty && form.uPassword.$error">
<span ng-message="required">New password is required.</span>
<span ng-message="password">New password is invalid.</span>
<span ng-message="required">// 'new_password_is_required' | tr //</span>
<span ng-message="password">// 'new_password_is_invalid' | tr //</span>
</div>
<div class="error-message" ng-messages="form.$dirty && form.uConfirmPassword.$error">
<span ng-message="compareTo">Confirm password mismatch.</span>
<span ng-message="compareTo">// 'password_does_not_match' | tr //</span>
</div>
<div class="error-message" ng-show="form.$dirty && vm.oldPasswordIncorrect">
<span>Old password is incorrect.</span>
<span>// 'old_password_is_incorrect' | tr //</span>
</div>
</div>
</form>