{*

A generic document upload form

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

*}
{ifloop rel="document"}
    <ul id="js-sort-document" class="list-unstyled document-list">
        {loop type="document" name="document" source="{$documentType}" order="manual" source_id="{$parentId}"}
            <li class="clearfix ui-state-default" data-sort-id="{$ID}">
                <a href="{$DOCUMENT_PATH}" title="{$TITLE}" class="pull-left" target="_blank">{$TITLE}</a>


                <div class="btn-group pull-right">
                    <a class="image-update-btn btn btn-default btn-xs disabled js-sorted-position" href="#">{$POSITION}</a>
                    <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>
            </li>
        {/loop}
    </ul>
{/ifloop}

{elseloop rel="document"}
<div class="alert alert-info">{intl l='There is no documents attached to this %type.' type={$documentType}}</div>
{/elseloop}
