Newer
Older
gitbucket_jkp / src / main / twirl / repo / files.scala.html
@(branch: String, repository: service.RepositoryService.RepositoryInfo, pathList: List[String], latestCommit: util.JGitUtil.CommitInfo, files: List[util.JGitUtil.FileInfo], readme: Option[String])(implicit context: app.Context)
@import context._
@import view.helpers
@html.main(repository.owner + "/" + repository.name) {
  @html.header("code", repository)
  @navtab(branch, repository, "files")
  <div class="head">
    <a href="@path/@repository.owner/@repository.name/tree/@branch">@repository.name</a> /
    @pathList.zipWithIndex.map { case (section, i) =>
      <a href="@path/@repository.owner/@repository.name/tree/@branch/@pathList.take(i + 1).mkString("/")">@section</a> /
    }
  </div>
  <table class="table table-file-list">
    <tr>
      <th colspan="4" style="font-weight: normal;">
        <div>
            <strong><a href="">@latestCommit.committer</a></strong> 
            @helpers.cut(latestCommit.message, 100)
            <div class="pull-right align-right">
              @helpers.datetime(latestCommit.time)
              <a href="@path/@repository.owner/@repository.name/commit/@latestCommit.id">@latestCommit.id.substring(0, 10)</a>
            </div>
        </div>
      </th>
    </tr>
    @if(pathList.size > 0){
    <tr>
      <td width="16"></td>
      <td><a href="@path/@repository.owner/@repository.name@if(pathList.size > 1){/tree/@branch/@pathList.init.mkString("/")}">..</a></td>
      <td></td>
      <td></td>
    </tr>
    }
    @files.map { file =>
    <tr>
      <td width="16">
        @if(file.isDirectory){
          <img src="@path/assets/common/images/folder.png"/>
        } else {
          <img src="@path/assets/common/images/file.png"/>
        }
      </td>
      <td>
        @if(file.isDirectory){
          <a href="@path/@repository.owner/@repository.name/tree@{(branch :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a>
        } else {
          <a href="@path/@repository.owner/@repository.name/blob@{(branch :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a>
        }
      </td>
      <td>@helpers.datetime(file.time)</td>
      <td>@helpers.cut(file.message, 60) [<a href="@path/@file.committer">@file.committer</a>]</td>
    </tr>
    }
  </table>
  @readme.map { content =>
  <table class="table table-bordered">
    <tr>
      <td>@helpers.markdown(content, repository, false, true, true)</td>
    </tr>
  </table>
  }
}