@** * Yona, 21st Century Project Hosting SW * * Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp. * https://yona.io **@ @(comment:Comment, project:Project, issue:Issue) @import org.apache.commons.lang3.StringUtils @import utils.TemplateHelper._ @import utils.AccessControl._ @import utils.JodaDateUtil @import play.libs.Json.toJson @import utils.Markdown @import controllers.api.IssueApi @import models.enumeration.ResourceType @isAuthorComment(commentId: String) = @{ if(commentId == UserApp.currentUser().loginId) {"author"} } @VOTER_AVATAR_SHOW_LIMIT = @{ 5 }
  • @defining(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.UPDATE)) { isAllowedUpdate => @common.childCommentsAnchorDiv(issue, comment)
    @comment.authorName
    @comment.authorLoginId @User.findByLoginId(comment.authorLoginId).getDisplayName @utils.TemplateHelper.agoOrDateString(comment.createdDate) @Messages("issue.menu.new.by") @if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.READ) && comment.isInstanceOf[IssueComment]) { @defining(comment.asInstanceOf[IssueComment]) { issueComment => @if(issueComment.voters.size > VOTER_AVATAR_SHOW_LIMIT) { @if(issueComment.voters.size == 1) { @Messages("common.comment.vote.agreement", issueComment.voters.size) } else { @Messages("common.comment.vote.agreements", issueComment.voters.size) } @partial_voter_list("voters-" + issueComment.id, issueComment.voters) } else { @for(voter <- issueComment.voters) { } } @if(issueComment.voters.contains(UserApp.currentUser())) { } else { @if(UserApp.currentUser().isAnonymous()) { } else { } } } } @if(StringUtils.isNotBlank(IssueApi.TRANSLATION_API)) { } @if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.READ)) { } @if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.DELETE)) { }
    @common.commentUpdateForm(comment, routes.IssueApp.newComment(project.owner, project.name, issue.getNumber).toString(), comment.contents, isAllowedUpdate)
    @common.tasklistBar()
    @Html(Markdown.render(comment.contents, project))
    @common.childComments(issue, comment, ResourceType.ISSUE_COMMENT) }