{# 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:Core:create_button.html.twig' %}
{% endblock %} {% block side_menu %}{{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active'}, 'list') }}{% endblock %} {% block list_table %} {{ sonata_block_render_event('sonata.admin.list.table.top', { 'admin': admin }) }} {% block list_header %}{% endblock %} {% set batchactions = admin.batchactions %} {% if admin.datagrid.results|length > 0 %} {% if admin.hasRoute('batch') %}
{% endif %} {% 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! #} {% 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 %} {% for object in admin.datagrid.results %} {% include admin.getTemplate('inner_list_row') %} {% endfor %} {% endblock %} {% block table_footer %} {% block pager_links %} {% if admin.datagrid.pager.haveToPaginate() %} {% include admin.getTemplate('pager_links') %} {% endif %} {% endblock %} {% endblock %}
{% if sortable %}{% endif %} {{ admin.trans(field_description.label, {}, field_description.translationDomain) }} {% if sortable %}{% endif %}
{% if not app.request.isXmlHttpRequest %} {% if admin.hasRoute('batch') and batchactions|length > 0 %} {% block batch %} {% block batch_actions %} {% endblock %} {% endblock %} {% endif %}
{% if admin.hasRoute('export') and admin.isGranted("EXPORT") and admin.getExportFormats()|length %} {{ "label_export_download"|trans({}, "SonataAdminBundle") }} {% for format in admin.getExportFormats() %} {{ format }}{% if not loop.last %},{% endif %} {% endfor %}  -  {% endif %} {% block pager_results %} {% include admin.getTemplate('pager_results') %} {% endblock %}
{% endif %}
{% if admin.hasRoute('batch') %}
{% endif %} {% else %}

{{ 'no_result'|trans({}, 'SonataAdminBundle') }}

{% endif %} {% block list_footer %}{% endblock %} {{ sonata_block_render_event('sonata.admin.list.table.bottom', { 'admin': admin }) }} {% endblock %} {% block list_filters %} {% if admin.datagrid.filters %}
{{ form_errors(form) }}
{{ 'label_filters'|trans({}, 'SonataAdminBundle') }}
{% for filter in admin.datagrid.filters %}
{{ form_widget(form.children[filter.formName].children['type'], {'attr': form.children[filter.formName].children['type'].vars.attr|default({})|merge({'class': (form.children[filter.formName].children['type'].vars.attr.class|default('') ~ ' span8 sonata-filter-option')|trim})}) }} {{ form_widget(form.children[filter.formName].children['value'], {'attr': form.children[filter.formName].children['value'].vars.attr|default({})|merge({'class': (form.children[filter.formName].children['value'].vars.attr.class|default('') ~ ' span8')|trim})}) }}
{% endfor %}
{% set foo = form.children['_page'].setRendered() %} {{ form_rest(form) }} {{ 'link_reset_filter'|trans({}, 'SonataAdminBundle') }}
{% for paramKey, paramValue in admin.persistentParameters %} {% endfor %}
{% endif %} {% endblock %}