Newer
Older
GitBucket / src / main / twirl / gitbucket / core / helper / commitcomment.scala.html
@(comment: gitbucket.core.model.CommitComment,
  hasWritePermission: Boolean,
  repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
  latestCommitId: Option[String] = None)(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
<div class="@if(comment.fileName.isDefined && (!latestCommitId.isDefined || latestCommitId.get == comment.commitId)){inline-comment}"
    id="discussion_r@comment.commentId"
    @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">@helpers.avatarLink(comment.commentedUserName, 48)</div>
  <div class="panel panel-default commit-comment-box commit-comment-@comment.commentId">
    <div class="panel-heading">
      @helpers.user(comment.commentedUserName, styleClass="username strong")
        <span class="muted">
          commented
          @if(comment.issueId.isDefined){
            on this Pull Request
          } else {
            @if(comment.fileName.isDefined){
              on @comment.fileName.get
            }
            in <a href="@context.path/@repository.owner/@repository.name/commit/@comment.commitId">@comment.commitId.substring(0, 7)</a>
          }
          @gitbucket.core.helper.html.datetimeago(comment.registeredDate)
        </span>
      <span class="pull-right">
        @if(hasWritePermission || context.loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false)){
          <a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-pencil"></i></a>&nbsp;
          <a href="#" data-comment-id="@comment.commentId"><i class="octicon octicon-x"></i></a>
        }
      </span>
    </div>
    <div class="panel-body issue-content commit-commentContent-@comment.commentId markdown-body">
      @helpers.markdown(
        markdown = comment.content,
        repository = repository,
        enableWikiLink = false,
        enableRefsLink = true,
        enableLineBreaks = true,
        enableTaskList = false,
        hasWritePermission = hasWritePermission
      )
    </div>
  </div>
</div>