{*

A generic document upload form

Parameters:
    documentType    = Document type (category, product, folder, content, module)
    parentId        = Document parent id, ex: category id

*}

{ifloop rel="document"}
    <table class="table table-striped table-condensed table-left-aligned">
        {loop type="document" name="document" source="{$documentType}" order="manual-reverse" source_id="{$parentId}"}
            <tr>
                <td>
                    <a href="{$DOCUMENT_PATH}" title="{$TITLE}" class="" target="_blank">{$TITLE}</a>
                </td>
                <td>
                    <div class="btn-group">
                        <a class="document-update-btn btn btn-default btn-xs" href="{url path="/admin/document/type/$documentType/$ID/update"}" data-error-message="{intl l='Please retry'}">
                            <span class="glyphicon glyphicon-edit"></span>
                        </a>
                        <a class="document-delete-btn btn btn-default btn-xs" href="{url path="/admin/document/type/$documentType/delete/$ID"}" data-error-message="{intl l='Please retry'}">
                            <span class="glyphicon glyphicon-trash"></span>
                        </a>
                    </div>
                <td>
            </tr>
        {/loop}
    </table>
{/ifloop}
{elseloop rel="document"}
<div class="alert alert-info">{intl l='There is no documents attached to this %type.' type=$documentType}</div>
{/elseloop}
