{% macro print_ico(type) %}

    {% set types = {
        'image': 'image',
        'video': 'video-camera',
        'document': 'file',
        'sound': 'volume-up',
        'private_asset': 'lock'
    } %}

    {% if type in types|keys %}
        <i class="fa fa-{{ attribute(types, type) }}"></i>
    {% endif %}
{% endmacro %}


{%- macro print_thumbnail(entity, type, resize = true ) -%}
    {% spaceless %}
        {% if type == constant("Comitium5\\DesignerBundle\\Model\\AssetTypes::IMAGE") %}
            {{ entity.url }}
        {% else %}
            {% if type == constant("Comitium5\\DesignerBundle\\Model\\AssetTypes::DOCUMENT") %}
                {{ asset('/bundles/comitium5designer/layout/img/' ~ get_document_ico(entity.source|default(null))) }}
            {% elseif type == constant("Comitium5\\DesignerBundle\\Model\\AssetTypes::VIDEO") or type == constant("Comitium5\\DesignerBundle\\Model\\AssetTypes::SOUND")%}
                {% if entity.imageRelated %}
                    {{ entity.imageRelated.url }}
                {% else %}
                    {{ asset('/bundles/comitium5designer/layout/img/asset-' ~ type ~ '.gif') }}
                {% endif %}
            {% else %}
                {{ asset('/bundles/comitium5designer/layout/img/asset-' ~ type ~ '.gif') }}
            {% endif %}
        {% endif %}
    {% endspaceless %}
{%- endmacro -%}
