#* @vtlvariable name="attachmentHelper" type="com.atlassian.confluence.pages.actions.ViewPageAttachmentsAction" *# ## Common template for building the attachments table ## When changing this file, check the attachment macro as well. ## Required Parameters: ## * $attachmentHelper - object used to obtain context and previous versions ## * $sortPathPrefixHtml - the url to goto when sorting ## * $showActions - 'true' if actions column is to be displayed ## * $old - 'true' if older versions are to be displayed #if ($old == "true") #end #if ($showActions == "true") #end ## Create a dummy Attachment ID, for when there aren't attachment IDs set (e.g. WebDAV) #set ($dummyAttachmentId = 1) #foreach( $attachment in $latestVersionsOfAttachments ) #set ($currentAttachmentId = $attachment.id) #set ($labels = $attachment.labels) #set ($labelable = $attachment) ## When the attachment ID isn't set (e.g. when we're using WebDAV), assign it an arbitrary number and increment #if ($currentAttachmentId.intValue() == 0) #set ($currentAttachmentId = $dummyAttachmentId) #set ($dummyAttachmentId = $dummyAttachmentId + 1) #end #set ($allVersions = $attachmentHelper.getAllVersions($attachment)) #if ($old == "true") #end #if ($showActions == "true") #end #if ($old == "true" && $allVersions.size() > 0) #foreach( $attachmentVersion in $allVersions ) #if ($showActions == "true") #end #end #end #end
 #sortLink("name", "${sortPathPrefixHtml}name" $action.getText('name.word')) #sortLink("size", "${sortPathPrefixHtml}size" $action.getText('file.size')) $action.getText('creator.name') #sortLink("createddate" "${sortPathPrefixHtml}createddate" $action.getText('columnheading.creation.date')) $action.getText('labels.name') $action.getText('comment.name') 
#if ($allVersions.size() > 0) #end #parse ("/pages/includes/attachment_icon.vm") $htmlUtil.htmlEncode($attachment.fileName) $attachment.niceFileSize #userLink($attachment.creator) $action.dateFormatter.formatDateTime($attachment.creationDate) #parse("/com/atlassian/confluence/plugins/labels/components/labels-content.vm") #if ($attachment.versionComment && $attachment.versionComment.trim().length() > 0) $htmlUtil.htmlEncode($attachment.versionComment) #else   #end #set ($webInterfaceContext = $attachmentHelper.getWebInterfaceContext($action.webInterfaceContext, $attachment)) #set($webItems = $action.webInterfaceManager.getDisplayableItems("system.attachment", $webInterfaceContext)) #if ($webItems.size() > 0)
    #foreach ($item in $webItems) #set ($isCurrent = ($context == $item.key))
  • #renderItemLink($item $isCurrent $webInterfaceContext)
  • #end
#else   #end