Newer
Older
gitbucket_jkp / src / main / twirl / repo / branches.scala.html
@(branchInfo: List[(String, java.util.Date)],
  repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
@import context._
@import view.helpers._
@html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
  @html.header("code", repository)
  @tab(repository.repository.defaultBranch, repository, "branches", true)
  <h1>Branches</h1>
  <table class="table table-bordered">
    <tr>
      <th width="40%">Branch</th>
      <th width="20%">Last update</th>
      <th width="20%">Compare</th>
      <th width="20%">Download</th>
    </tr>
    @branchInfo.map { case (branchName, latestUpdateDate) =>
      <tr>
        <td>
          <a href="@url(repository)/tree/@branchName">@branchName</a>
          @*
          <a href="#" class="btn btn-danger btn-mini">Delete branch</a>
          *@
        </td>
        <td>
          @datetime(latestUpdateDate)
        </td>
        <td>
          @if(repository.repository.defaultBranch == branchName){
            Base branch
          } else {
            <a href="@url(repository)/compare/@{repository.repository.defaultBranch}...@branchName">to @{repository.repository.defaultBranch}</a>
          }
        </td>
        <td><a href="@url(repository)/archive/@{branchName}.zip">ZIP</a></td>
      </tr>
    }
  </table>
}