diff --git a/src/main/scala/app/AccountController.scala b/src/main/scala/app/AccountController.scala index edc2146..ee227cc 100644 --- a/src/main/scala/app/AccountController.scala +++ b/src/main/scala/app/AccountController.scala @@ -131,7 +131,7 @@ get("/:userName/_edit")(oneselfOnly { val userName = params("userName") - getAccountByUserName(userName).map(x => account.html.edit(Some(x), flash.get("info"))) getOrElse NotFound + getAccountByUserName(userName).map(x => account.html.edit(x, flash.get("info"))) getOrElse NotFound }) post("/:userName/_edit", editForm)(oneselfOnly { form => @@ -174,7 +174,7 @@ get("/:userName/_ssh")(oneselfOnly { val userName = params("userName") getAccountByUserName(userName).map { x => - account.html.ssh(x, getPublicKeys(x.userName), flash.get("info")) + account.html.ssh(x, getPublicKeys(x.userName)) } getOrElse NotFound }) diff --git a/src/main/twirl/account/edit.scala.html b/src/main/twirl/account/edit.scala.html index 952ebc3..2d2fd66 100644 --- a/src/main/twirl/account/edit.scala.html +++ b/src/main/twirl/account/edit.scala.html @@ -1,36 +1,21 @@ -@(account: Option[model.Account], info: Option[Any])(implicit context: app.Context) +@(account: model.Account, info: Option[Any])(implicit context: app.Context) @import context._ @import view.helpers._ -@html.main((if(account.isDefined) "Edit your profile" else "Create your account")){ +@html.main("Edit your profile"){
@menu("profile")
-
- @if(account.isDefined){ -

Edit your profile

- } else { -

Create your account

- } + +

Edit your profile

@helper.html.information(info)
- @if(account.isEmpty){ -
- - - -
- } - @if(account.map(_.password.nonEmpty).getOrElse(true)){ + @if(account.password.nonEmpty){
@@ -38,37 +23,33 @@ }
- +
- +
- +
- @helper.html.uploadavatar(account) + @helper.html.uploadavatar(Some(account))
- @if(account.isDefined){ - - - Cancel - } else { - - } + + + Cancel
diff --git a/src/main/twirl/account/ssh.scala.html b/src/main/twirl/account/ssh.scala.html index c5ac69e..b20a5eb 100644 --- a/src/main/twirl/account/ssh.scala.html +++ b/src/main/twirl/account/ssh.scala.html @@ -1,4 +1,4 @@ -@(account: model.Account, sshKeys: List[model.SshKey], info: Option[Any])(implicit context: app.Context) +@(account: model.Account, sshKeys: List[model.SshKey])(implicit context: app.Context) @import context._ @import view.helpers._ @html.main("SSH Keys"){