mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
(refs #115)Small fix for views
This commit is contained in:
@@ -131,7 +131,7 @@ trait AccountControllerBase extends AccountManagementControllerBase {
|
|||||||
|
|
||||||
get("/:userName/_edit")(oneselfOnly {
|
get("/:userName/_edit")(oneselfOnly {
|
||||||
val userName = params("userName")
|
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 =>
|
post("/:userName/_edit", editForm)(oneselfOnly { form =>
|
||||||
@@ -174,7 +174,7 @@ trait AccountControllerBase extends AccountManagementControllerBase {
|
|||||||
get("/:userName/_ssh")(oneselfOnly {
|
get("/:userName/_ssh")(oneselfOnly {
|
||||||
val userName = params("userName")
|
val userName = params("userName")
|
||||||
getAccountByUserName(userName).map { x =>
|
getAccountByUserName(userName).map { x =>
|
||||||
account.html.ssh(x, getPublicKeys(x.userName), flash.get("info"))
|
account.html.ssh(x, getPublicKeys(x.userName))
|
||||||
} getOrElse NotFound
|
} getOrElse NotFound
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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 context._
|
||||||
@import view.helpers._
|
@import view.helpers._
|
||||||
@html.main((if(account.isDefined) "Edit your profile" else "Create your account")){
|
@html.main("Edit your profile"){
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
@menu("profile")
|
@menu("profile")
|
||||||
</div>
|
</div>
|
||||||
<div class="span9">
|
<div class="span9">
|
||||||
<form action="@if(account.isDefined){@url(account.get.userName)/_edit}else{@path/register}" method="POST" validate="true">
|
<form action="@url(account.userName)/_edit" method="POST" validate="true">
|
||||||
@if(account.isDefined){
|
<h3>Edit your profile</h3>
|
||||||
<h3>Edit your profile</h3>
|
|
||||||
} else {
|
|
||||||
<h3>Create your account</h3>
|
|
||||||
}
|
|
||||||
@helper.html.information(info)
|
@helper.html.information(info)
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
@if(account.isEmpty){
|
@if(account.password.nonEmpty){
|
||||||
<fieldset>
|
|
||||||
<label for="userName" class="strong">Username:</label>
|
|
||||||
<input type="text" name="userName" id="userName" value=""/>
|
|
||||||
<span id="error-userName" class="error"></span>
|
|
||||||
</fieldset>
|
|
||||||
}
|
|
||||||
@if(account.map(_.password.nonEmpty).getOrElse(true)){
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="password" class="strong">
|
<label for="password" class="strong">
|
||||||
Password
|
Password (input to change password):
|
||||||
@if(account.nonEmpty){
|
|
||||||
(input to change password)
|
|
||||||
}
|
|
||||||
:
|
|
||||||
</label>
|
</label>
|
||||||
<input type="password" name="password" id="password" value=""/>
|
<input type="password" name="password" id="password" value=""/>
|
||||||
<span id="error-password" class="error"></span>
|
<span id="error-password" class="error"></span>
|
||||||
@@ -38,37 +23,33 @@
|
|||||||
}
|
}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="fullName" class="strong">Full Name:</label>
|
<label for="fullName" class="strong">Full Name:</label>
|
||||||
<input type="text" name="fullName" id="fullName" value="@account.map(_.fullName)"/>
|
<input type="text" name="fullName" id="fullName" value="@account.fullName)"/>
|
||||||
<span id="error-fullName" class="error"></span>
|
<span id="error-fullName" class="error"></span>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="mailAddress" class="strong">Mail Address:</label>
|
<label for="mailAddress" class="strong">Mail Address:</label>
|
||||||
<input type="text" name="mailAddress" id="mailAddress" value="@account.map(_.mailAddress)"/>
|
<input type="text" name="mailAddress" id="mailAddress" value="@account.mailAddress)"/>
|
||||||
<span id="error-mailAddress" class="error"></span>
|
<span id="error-mailAddress" class="error"></span>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="url" class="strong">URL (optional):</label>
|
<label for="url" class="strong">URL (optional):</label>
|
||||||
<input type="text" name="url" id="url" style="width: 300px;" value="@account.map(_.url)"/>
|
<input type="text" name="url" id="url" style="width: 300px;" value="@account.url)"/>
|
||||||
<span id="error-url" class="error"></span>
|
<span id="error-url" class="error"></span>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="avatar" class="strong">Image (optional):</label>
|
<label for="avatar" class="strong">Image (optional):</label>
|
||||||
@helper.html.uploadavatar(account)
|
@helper.html.uploadavatar(Some(account))
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<fieldset class="margin">
|
<fieldset class="margin">
|
||||||
@if(account.isDefined){
|
<div class="pull-right">
|
||||||
<div class="pull-right">
|
<a href="@path/@account.userName/_delete" class="btn btn-danger" id="delete">Delete account</a>
|
||||||
<a href="@path/@account.get.userName/_delete" class="btn btn-danger" id="delete">Delete account</a>
|
</div>
|
||||||
</div>
|
<input type="submit" class="btn btn-success" value="Save"/>
|
||||||
<input type="submit" class="btn btn-success" value="Save"/>
|
<a href="@url(account.userName)" class="btn">Cancel</a>
|
||||||
<a href="@url(account.get.userName)" class="btn">Cancel</a>
|
|
||||||
} else {
|
|
||||||
<input type="submit" class="btn btn-success" value="Create account"/>
|
|
||||||
}
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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 context._
|
||||||
@import view.helpers._
|
@import view.helpers._
|
||||||
@html.main("SSH Keys"){
|
@html.main("SSH Keys"){
|
||||||
|
|||||||
Reference in New Issue
Block a user