{#

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

{% block title %}{{ 'title_select_provider'|trans({}, 'SonataMediaBundle') }}{% endblock title %}

{% block content %}
    <div class="box box-success">
        <div class="box-header">
            <h3 class="box-title">
                {{ block('title') }}
            </h3>
        </div>
        <div class="box-body">
            {% for code, provider in providers %}
                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6">
                    <a href="{{ admin.generateUrl('create', {'provider': provider.name}) }}"
                       class="btn btn-app btn-block"
                       data-toggle="tooltip"
                       data-placement="top"
                       title="{{ provider.providerMetadata.description|trans({}, provider.providerMetadata.domain|default(admin.translationDomain)) }}"
                            >
                        {% if provider.providerMetadata.option('class') %}
                            <i class="{{ provider.providerMetadata.option('class') }}"></i>
                        {% else %}
                            <img src="{{ asset(provider.providerMetadata.image) }}" style="max-height: 20px; max-width: 100px;"/>
                            <br/>
                        {% endif %}
                        {{ provider.providerMetadata.title|trans({}, provider.providerMetadata.domain|default(admin.translationDomain)) }}
                    </a>
                </div>
            {% else %}
                <span class="alert alert-info">{{ 'no_provider_available'|trans({}, 'SonataMediaBundle') }}</span>
            {% endfor %}
            <div class="clearfix"></div>
        </div>
    </div>
{% endblock content %}
