{#

This file is part of the Sonata package.

(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% extends '@SonataAdmin/CRUD/base_list_flat_inner_row.html.twig' %}

{% block row %}
    <div class="col-sm-12">
        <div class="pull-left">
            {% if admin.isGranted('EDIT', object) and admin.hasRoute('edit') %}
                <a href="{{ admin.generateObjectUrl('edit', object) }}" style="float: left; margin-right: 6px;">
                    {{ sonata_thumbnail(object, 'admin', {'width': 90}) }}
                </a>
            {% else %}
                {{ sonata_thumbnail(object, 'admin', {'width': 90}) }}
            {% endif %}
        </div>
        <span class="badge pull-right">{{ object.providerName|trans({}, 'SonataMediaBundle') }}</span>
        {% if admin.isGranted('EDIT', object) and admin.hasRoute('edit') %}
            <a href="{{ admin.generateObjectUrl('edit', object) }}"><strong>{{ object.name }}</strong></a>
        {% else %}
            <strong>{{ object.name }}</strong>
        {% endif %}

        <br/>

        {% if object.width %} {{ object.width }}{% if object.height %}x{{ object.height }}{% endif %}px{% endif %}
        {% if object.length > 0 %}
            ({{ object.length }})
        {% endif %}

        <br/>

        {% if object.authorName is not empty %}
           {{ object.authorName }}
        {% endif %}

        {% if object.copyright is not empty and object.authorName is not empty %}
            ~
        {% endif %}

        {% if object.copyright is not empty %}
            &copy; {{ object.copyright }}
        {% endif  %}
    </div>
{% endblock row %}
