File name
Commit message
Commit date
2013-02-22
2013-02-25
File name
Commit message
Commit date
File name
Commit message
Commit date

2012-11-29
2013-02-25
2012-08-28
File name
Commit message
Commit date
@(message: String, newUserForm: Form[User])
@home(message, utils.MenuType.NONE) {
<div class="page full">
<div class="center-wrap tag-line-wrap signup">
<h1 class="title">@Messages("hive.name") <span class="high-light">@Messages("title.signup")</span></h1>
<p class="tag-line signup"><span>Open Source</span> Project. <span>Code</span> Repository. <span>Issue</span> Tracker. <span>Task</span> Managspanent</p>
</div>
<div class="signup-form-wrap">
<form action="@routes.UserApp.newUser()" name="signup" method="POST">
<label for="loginId" class="inline">
<input type="text" class="text loginId" id="loginId" placeholder='@Messages("user.signupId")' autocomplete="off" name="loginId">
<a class="isValid"></a>
</label>
<label for="username" class="inline">
<input type="text" class="text uname" id="username" placeholder='@Messages("user.name")' autocomplete="off" name="name">
</label>
<label for="email">
<input type="text" class="text email" id="email" placeholder='@Messages("user.email")' autocomplete="off" name="email">
<a class="isValid"></a>
</label>
<label for="password">
<input type="password" class="text password" id="password" placeholder="@Messages("user.password")" autocomplete="off" name="password">
</label>
<label for="retypedPassword">
<input type="password" class="text password" id="retypedPassword" placeholder="@Messages("validation.retypePassword")" autocomplete="off" name="retypedPassword">
</label>
<div class="act-row">
@Messages("user.isAlreadySignupUser") <a href="@routes.UserApp.loginForm()" class="go-login">@Messages("title.login")</a>
</div>
<div class="btns-row">
<button type="submit" class="n-btn orange sign-up">@Messages("title.signup")</button>
</div>
</form>
</div>
</div>
<script type="text/javascript">
var passwordField = $('#password');
var emailField = $('#email');
var loginIdField = $('#loginId');
var passwordPlaceholder = passwordField.attr("placeholder");
var errorMessage = {
required: {
title: "@Messages("validation.required")"
},
duplicated: {
title: "@Messages("validation.duplicated")"
},
passwordMismatch: {
title: "@Messages("validation.passwordMismatch")"
},
tooShortPassword: {
title: "@Messages("validation.tooShortPassword")"
},
invalidEmail: {
title: "@Messages("validation.invalidEmail")"
}
};
// Bootstrap tooltip function has some limitation.
// In this case, tooltip doesn't provide easy way to change title and contents.
// So, unfortunately I had to change data value in directly.
var showErrorMessage = function(field, errorMessage){
field.tooltip({trigger:'manual', placement: 'left'});
var tooltip = field.data('tooltip');
tooltip.options.title = errorMessage.title;
tooltip.options.content = errorMessage.content;
tooltip.options.placement = 'left';
tooltip.options.trigger = 'manual';
field.tooltip('show');
}
var isExist = function(checkId, url){
var checkPosition = checkId.next(".isValid");
if( url[url.length-1] != "/" ) url = url.concat("/");
$.ajax({
url: url + checkId.val()
}
).done(function(data){
if(data.isExist === true){
showErrorMessage(checkId, errorMessage.duplicated);
checkId.tooltip("show");
} else {
checkId.tooltip("hide");
try{
checkId.tooltip("destory");
} catch(err){} // to avoid boostrap bug
}
});
};
$("#loginId")
.focusout(function(){
$(this).val( $(this).val().trim().toLowerCase().replace(/\s+/g, '')); //양쪽 공백을 없애고 소문자로 변경 후 중간 공백 없앰
if ($(this).val() !== "") isExist($(this), "/user/isExist/");
});
$("#email").focusout(function(){
if ($(this).val() !== "") isExist($(this), "/user/isEmailExist/");
});
var validator = new FormValidator('signup', [{
name: 'loginId',
rules: 'required|alpha_numeric'
},
{
name: 'email',
rules: 'required|valid_email'
},
{
name: 'password',
rules: 'required|min_length[4]'
},
{
name: 'retypedPassword',
rules: 'required|matches[password]'
}], function(errors, event){
if( errors.length > 0 ){
console.log(errors);
switch(errors[0].id){
case "retypedPassword" :
showErrorMessage(passwordField, errorMessage.passwordMismatch);
break;
case "password" :
showErrorMessage(passwordField, errorMessage.tooShortPassword);
break;
case "email" :
showErrorMessage(emailField, errorMessage.invalidEmail);
break;
case "loginId" :
showErrorMessage(loginIdField, errorMessage.required);
break;
default:
break;
}
} else {
try{
passwordField.tooltip('destroy');
emailField.tooltip('destroy');
loginIdField.tooltip('destroy');
} catch(err){
console.log(err);
} // to avoid boostrap bug
}
});
$('#retypedPassword').focusout(function(){
validator._validateForm();
});
</script>
}