{#

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/list_outer_rows_mosaic.html.twig' %}

{% block sonata_mosaic_default_view %}
    <span class="mosaic-box-label label label-primary pull-right">{{ object.providerName|trans({}, 'SonataMediaBundle') }}</span>
{% endblock sonata_mosaic_default_view %}

{% block sonata_mosaic_hover_view %}
    <span class="mosaic-box-label label label-primary pull-right">{{ object.providerName|trans({}, 'SonataMediaBundle') }}</span>

    {% 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 %}
{% endblock sonata_mosaic_hover_view %}

{% block sonata_mosaic_description %}
    {% if admin.isGranted('EDIT', object) and admin.hasRoute('edit') %}
        <a class="mosaic-inner-link" href="{{ admin.generateObjectUrl('edit', object) }}">{{ meta.title|u.truncate(40) }}</a>
    {% elseif admin.isGranted('SHOW', object) and admin.hasRoute('show') %}
        <a class="mosaic-inner-link" href="{{ admin.generateObjectUrl('show', object) }}">{{ meta.title|u.truncate(40) }}</a>
    {% else %}
        {{ meta.title|u.truncate(40) }}
    {% endif %}
{% endblock sonata_mosaic_description %}
