Newer
Older
gitbucket_jkp / src / main / twirl / account / edit.scala.html
@takezoe takezoe on 8 Mar 2014 2 KB (refs #115)Small fix for views
@(account: model.Account, info: Option[Any])(implicit context: app.Context)
@import context._
@import view.helpers._
@html.main("Edit your profile"){
<div class="row-fluid">
  <div class="span3">
    @menu("profile")
  </div>
  <div class="span9">
    <form action="@url(account.userName)/_edit" method="POST" validate="true">
      <h3>Edit your profile</h3>
      @helper.html.information(info)
      <div class="row-fluid">
        <div class="span6">
          @if(account.password.nonEmpty){
            <fieldset>
              <label for="password" class="strong">
                Password (input to change password):
              </label>
              <input type="password" name="password" id="password" value=""/>
              <span id="error-password" class="error"></span>
            </fieldset>
          }
          <fieldset>
            <label for="fullName" class="strong">Full Name:</label>
            <input type="text" name="fullName" id="fullName" value="@account.fullName)"/>
            <span id="error-fullName" class="error"></span>
          </fieldset>
          <fieldset>
            <label for="mailAddress" class="strong">Mail Address:</label>
            <input type="text" name="mailAddress" id="mailAddress" value="@account.mailAddress)"/>
            <span id="error-mailAddress" class="error"></span>
          </fieldset>
          <fieldset>
            <label for="url" class="strong">URL (optional):</label>
            <input type="text" name="url" id="url" style="width: 300px;" value="@account.url)"/>
            <span id="error-url" class="error"></span>
          </fieldset>
        </div>
        <div class="span6">
          <fieldset>
            <label for="avatar" class="strong">Image (optional):</label>
            @helper.html.uploadavatar(Some(account))
          </fieldset>
        </div>
      </div>
      <fieldset class="margin">
        <div class="pull-right">
          <a href="@path/@account.userName/_delete" class="btn btn-danger" id="delete">Delete account</a>
        </div>
        <input type="submit" class="btn btn-success" value="Save"/>
        <a href="@url(account.userName)" class="btn">Cancel</a>
      </fieldset>
    </form>
  </div>
</div>
}
<script>
$(function(){
  $('#delete').click(function(){
    return confirm('Once you delete your account, there is no going back.\nAre you sure?');
  });
});
</script>