updates for validation-interaction of UI.

This commit is contained in:
kunw 2016-05-16 15:59:36 +08:00
parent 7e38afa972
commit a69f5725a6
7 changed files with 14 additions and 18 deletions

View File

@ -3,7 +3,7 @@
<div class="col-xs-10 col-md-10"> <div class="col-xs-10 col-md-10">
<form name="form" novalidate ng-submit="form.$valid"> <form name="form" novalidate ng-submit="form.$valid">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<input type="text" class="form-control" id="addUsername" placeholder="// 'username' | tr //" ng-model="pm.username" name="uUsername" ng-model-options="{ updateOn: 'blur' }" ng-change="vm.reset()" required> <input type="text" class="form-control" id="addUsername" placeholder="// 'username' | tr //" ng-model="pm.username" name="uUsername" ng-model-options="{ debounce: 250 }" ng-change="vm.reset()" required>
<div class="error-message"> <div class="error-message">
<div ng-messages="form.$dirty && form.uUsername.$error"> <div ng-messages="form.$dirty && form.uUsername.$error">
<span ng-message="required">// 'username_is_required' | tr //</span> <span ng-message="required">// 'username_is_required' | tr //</span>

View File

@ -3,7 +3,7 @@
<div class="col-xs-10 col-md-10"> <div class="col-xs-10 col-md-10">
<form name="form" ng-submit="form.$valid"> <form name="form" ng-submit="form.$valid">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<input type="text" class="form-control" placeholder="// 'project_name' | tr //" ng-model="p.projectName" name="uProjectName" ng-model-options="{ updateOn: 'blur' }" ng-change="vm.reset()" required> <input type="text" class="form-control" placeholder="// 'project_name' | tr //" ng-model="p.projectName" name="uProjectName" ng-model-options="{ debounce: 250 }" ng-change="vm.reset()" required>
<div class="error-message"> <div class="error-message">
<div ng-messages="form.$dirty && form.uProjectName.$error" ng-if="form.uProjectName.$touched"> <div ng-messages="form.$dirty && form.uProjectName.$error" ng-if="form.uProjectName.$touched">
<span ng-message="required">// 'project_name_is_required' | tr //</span> <span ng-message="required">// 'project_name_is_required' | tr //</span>

View File

@ -1,7 +1,7 @@
<form name="form" class="form-horizontal css-form" ng-submit="form.$valid" novalidate> <form name="form" class="form-horizontal css-form" ng-submit="form.$valid" novalidate>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-1 col-sm-10"> <div class="col-sm-offset-1 col-sm-10">
<input id="username" type="text" class="form-control" placeholder="// 'username_email' | tr //" name="uPrincipal" ng-change="vm.reset()" ng-model="user.principal" required> <input id="username" type="text" class="form-control" placeholder="// 'username_email' | tr //" name="uPrincipal" ng-model-options="{ debounce: 250 }" ng-change="vm.reset()" ng-model="user.principal" required>
<div class="error-message"> <div class="error-message">
<div ng-messages="form.uPrincipal.$error" ng-if="form.uPrincipal.$touched"> <div ng-messages="form.uPrincipal.$error" ng-if="form.uPrincipal.$touched">
<span ng-message="required">// 'username_is_required' | tr //</span> <span ng-message="required">// 'username_is_required' | tr //</span>
@ -11,7 +11,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-1 col-sm-10"> <div class="col-sm-offset-1 col-sm-10">
<input type="password" class="form-control" placeholder="// 'password' | tr //" name="uPassword" ng-change="vm.reset()" ng-model="user.password" required> <input type="password" class="form-control" placeholder="// 'password' | tr //" name="uPassword" ng-model-options="{ debounce: 250 }" ng-change="vm.reset()" ng-model="user.password" required>
<div class="error-message"> <div class="error-message">
<div ng-messages="form.uPassword.$error" ng-if="form.uPassword.$touched"> <div ng-messages="form.uPassword.$error" ng-if="form.uPassword.$touched">
<span ng-message="required">// 'password_is_required' | tr //</span> <span ng-message="required">// 'password_is_required' | tr //</span>

View File

