@** * Yona, 21st Century Project Hosting SW * * Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp. * https://yona.io **@ @import org.jsoup.Jsoup @(comment:Comment, project:Project, issue:Issue) @import utils.TemplateHelper._ @import utils.AccessControl._ @import utils.JodaDateUtil @import utils.Markdown @import models.enumeration.ResourceType @getEllipsisText(content: String) = @{ val MAX_TEXT_LENGTH = 60 val stripedText = Jsoup.parse(content).text().trim if(stripedText.length > MAX_TEXT_LENGTH) { stripedText.substring(0, MAX_TEXT_LENGTH) + "..." } else { stripedText } } @currentUserLoginId = @{ UserApp.currentUser().loginId } @hasCurrentUserMention(content: String) = @{ content.indexOf("@" + currentUserLoginId + " ") != -1 } @hasCurrentUserMentionInChildComments(comment: Comment) = @{ var has = false for(childComment <- comment.getChildComments) { if(hasCurrentUserMention(childComment.contents)) { has = true } } has } @attachmentsSize = @{ Attachment.findByContainer(ResourceType.ISSUE_COMMENT, comment.id.toString).size } @commentsSize = @{comment.getChildComments.size()}