#requireResource("confluence.web.resources:ajs") #requireResource("confluence.web.resources:animation") #set ($useWatch = $remoteUser && !$action.userWatchingPage && !$action.userWatchingSpace) #set ($commentTextareaTabIndex = 200) #if ($page.type == "blogpost") #end #macro (displayCommentActions $commentId $commentActionSection $webInterfaceContext) #set ($items=$webInterfaceManager.getDisplayableItems("system.comment.action/$commentActionSection", $webInterfaceContext)) #if ($items) #end #end #macro (displayCommentForm $formname $actionParams $pageId $rte)
#parse ("/includes/alert-anonymous.vm") #parse("/template/aui/editor-messages.vm")
#form_xsrfToken() #if ($rte) #requireResourcesForContext("editor") #requireResourcesForContext("comment-editor") #bodytag ("Component" "name='Content'" "theme='aui'" "template='editor.vm'") #param ("formname" $formname) #param ("spaceKey" "$generalUtil.urlEncode($spaceKey)") #param ("tabindex" $commentTextareaTabIndex) #param ("heartbeat" "true") #param ("contentId" "$pageId") #param ("contentType" "comment") #param ("minEditorHeight" "150") #param ("useWatch" $useWatch) #param ("saveDrafts" "false") #param ("shouldResize" "true") #param ("fullscreen" "false") #param ("requireResources" "true") #param ("autoStart" "true") #param ("wrapEditorWithContainer" "true") #param ("showDraftStatus" "false") #end #else
#end
#end #macro (commentThread $comment) #set ($page = $comment.owner)
  • #if ($action.editComment && $action.comment && $action.comment.id == $comment.id && $permissionHelper.canEdit($remoteUser, $comment )) #requireResourcesForContext("editor") #requireResourcesForContext("comment-editor")
    #parse("/template/aui/editor-messages.vm")
    #form_xsrfToken() #bodytag ("Component" "name='Content'" "theme='aui'" "template='editor.vm'") #param ("formname" "editcommentform") #param ("spaceKey" "$generalUtil.urlEncode($spaceKey)") #param ("tabindex" $commentTextareaTabIndex) #param ("heartbeat" "true") #param ("wysiwygContent" "$action.getCommentAsXHtmlForWysiwyg()") #param ("contentId" "$comment.id") #param ("contentType" "comment") #param ("minEditorHeight" "150") #param ("useWatch" $useWatch) #param ("saveDrafts" "false") #param ("shouldResize" "true") #param ("fullscreen" "false") #param ("requireResources" "true") #param ("autoStart" "true") #param ("wrapEditorWithContainer" "true") #end
    #else #trackbackRdf ($trackbackUtils.getContentIdentifier($comment) $page.title $trackbackUtils.getPingUrl($comment)) #if ( $action.threadComments && $action.replyToComment == $comment.id && $permissionHelper.canComment($action.authenticatedUser, $comment.owner) && $action.isPrintableVersion()==false )
    1. #displayCommentForm("threadedcommentform", "pageId=${page.id}&parentId=${comment.id}", ${page.id}, true)
    #end #end #if ($threadComments) #if ($comment.children.size() > 0)
      #foreach ($childComment in $comment.children) #commentThread($childComment) #end
    #end #end
  • #end #* make sure you pass in an AbstractPage as a decorator parameter when you call this inline decorator *# #set ($page = $params.get("page")) ## NOTE: While we still have both statically and dynamically rendered comments in Confluence these templates are duplicated in comments.soy. ## If you are changing one you will probably also need to change the other. #if (!$action.isPrintableVersion()) #requireResourcesForContext("atl.comments")
    #set ($pageLevelComments = $page.pageLevelComments) #if ($pageLevelComments.size() > 0 || $action.showCommentArea)

    #if ($pageLevelComments.size() == 1) $action.getText("comment.singular") #else $action.getText("comment.plural", [$pageLevelComments.size()]) #end

    $action.helper.renderConfluenceMacro("{voting-user-threshold}")
    #end ## Happens when you try to edit a comment that doesn't exist #if ($action.editComment && !$action.comment) #applyDecorator ("message") #decoratorParam("type" "error") $action.getText("comment.edit.not.found") #end #end #* Show expanded comments. If there are none, then show nothing at all (no heading, zilch!) *# #if ($pageLevelComments.size() > 0) #if ($threadComments) #set ($topLevelComments = $page.topLevelComments) #else #set ($topLevelComments = $pageLevelComments) #end
      #foreach ($comment in $topLevelComments) #commentThread($comment) #end
    #end #set ($bottomCommentPanels=$webInterfaceManager.getDisplayableWebPanels("atl.comments.view.bottom", $action.context)) #if ($bottomCommentPanels)
    #foreach ($panel in $bottomCommentPanels) $panel.getHtml($action.context) #end
    #end #if (!$action.isPrintableVersion() && $permissionHelper.canComment($remoteUser, $page)) #if ($action.showCommentArea)
    #displayCommentForm("inlinecommentform", "pageId=${page.id}", ${page.id}, true)
    #elseif($darkFeatures.isFeatureEnabled('text.comment.editor'))
    #displayCommentForm("textcommentform", "pageId=${page.id}", ${page.id}, false)
    #else

    $action.getText('action.add.comment')

    #end #end
    #end