Newer
Older
gitbucket_jkp / src / main / twirl / helper / commitcomment.scala.html
@Shintaro Murakami Shintaro Murakami on 26 Nov 2014 1 KB (refs #9) Comments for commit and diff
@(comment: model.CommitComment,
hasWritePermission: Boolean,
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
@import context._
@import view.helpers._
<div class="@if(comment.fileName.isDefined){inline-comment}" @if(comment.fileName.isDefined){filename=@comment.fileName.get} @if(comment.newLine.isDefined){newline=@comment.newLine.get} @if(comment.oldLine.isDefined){oldline=@comment.oldLine.get}>
  <div class="issue-avatar-image">@avatar(comment.commentedUserName, 48)</div>
  <div class="box commit-comment-box commit-comment-@comment.commentId">
    <div class="box-header-small">
      @user(comment.commentedUserName, styleClass="username strong")
        <span class="muted">
          commented
          @if(comment.fileName.isDefined){
            on @comment.fileName.get
          }
          in <a href="@path/@repository.owner/@repository.name/commit/@comment.commitId">@comment.commitId.substring(0, 7)</a>
          @helper.html.datetimeago(comment.registeredDate)
        </span>
      <span class="pull-right">
        @if(hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false)){
          <a href="#" data-comment-id="@comment.commentId"><i class="icon-pencil"></i></a>&nbsp;
          <a href="#" data-comment-id="@comment.commentId"><i class="icon-remove-circle"></i></a>
        }
      </span>
    </div>
    <div class="box-content commit-commentContent-@comment.commentId">
      @markdown(comment.content, repository, false, true, true, hasWritePermission)
    </div>
  </div>
</div>