Newer
Older
GitBucket / src / main / twirl / gitbucket / core / account / ssh.scala.html
@Naoki Takezoe Naoki Takezoe on 27 Mar 2016 1 KB Tweak CSS styles
@(account: gitbucket.core.model.Account, sshKeys: List[gitbucket.core.model.SshKey])(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.ssh.SshUtil
@import context._
@import gitbucket.core.view.helpers._
@html.main("SSH Keys"){
<div class="container body">
  @menu("ssh", settings.ssh){
    <div class="panel panel-default">
      <div class="panel-heading strong">SSH Keys</div>
      <div class="panel-body">
        @if(sshKeys.isEmpty){
          No keys
        }
        @sshKeys.zipWithIndex.map { case (key, i) =>
          @if(i != 0){
            <hr>
          }
          <strong style="line-height: 30px;">@key.title</strong> (@SshUtil.fingerPrint(key.publicKey).getOrElse("Key is invalid."))
          <a href="@path/@account.userName/_ssh/delete/@key.sshKeyId" class="btn btn-sm btn-danger pull-right">Delete</a>
        }
      </div>
    </div>
    <form method="POST" action="@path/@account.userName/_ssh" validate="true">
      <div class="panel panel-default">
        <div class="panel-heading strong">Add an SSH Key</div>
        <div class="panel-body">
          <fieldset class="form-group">
            <label for="title" class="strong">Title</label>
            <div><span id="error-title" class="error"></span></div>
            <input type="text" name="title" id="title" class="form-control"/>
          </fieldset>
          <fieldset class="form-group">
            <label for="publicKey" class="strong">Key</label>
            <div><span id="error-publicKey" class="error"></span></div>
            <textarea name="publicKey" id="publicKey" class="form-control" style="height: 250px;"></textarea>
          </fieldset>
          <input type="submit" class="btn btn-success" value="Add"/>
        </div>
      </div>
    </form>
  }
</div>
}