Newer
Older
GitBucket / src / main / twirl / gitbucket / core / pulls / commits.scala.html
@Naoki Takezoe Naoki Takezoe on 21 Mar 2016 2 KB Update file browser and commit list UI
@(commits: Seq[Seq[gitbucket.core.util.JGitUtil.CommitInfo]],
  comments: Option[List[gitbucket.core.model.Comment]] = None,
  repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
@import gitbucket.core.model._
<table class="table table-bordered">
@commits.map { day =>
  <tr>
    <th rowspan="@day.size" width="100">@date(day.head.commitTime)</th>
    @day.zipWithIndex.map { case (commit, i) =>
      @if(i != 0){ <tr> }
      <td>
        <div class="pull-right text-right">
          <a href="@url(repository)/commit/@commit.id" class="monospace commit-message strong"><i class="octicon octicon-diff" style="color: black;"></i>@commit.id.substring(0, 7)</a><br>
          <a href="@url(repository)/tree/@commit.id" class="button-link">Browse files ยป</a>
        </div>
        <div>
          <div class="commit-avatar-image">@avatarLink(commit, 40)</div>
          <div>
            <a href="@url(repository)/commit/@commit.id" class="commit-message strong">@link(commit.summary, repository)</a>
            @if(commit.description.isDefined){
              <a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a>
            }
            <br>
            @if(commit.description.isDefined){
              <pre id="description-@commit.id" style="display: none;" class="commit-description">@link(commit.description.get, repository)</pre>
            }
            <div>
              @user(commit.authorName, commit.authorEmailAddress, "username")
              <span class="muted">authored @helper.html.datetimeago(commit.authorTime)</span>
              @if(commit.isDifferentFromAuthor) {
                <span class="octicon octicon-arrow-right" style="margin-top : -2px;"></span>
                @user(commit.committerName, commit.committerEmailAddress, "username")
                <span class="muted">committed @helper.html.datetimeago(commit.authorTime)</span>
              }
            </div>
          </div>
        </div>
      </td>
      </tr>
    }
}
</table>