{*

A generic image upload form

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

*}

{ifloop rel="image"}
    <div class="row">
        {loop type="image" name="image" source="{$imageType}" order="manual-reverse" source_id="{$parentId}" width="200" height="100" resize_mode="borders"}
            <div class="col-sm-6 col-md-3" >
                <a href="{url path="/admin/image/type/$imageType/$ID/update"}" alt="{intl l='Update this image'}" class="thumbnail">
                    <img src="{$IMAGE_URL}" alt="{$TITLE}">
                </a>

                <div class="btn-group" >
                    <a class="image-update-btn btn btn-default btn-xs" href="{url path="/admin/image/type/$imageType/$ID/update"}" data-error-message="{intl l='Please retry'}">
                        <span class="glyphicon glyphicon-edit"></span>
                    </a>
                    <a class="image-delete-btn btn btn-default btn-xs" href="{url path="/admin/image/type/$imageType/delete/$ID"}" data-error-message="{intl l='Please retry'}">
                        <span class="glyphicon glyphicon-trash"></span>
                    </a>
                </div>
            </div>
        {/loop}
    </div>
{/ifloop}
{elseloop rel="image"}
<div class="alert alert-info">{intl l='There is no images attached to this %type.' type=$imageType}</div>
{/elseloop}