$!page.title

#set ($max = $action.maxAttachments - 1) #applyDecorator("root") #decoratorParam("helper" $action.helper) #decoratorParam("mode" "view-attachments") #decoratorParam("context" "$action.page.type") #requireResource("confluence.web.resources:jquery") #requireResource("confluence.web.resources:ajs") #requireResource("confluence.web.resources:prototype") #requireResource("confluence.web.resources:attachments")
#if ($action.latestVersionsOfAttachments.size() > 1)
## if more than five attachments, it may be difficult to see the add attachment form. provide a link to goes to the anchor #if ($action.hasAttachFilePermissions() && $latestVersionsOfAttachments.size() > 5) $action.getText('add.attachment') | #end $action.getText('download.all')
#end #if ($latestVersionsOfAttachments.size() > 0)

| $action.getText('name.word') | $action.getText('file.size') | $action.getText('creator.name') ($action.getText('space-last-modifier')) | $action.getText('columnheading.creation.date') | $action.getText('space-last-mod-date') | $action.getText('comment.name') |
--- | --- | --- | --- | --- | --- | --- | ---
## 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) ## 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 ($oldVersions = $action.getPreviousVersions($attachment)) #if ($action.highlight.contains($attachment.fileName))
#else
#end #if ($oldVersions.size() > 0)#else#end | #parse ("/pages/includes/attachment_icon.vm") $generalUtil.htmlEncode($attachment.fileName) | $attachment.niceFileSize | #usernameLink($attachment.creatorName) #if ($attachment.creationDate!=$attachment.lastModificationDate)($action.getText('last.modified.by') #usernameLink($attachment.lastModifierName))#end | $dateFormatter.format($attachment.creationDate) | $dateFormatter.format($attachment.lastModificationDate) | #if ($attachment.comment && $attachment.comment.trim().length() > 0) $generalUtil.htmlEncode($attachment.comment) #else #end | #set ($webInterfaceContext = $action.getWebInterfaceContext($attachment)) #foreach ($item in $webInterfaceManager.getDisplayableItems("system.attachment", $webInterfaceContext)) #if ($velocityCount > 1) | #end $item.label.getDisplayableLabel($req, $webInterfaceContext) #end
#if ($oldVersions.size() > 0) #foreach( $previousVersionOfAttachment in $oldVersions )
| Version $previousVersionOfAttachment.getVersion() | #if(!$action.attachmentsInWebDavFolder)$previousVersionOfAttachment.niceFileSize#else #end | #if (!$action.attachmentsInWebDavFolder) #usernameLink($previousVersionOfAttachment.creatorName) #if($previousVersionOfAttachment.creationDate!=$previousVersionOfAttachment.lastModificationDate)($action.getText('last.modified.by') #usernameLink($previousVersionOfAttachment.lastModifierName)) #end #else #end | #if(!$action.attachmentsInWebDavFolder)$dateFormatter.format($previousVersionOfAttachment.creationDate)#else #end | #if(!$action.attachmentsInWebDavFolder)$dateFormatter.format($previousVersionOfAttachment.lastModificationDate)#else #end | #if (!$action.attachmentsInWebDavFolder && $previousVersionOfAttachment.comment && $previousVersionOfAttachment.comment.trim().length() > 0) $generalUtil.htmlEncode($previousVersionOfAttachment.comment) #else #end |
#end #end #end

#else $action.getText('currently.no.attachments') #end #if( $action.hasAttachFilePermissions() ) #parse ("/pages/uploadattachments.vm") #end
#end