{% set asset_type = app.request.attributes.get('type') %}
{% set outter = app.request.query.get('outter', false) %}
{% if outter %}
<!-- Tab Library -->
<div class="widget-asset-library">
    <div class="tab_library">
        <!-- Search -->
        <div class="form-group">

            {% if asset_type %}
                {% set name = 'cs_assets.types.' ~ asset_type %}
            {% else %}
                {% set name = 'cs_core.entity.asset' %}
            {% endif %}

            <input type="text" data-url="{{ url('designer_assets_library_search', { type: asset_type, contentLocale: app.request.get("contentLocale") }) }}" class="form-control widget-search" placeholder="{{ 'cs_core.action.search.something'|trans({ '%something%': name|transchoice(2) }) }}..."/>
        </div>
{% endif %}
        <div class="pagination-container widget-library">
            {% if pagination|length %}
            <div class="library-pagination">
                <!-- Results -->
                {% for image in pagination %}
                    {% include 'Comitium5DesignerBundle:Asset:widget_library.html.twig' with { entity: image, type: type } only %}
                {% endfor %}
                <!-- /Results -->
            </div>
            {% else %}
                {% if asset_type %}
                    {% set name = ('cs_assets.types.' ~ asset_type) %}
                {% else %}
                    {% set name = ('cs_core.entity.asset') %}
                {% endif %}
                <div class="alert alert-warning fade in" role="alert">
                    {{ 'cs_core.no_search_results'|trans({ '%something%': name|transchoice(1)  }) }}
                </div>
            {% endif %}
            <!-- Paginator -->
            {{ knp_pagination_render(pagination, null, { outter: false }, {library:true}) }}
            <!-- /Paginator -->
            <div class="clearfix"></div>
        </div>
{% if outter %}
    </div>
</div>
{% endif %}
