THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

78 lines
4.6 KiB

@**
* Yona, 21st Century Project Hosting SW
*
* Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp.
* https://yona.io
**@
@(project:Project, post:Posting)
@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"}
}
<div class="comment-header"><i class="yobicon-comments"></i> <strong>@Messages("common.comment")</strong> <strong class="num">@post.comments.size</strong></div>
<hr class="nm" />
<ul class="comments">
@for(comment <-post.comments){
@defining(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.UPDATE)) { isAllowedUpdate =>
@if(comment.getParentComment == null){
<li class="comment @isAuthorComment(comment.authorLoginId)" id="comment-@comment.id">
@common.childCommentsAnchorDiv(post, comment)
<div class="comment-avatar">
<a href="@routes.UserApp.userInfo(comment.authorLoginId)" class="avatar-wrap" data-toggle="tooltip" data-placement="top" title="@comment.authorName">
<img src="@User.findByLoginId(comment.authorLoginId).avatarUrl(64)" width="32" height="32" alt="@comment.authorLoginId">
</a>
</div>
<div class="media-body">
<div class="meta-info">
<span class="comment_author">
<span class="resp-comment-avatar">
<a href="@userInfo(comment.authorLoginId)" class="avatar-wrap" data-toggle="tooltip" data-placement="top" title="@comment.authorName">
<img src="@User.findByLoginId(comment.authorLoginId).avatarUrl(64)" width="32" height="32" alt="@comment.authorName">
</a>
</span>
<a href="@routes.UserApp.userInfo(comment.authorLoginId)" data-toggle="tooltip" data-placement="top" title="@comment.authorLoginId"><strong>@comment.authorName</strong></a>
</span>
<span class="ago-date">
<a href="#comment-@comment.id" class="ago" title="@JodaDateUtil.getDateString(comment.createdDate)">@utils.TemplateHelper.agoOrDateString(comment.createdDate)</a>
</span>
<span class="act-row pull-right">
@if(StringUtils.isNotBlank(IssueApi.TRANSLATION_API)){
<button type="button" class="icon btn-transparent ml10 comment-translate" data-toggle="tooltip" data-comment-id="@comment.id" title="@Messages("button.translation")"><i class="yobicon-lang"></i></button>
}
@if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.READ)) {
<button type="button" class="btn-transparent ml10" data-toggle="comment-edit" data-comment-id="@comment.id" title="@Messages("common.comment.edit")"><i class="yobicon-edit-2"></i></button>
}
@if(isAllowed(UserApp.currentUser(), comment.asResource(), Operation.DELETE)) {
<button type="button" class="btn-transparent ml6" data-toggle="comment-delete" data-request-uri="@routes.BoardApp.deleteComment(project.owner, project.name, post.getNumber, comment.id)" title="@Messages("common.comment.delete")"><i class="yobicon-trash"></i></button>
}
</span>
</div>
@common.commentUpdateForm(comment, routes.BoardApp.newComment(project.owner, project.name, post.getNumber).toString(), comment.contents, isAllowedUpdate)
<div id="comment-body-@comment.id">
@common.tasklistBar()
<div class="comment-body markdown-wrap" data-via-email="@OriginalEmail.exists(comment.asResource)" data-allowed-update="@isAllowedUpdate" >@Html(Markdown.render(comment.contents, project))</div>
<div class="attachments pull-right" data-attachments="@toJson(AttachmentApp.getFileList(ResourceType.NONISSUE_COMMENT.toString(), comment.id.toString()))"></div>
</div>
</div>
@common.childComments(post, comment, ResourceType.NONISSUE_COMMENT)
</li>
}
}
}
</ul>