Newer
Older
gitbucket_jkp / src / main / twirl / admin / useredit.scala.html
@takezoe takezoe on 28 Jun 2013 2 KB Add System Settings page.
@(account: Option[model.Account])(implicit context: app.Context)
@import context._
@html.main(if(account.isEmpty) "New User" else "Update User"){
  @menu("users"){
    <form method="POST" action="@if(account.isEmpty){@path/admin/users/_new} else {@path/admin/users/@account.get.userName/_edit}" validate="true">
      <fieldset>
        <label for="userName"><strong>Username</strong></label>
        <input type="text" name="userName" id="userName" value="@account.map(_.userName)"@if(account.isDefined){ readonly}/>
        <span id="error-userName" class="error"></span>
      </fieldset>
      <fieldset>
        <label for="password"><strong>Password</strong></label>
        <input type="password" name="password" id="password" value="@account.map(_.password)"/>
        <span id="error-password" class="error"></span>
      </fieldset>
      <fieldset>
        <label for="mailAddress"><strong>Mail Address</strong></label>
        <input type="text" name="mailAddress" id="mailAddress" value="@account.map(_.mailAddress)"/>
        <span id="error-mailAddress" class="error"></span>
      </fieldset>
      <fieldset>
        <label><strong>User Type</strong></label>
        <label for="userType_Normal">
          <input type="radio" name="isAdmin" id="userType_Normal" value="false"@if(account.isEmpty || !account.get.isAdmin){ checked}/> Normal
        </label>
        <label for="userType_Admin">
          <input type="radio" name="isAdmin" id="userType_Admin" value="true"@if(account.isDefined && account.get.isAdmin){ checked}/> Administrator
        </label>
      </fieldset>
      <fieldset>
        <label><strong>URL (Optional)</strong></label>
        <input type="text" name="url" id="url" style="width: 400px;" value="@account.map(_.url)"/>
        <span id="error-url" class="error"></span>
      </fieldset>
      <fieldset>
        <input type="submit" class="btn btn-success" value="@if(account.isEmpty){Create User} else {Update User}"/>
        <a href="@path/admin/users" class="btn">Cancel</a>
      </fieldset>
    </form>
  }
}