@(issue: model.Issue, comments: List[model.IssueComment], hasWritePermission: Boolean, repository: service.RepositoryService.RepositoryInfo, pullreq: Option[model.PullRequest] = None)(implicit context: app.Context) @import context._ @import view.helpers._ @comments.map { comment => @if(comment.action != "close" && comment.action != "reopen"){
@avatar(comment.commentedUserName, 48)
@user(comment.commentedUserName, styleClass="username strong") commented @datetime(comment.registeredDate) @if(comment.action != "commit" && comment.action != "merge" && (hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){   }
@if(comment.action == "commit" && comment.content.split(" ").last.matches("[a-f0-9]{40}")){ @defining(comment.content.substring(comment.content.length - 40)){ id => @markdown(comment.content.substring(0, comment.content.length - 41), repository, false, true) } } else { @markdown(comment.content, repository, false, true) }
} @if(comment.action == "merge"){
Merged @avatar(comment.commentedUserName, 20) @user(comment.commentedUserName, styleClass="username strong") merged commit @pullreq.map(_.commitIdTo.substring(0, 7)) @if(pullreq.get.requestUserName == repository.owner){ @pullreq.map(_.requestBranch) to @pullreq.map(_.branch) } else { @pullreq.map(_.requestUserName):@pullreq.map(_.requestBranch) to @pullreq.map(_.userName):@pullreq.map(_.branch) } @datetime(comment.registeredDate)
} @if(comment.action == "close" || comment.action == "close_comment"){
Closed @avatar(comment.commentedUserName, 20) @if(issue.isPullRequest){ @user(comment.commentedUserName, styleClass="username strong") closed the pull request @datetime(comment.registeredDate) } else { @user(comment.commentedUserName, styleClass="username strong") closed the issue @datetime(comment.registeredDate) }
} @if(comment.action == "reopen" || comment.action == "reopen_comment"){
Reopened @avatar(comment.commentedUserName, 20) @user(comment.commentedUserName, styleClass="username strong") reopened the issue @datetime(comment.registeredDate)
} }