@ -200,8 +200,8 @@ var global_messages = {
'zh-CN': '项目' 'zh-CN': '项目'
}, },
'public_projects': { 'public_projects': {
'en-US': 'Public Projects', 'en-US': 'Public',
'zh-CN': '公开项目' 'zh-CN': '公开'
}, },
'total_projects': { 'total_projects': {
'en-US': 'Total Projects', 'en-US': 'Total Projects',
@ -255,10 +255,6 @@ var global_messages = {
'en-US': 'My Projects', 'en-US': 'My Projects',
'zh-CN': '我的项目' 'zh-CN': '我的项目'
}, },
'public_projects': {
'en-US': 'Public Projects',
'zh-CN': '公开项目'
},
'project_name': { 'project_name': {
'en-US': 'Project Name', 'en-US': 'Project Name',
'zh-CN': '项目名称' 'zh-CN': '项目名称'

View File

@ -9,7 +9,7 @@
<div class="form-group"> <div class="form-group">
<label for="username" class="col-sm-3 control-label">// 'username' | tr //:</label> <label for="username" class="col-sm-3 control-label">// 'username' | tr //:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="text" class="form-control" id="username" ng-model="user.username" ng-value="vm.user.username" name="uUsername" ng-model-options="{ updateOn: 'blur' }" required maxlength="20" invalid-chars> <input type="text" class="form-control" id="username" ng-model="user.username" ng-value="vm.user.username" name="uUsername" ng-model-options="{ updateOn: 'blur' }" ng-disabled="true" required maxlength="20" invalid-chars>
<div ng-messages="form.$submitted && form.uUsername.$error"> <div ng-messages="form.$submitted && form.uUsername.$error">
<span ng-message="required">// 'username_is_required' | tr //</span> <span ng-message="required">// 'username_is_required' | tr //</span>
<span ng-message="maxlength">// 'username_is_too_long' | tr //</span> <span ng-message="maxlength">// 'username_is_too_long' | tr //</span>
@ -23,7 +23,7 @@
<div class="form-group"> <div class="form-group">
<label for="email" class="col-sm-3 control-label">// 'email' | tr //:</label> <label for="email" class="col-sm-3 control-label">// 'email' | tr //:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="email" class="form-control" id="email" ng-model="user.email" ng-value="vm.user.email" ng-model-options="{ updateOn: 'blur' }" name="uEmail" required> <input type="email" class="form-control" id="email" ng-model="user.email" ng-value="vm.user.email" ng-model-options="{ updateOn: 'blur' }" ng-disabled="true" name="uEmail" required>
<div ng-messages="form.$submitted && form.uEmail.$error"> <div ng-messages="form.$submitted && form.uEmail.$error">
<span ng-message="required">// 'email_is_required' | tr //</span> <span ng-message="required">// 'email_is_required' | tr //</span>
<span ng-message="email">// 'email_content_illegal' | tr //</span> <span ng-message="email">// 'email_content_illegal' | tr //</span>
@ -36,7 +36,7 @@
<div class="form-group"> <div class="form-group">
<label for="fullName" class="col-sm-3 control-label">// 'full_name' | tr //:</label> <label for="fullName" class="col-sm-3 control-label">// 'full_name' | tr //:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="text" class="form-control" id="fullName" ng-model="user.fullName" name="uFullName" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.realname" required maxlength="20" invalid-chars> <input type="text" class="form-control" id="fullName" ng-model="user.fullName" name="uFullName" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.realname" ng-disabled="true" required maxlength="20" invalid-chars>
<div ng-messages="form.$submitted && form.uFullName.$error"> <div ng-messages="form.$submitted && form.uFullName.$error">
<span ng-message="required">// 'full_name_is_required' | tr //</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="invalidChars">// 'full_name_contains_illegal_chars' | tr //</span>
@ -50,7 +50,7 @@
<div class="form-group"> <div class="form-group">
<label for="comments" class="col-sm-3 control-label">// 'comments' | tr //:</label> <label for="comments" class="col-sm-3 control-label">// 'comments' | tr //:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="text" class="form-control" id="comments" ng-model="user.comment" name="uComments" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.comment" ng-model-options="{ updateOn: 'blur' }" maxlength="20"> <input type="text" class="form-control" id="comments" ng-model="user.comment" name="uComments" ng-model-options="{ updateOn: 'blur' }" ng-value="vm.user.comment" ng-disabled="true" ng-model-options="{ updateOn: 'blur' }" maxlength="20">
<div ng-messages="form.$submitted && form.uComments.$error"> <div ng-messages="form.$submitted && form.uComments.$error">
<span ng-show="maxlength">// 'comment_is_too_long' | tr //</span> <span ng-show="maxlength">// 'comment_is_too_long' | tr //</span>
</div> </div>

View File

@ -5,11 +5,11 @@
<h1 class="col-md-12 col-md-offset-2 main-title title-color">// 'forgot_password' | tr //</h1> <h1 class="col-md-12 col-md-offset-2 main-title title-color">// 'forgot_password' | tr //</h1>
<div class="row"> <div class="row">
<div class="col-md-12 col-md-offset-2 main-content"> <div class="col-md-12 col-md-offset-2 main-content">
<form name="form" class="form-horizontal" ng-submit="form.$valid " > <form name="form" class="form-horizontal css-form" ng-submit="form.$valid " >
<div class="form-group"> <div class="form-group">
<label for="email" class="col-sm-3 control-label">// 'email' | tr //:</label> <label for="email" class="col-sm-3 control-label">// 'email' | tr //:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="email" class="form-control" id="email" ng-model="user.email" ng-model-options="{ updateOn: 'blur' }" ng-change="vm.reset()" name="uEmail" required > <input type="email" class="form-control" id="email" ng-model="user.email" ng-model-options="{ debounce: 500 }" ng-change="vm.reset()" name="uEmail" required >
<p class="help-block small-size-fonts">// 'forgot_password_description' | tr //</p> <p class="help-block small-size-fonts">// 'forgot_password_description' | tr //</p>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">

View File

@ -9,7 +9,7 @@
<div class="form-group"> <div class="form-group">
<label for="password" class="col-sm-3 control-label">// 'password' | tr //:</label> <label for="password" class="col-sm-3 control-label">// 'password' | tr //:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="password" class="form-control" id="password" ng-model="user.password" ng-change="vm.reset()" name="uPassword" ng-model-options="{ updateOn: 'blur' }" required password> <input type="password" class="form-control" id="password" ng-model="user.password" ng-change="vm.reset()" name="uPassword" ng-model-options="{ debounce: 250 }" required password>
<div class="error-message" ng-messages="form.uPassword.$error" ng-if="form.uPassword.$touched"> <div class="error-message" ng-messages="form.uPassword.$error" ng-if="form.uPassword.$touched">
<span ng-message="required">// 'password_is_required' | tr //</span> <span ng-message="required">// 'password_is_required' | tr //</span>
<span ng-message="password">// 'password_is_invalid' | tr //</span> <span ng-message="password">// 'password_is_invalid' | tr //</span>
@ -23,7 +23,7 @@
<div class="form-group"> <div class="form-group">
<label for="confirmPassword" class="col-sm-3 control-label">// 'confirm_password' | tr //:</label> <label for="confirmPassword" class="col-sm-3 control-label">// 'confirm_password' | tr //:</label>
<div class="col-sm-7"> <div class="col-sm-7">
<input type="password" class="form-control" id="confirmPassword" ng-model="user.confirmPassword" ng-change="vm.reset()" name="uConfirmPassword" ng-model-options="{ updateOn: 'blur' }" compare-to="user.password"> <input type="password" class="form-control" id="confirmPassword" ng-model="user.confirmPassword" ng-change="vm.reset()" name="uConfirmPassword" ng-model-options="{ debounce: 250 }" compare-to="user.password">
<div class="error-message" ng-messages="form.uConfirmPassword.$error" ng-if="form.uConfirmPassword.$touched"> <div class="error-message" ng-messages="form.uConfirmPassword.$error" ng-if="form.uConfirmPassword.$touched">
<span ng-message="compareTo">// 'password_does_not_match' | tr //</span> <span ng-message="compareTo">// 'password_does_not_match' | tr //</span>
</div> </div>