<#macro contentFiles image contentId="" copy=false lang="" name="">
    <#if !name?has_content>
    <#local name=image?then('images','files')/>
    </#if>
    <#local fileTypes=image?then('image','video,document,audio,other')/>
<table class="list nowrap sortDrag itemDetail ${name}" addButton="<@t.page 'button.new_line'/>" batchButton="<@t.page 'button.batch_upload'/>" batchUrl="common/batchUpload.html?field=filePath&originalField=description<#if image>&fileTypes=image</#if>" width="100%">
    <thead>
        <tr>
            <th type="attach" name="${name}[#index#].filePath" size="50" fieldClass="required" lookupGroup="${name}[#index#]" lookupUrl="common/upload.html?field=filePath&originalField=description${image?then('&fileTypes=image','')}"><@t.page 'file_path'/></th>
            <th type="textarea" name="${name}[#index#].description" fieldAttrs='{"maxlength":150,"rows":2,"cols":60}'><@t.page 'description'/></th>
            <th type="text" name="${name}[#index#].fileSize" fieldClass="digits" size="10" fieldAttrs='{"maxlength":20,"readonly":"readonly"}'><@t.page 'file.size'/></th>
            <th type="text" name="${name}[#index#].width" fieldClass="digits" size="10" fieldAttrs='{"maxlength":20,"readonly":"readonly"}'><@t.page 'width'/></th>
            <th type="text" name="${name}[#index#].height" fieldClass="digits" size="10" fieldAttrs='{"maxlength":20,"readonly":"readonly"}'><@t.page 'height'/></th>
            <th type="delAndSort" width="60"><@t.page 'operate'/></th>
        </tr>
    </thead>
    <tbody>
<#if contentId?has_content>
    <@cms.contentFileList contentId=contentId fileTypes=fileTypes absoluteURL=false pageSize=500>
        <#list page.list as file>
            <tr>
                <td>
                    <#if !copy><input type="hidden" name="${name}[${file?index}].id" value="${file.id}"/></#if>
                    <input type="hidden" name="${name}[${file?index}].lang" value="${lang}"/>
                    <input type="text" name="${name}[${file?index}].filePath" value="${(file.filePath)!}" size="50" class="required preview"/>
                    <a class="btnAttach" lookupGroup="${name}[${file?index}]" href="common/upload.html?field=filePath&originalField=description${image?then('&fileTypes=image','')}" width="1000" height="600">${t.pageMessage(image?then('upload.image','upload.file'))}</a>
                </td>
                <td>
                    <textarea name="${name}[${file?index}].description" rows="3" cols="50" maxlength="150">${(file.description)!}</textarea>
                </td>
                <td>
                    <input type="text" name="${name}[${file?index}].fileSize" class="digits" readonly="readonly" value="${(file.fileSize)!}" size="10" maxlength="20"/>
                </td>
                <td>
                    <input type="text" name="${name}[${file?index}].width" class="digits" readonly="readonly" value="${(file.width)!}" size="10" maxlength="20"/>
                </td>
                <td>
                    <input type="text" name="${name}[${file?index}].height" class="digits" readonly="readonly" value="${(file.height)!}" size="10" maxlength="20"/>
                </td>
                <td>
                    <a href="javascript:;" class="icon-move"></a>
                    <a href="javascript:;" class="btnDel"><@t.page 'button.delete'/></a>
                </td>
            </tr>
        </#list>
    </@cms.contentFileList>
</#if>
    </tbody>
</table>
</#macro>