{# 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 base_template %} {%- block actions -%} {% include 'SonataAdminBundle:CRUD:action_buttons.html.twig' %} {%- endblock -%} {% block tab_menu %}{{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active', 'template': sonata_admin.adminPool.getTemplate('tab_menu_template')}, 'twig') }}{% endblock %} {% block title %} {# The list template can be used in nested mode, so we define the title corresponding to the parent's admin. #} {% if admin.isChild and admin.parent.subject %} {{ "title_edit"|trans({'%name%': admin.parent.toString(admin.parent.subject)|truncate(15) }, 'SonataAdminBundle') }} {% endif %} {% endblock %} {% block navbar_title %} {{ block('title') }} {% endblock %} {% block list_table %}
{% set batchactions = admin.batchactions %} {% if admin.hasRoute('batch') and batchactions|length %}
{% endif %} {# Add a margin if no pager to prevent dropdown cropping on window #}
{{ 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 admin.hasRoute('batch') and field_description.getOption('code') == '_batch' and batchactions|length > 0 %} {% elseif field_description.getOption('code') == '_select' %} {% elseif field_description.name == '_action' and app.request.isXmlHttpRequest %} {# Action buttons disabled in ajax view! #} {% elseif field_description.getOption('ajax_hidden') == true and app.request.isXmlHttpRequest %} {# Disable fields with 'ajax_hidden' option set to true #} {% 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) %} {% 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 %} {% include admin.getTemplate('outer_list_rows_' ~ admin.getListMode()) %} {% endblock %} {% block table_footer %} {% endblock %}
{% if sortable %}{% endif %} {{ field_description.label|trans({}, field_description.translationDomain) }} {% if sortable %}{% endif %}
{% else %} {% block no_result_content %}
{{ 'no_result'|trans({}, 'SonataAdminBundle') }}
{% if not app.request.xmlHttpRequest %}
    {% include 'SonataAdminBundle:Button:create_button.html.twig' %}
{% endif %}
{% endblock %} {% endif %} {{ sonata_block_render_event('sonata.admin.list.table.bottom', { 'admin': admin }) }}
{% block list_footer %} {% if admin.datagrid.results|length > 0 %} {% endif %} {% endblock %}
{% if admin.hasRoute('batch') and batchactions|length %}
{% endif %}
{% 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) }}
{% set withAdvancedFilter = false %} {% for filter in admin.datagrid.filters %} {% set filterActive = ((filter.isActive() and filter.options['show_filter'] is null) or (filter.options['show_filter'] is same as(true))) and not admin.isDefaultFilter(filter.formName) %} {% set filterVisible = filter.options['show_filter'] is same as(true) or filter.options['show_filter'] is null %}
{% if filter.label is not same as(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']) }}
{% if filter.options['advanced_filter'] %} {% set withAdvancedFilter = true %} {% endif %} {% endfor %}
{% set foo = form.children['_page'].setRendered() %} {{ form_rest(form) }}
{{ 'link_reset_filter'|trans({}, 'SonataAdminBundle') }}
{% if withAdvancedFilter %} {% endif %}
{% for paramKey, paramValue in admin.persistentParameters %} {% endfor %}
{% endif %} {% endblock %}