Newer
Older
GitBucket / src / main / twirl / gitbucket / core / helper / commitcomment.scala.html
@Naoki Takezoe Naoki Takezoe on 24 May 2018 1 KB Revert "show "edited" in edited comment"
@(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="commit-comment-box @if(latestCommitId.contains(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="commit-comment-@comment.commentId">
    <div class="markdown-body">
      <div>
        @helpers.avatarLink(comment.commentedUserName, 20)
        @helpers.user(comment.commentedUserName, styleClass="username strong")
        <span class="muted">@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="commit-commentContent-@comment.commentId">
        @helpers.markdown(
          markdown = comment.content,
          repository = repository,
          enableWikiLink = false,
          enableRefsLink = true,
          enableLineBreaks = true,
          enableTaskList = true,
          hasWritePermission = hasWritePermission
        )
      </div>
    </div>
  </div>
</div>