{# This file is part of the Sonata package. (c) Thomas Rabaix For the full copyright and license information, please view the LICENSE file that was distributed with this source code. #} {% extends 'SonataAdminBundle::empty_layout.html.twig' %} {% set ckParameters = {'CKEditor': app.request.get('CKEditor'), 'CKEditorFuncNum': app.request.get('CKEditorFuncNum')} %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %} {% block preview %}{% endblock %} {% import _self as tree %} {% macro navigate_child(collection, admin, root, current_category, depth) %} {% if root and collection|length == 0 %}

{{ admin.trans('warning_no_category', {}, admin.translationdomain) }}

{% endif %} {% for element in collection %}
  • {% if element.parent or root %}{% endif %} {{ element.name }}
    {% if element.children|length %} {{ _self.navigate_child(element.children, admin, false, current_category, depth + 1) }} {% endif %}
  • {% endfor %} {% endmacro %} {% block list_table %}
    {% if root_category is not null %} {{ tree.navigate_child([root_category], admin, true, datagrid.values['category']['value'], 1) }} {% endif %}
    {{ sonata_block_render_event('sonata.admin.list.table.top', { 'admin': admin }) }} {% block list_header %}{% endblock %} {% if admin.datagrid.results|length > 0 %} {% block table_header %} {% for field_description in admin.list.elements %} {% if field_description.getOption('code') == '_batch' or field_description.name == '_action' %} {# Disable batch and actions #} {% else %} {% set sortable = false %} {% if field_description.options.sortable is defined and field_description.options.sortable%} {% set sortable = true %} {% set sort_parameters = admin.modelmanager.sortparameters(field_description, admin.datagrid)|merge(ckParameters) %} {% set current = admin.datagrid.values._sort_by == field_description or admin.datagrid.values._sort_by.fieldName == sort_parameters.filter._sort_by %} {% set sort_active_class = current ? 'sonata-ba-list-field-order-active' : '' %} {% set sort_by = current ? admin.datagrid.values._sort_order : field_description.options._sort_order %} {% endif %} {% spaceless %} {% endspaceless %} {% endif %} {% endfor %} {% endblock %} {% block table_body %} {% for object in admin.datagrid.results %} {% endfor %} {% endblock %} {% block table_footer %} {% endblock %}
    {% if sortable %}{% endif %} {{ admin.trans(field_description.label) }} {% if sortable %}{% endif %}
    {% thumbnail object, 'admin' with {'width': 75, 'height': 60} %} {{ object.name }}
    {{ object.providerName|trans({}, 'SonataMediaBundle') }}{% if object.width %}: {{ object.width }}{% if object.height %}x{{ object.height }}{% endif %}px{% endif %} {% if formats[object.id]|length > 0 %} - {{ 'title.formats'|trans({}, 'SonataMediaBundle') }}: {% for name, format in formats[object.id] %} {{ name }} {% if format.width %}({{ format.width }}{% if format.height %}x{{ format.height }}{% endif %}px){% endif %} {% endfor %} {% endif %}
    {% else %}
    {{ 'no_result'|trans({}, 'SonataAdminBundle') }}
    {% endif %} {{ sonata_block_render_event('sonata.admin.list.table.bottom', { 'admin': admin }) }}
    {% block list_footer %} {% if admin.datagrid.results|length > 0 %} {% endif %} {% endblock %}
    {% endblock %} {% block list_filters_actions %} {%- if admin.datagrid.filters|length %} {% endif -%} {% endblock %} {% block list_filters %} {% if admin.datagrid.filters %} {% form_theme form admin.getTemplate('filter') %}
    {{ form_errors(form) }}
    {% for filter in admin.datagrid.filters %}
    {% if filter.label is not sameas(false) %} {% endif %} {% set attr = form.children[filter.formName].children['type'].vars.attr|default({}) %}
    {{ form_widget(form.children[filter.formName].children['type'], {'attr': attr}) }}
    {{ form_widget(form.children[filter.formName].children['value']) }}
    {% endfor %}
    {% set foo = form.children['_page'].setRendered() %} {{ form_rest(form) }}
    {{ 'link_reset_filter'|trans({}, 'SonataAdminBundle') }}
    {% for paramKey, paramValue in admin.persistentParameters|merge(ckParameters) %} {% endfor %}
    {% endif %} {% endblock %}