Newer
Older
gitbucket_jkp / src / main / twirl / pulls / commits.scala.html
@Shintaro Murakami Shintaro Murakami on 26 Nov 2014 1 KB (refs #9) Comments for commit and diff
@(commits: Seq[Seq[util.JGitUtil.CommitInfo]],
  comments: Option[List[model.Comment]] = None,
  repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
@import context._
@import view.helpers._
<div class="box">
  <table class="table table-file-list" style="border: 1px solid silver;">
    @commits.map { day =>
      <tr>
        <th colspan="3" class="box-header" style="font-weight: normal;">@date(day.head.commitTime)</th>
      </tr>
      @day.map { commit =>
        <tr>
          <td style="width: 20%;">
            @avatar(commit, 20)
            @user(commit.authorName, commit.authorEmailAddress, "username")
          </td>
          <td>@commit.shortMessage</td>
          <td style="width: 10%; text-align: right">
            <span class="badge" style="display: inline">@if(comments.isDefined){
              @comments.get.flatMap @{
                 case comment: model.CommitComment => Some(comment)
                 case other => None
              }.filter(_.commitId == commit.id).size
            }</span>
          </td>
          <td style="width: 10%; text-align: right;">
            <a href="@url(repository)/commit/@commit.id" class="monospace">@commit.id.substring(0, 7)</a>
          </td>
        </tr>
      }
    }
  </table>
</div>