Fix the signin page.

This commit is contained in:
takezoe
2013-06-03 01:44:00 +09:00
parent bbd2e32a4d
commit a1f7310e72
3 changed files with 8 additions and 8 deletions

View File

@@ -7,10 +7,10 @@ class SignInController extends SignInControllerBase with AccountService
trait SignInControllerBase extends ControllerBase { self: AccountService =>
case class SignInForm(email: String, password: String)
case class SignInForm(userName: String, password: String)
val form = mapping(
"email" -> trim(label("Email", text(required))),
"userName" -> trim(label("Username", text(required))),
"password" -> trim(label("Password", text(required)))
)(SignInForm.apply)
@@ -19,7 +19,7 @@ trait SignInControllerBase extends ControllerBase { self: AccountService =>
}
post("/signin", form){ form =>
val account = getAccountByUserName(form.email)
val account = getAccountByUserName(form.userName)
if(account.isEmpty || account.get.password != form.password){
redirect("/signin")
} else {

View File

@@ -2,12 +2,12 @@
@import context._
@main("Sign in"){
<form action="@path/signin" method="POST" validate="true">
<label for="email">Email</label>
<input type="text" name="email" id="email"/>
<span id="error-email" class="error-message"></span>
<label for="userName">Username</label>
<input type="text" name="userName" id="userName"/>
<span id="error-userName" class="error"></span>
<label for="password">Password</label>
<input type="password" name="password" id="password"/>
<span id="error-password" class="error-message"></span>
<span id="error-password" class="error"></span>
<div>
<input type="submit" class="btn btn-primary" value="Sign in"/>
</div>

View File

@@ -37,7 +37,7 @@ div.body {
margin-bottom: 40px;
}
span.error-message {
span.error {
color: red;
}