{#BASE GRID para el Backend si se desea customizar este base grid para un listado particular se deber redefinir los bloques que cambian en su respectivo Directorio ejm: USBackendBundle:User:grid.html.twig #} {% extends 'APYDataGridBundle::blocks.html.twig' %} {% block grid %}
{% if grid.isFilterSectionVisible %}
{{ grid_filters(grid) }}
{% endif %}
{% if grid.isTitleSectionVisible %} {{ grid_titles(grid) }} {% endif %} {{ grid_rows(grid) }}
{% if grid.isPagerSectionVisible %} {{ grid_pager(grid) }} {% endif %} {% if withjs %} {{ grid_scripts(grid) }} {% endif %} {% endblock grid %} {# ---------------------------------------------------- grid_rows --------------------------------------------------- #} {% block grid_rows %} {% set num = 1 %} {% for row in grid.rows %} {% set last_row = loop.last %} {% spaceless %} {% set gridColumns %} {% for column in grid.columns %} {% if column.visible(grid.isReadyForExport) %} {% if column.renderBlockId == "id" %} {{ grid_cell(column, row, grid)|raw }} {% elseif column.renderBlockId == "webIndex" %} {{num}} {% else %} {{ grid_cell(column, row, grid)|raw }} {% endif %} {% endif %} {% endfor %} {% endset %} {{ gridColumns }} {% endspaceless %} {% set num = num+1 %} {% endfor %} {% endblock grid_rows %} {# ---------------------------------------------------- grid_pager -------------------------------------------------- #} {% block grid_pager %} {% if pagerfanta %} {{ grid_pagerfanta(grid) }} {% else %}
{% endif %} {% endblock grid_pager %} {# ---------------------------------------------------- grid_pager_selectpage -------------------------------------------------- #} {% block grid_pager_selectpage %} {% spaceless %}
{% if grid.page > 0 %} < {% endif %}
{% if grid.page+1 == grid.pageCount and grid.page-1 >= 1 %}
{{grid.page-1 < 10?"0"}}{{grid.page-1}}
{% endif%} {% if grid.page+1 > 1 %}
{{grid.page < 10?"0"}}{{grid.page}}
{% endif %}
{{grid.page < 9?"0"}}{{grid.page+1}}
{% if grid.page+2 <= grid.pageCount %}
{{grid.page+2 < 10?"0"}}{{grid.page+2}}
{% endif %} {% if grid.page == 0 and grid.page+3 <= grid.pageCount %}
{{grid.page+3 < 10?"0"}}{{grid.page+3}}
{% endif%}
{% if grid.pageCount > grid.page + 1 %} > {% endif %}
{{'grid.goto.page'|trans({},"USBackendBundle")}} {{ 'of %count%'|trans({ '%count%' : grid.pageCount }) }}
{% endspaceless %} {% endblock grid_pager_selectpage %} {# -------------------------------------------------- grid_filters -------------------------------------------------- #} {% block grid_filters %}
{% endblock grid_filters %} {# -------------------------------------------- grid_column_filter_type_input --------------------------------------- #} {% block grid_column_filter_type_input %} {% set btwOperator = constant('APY\\DataGridBundle\\Grid\\Column\\Column::OPERATOR_BTW') %} {% set btweOperator = constant('APY\\DataGridBundle\\Grid\\Column\\Column::OPERATOR_BTWE') %} {% set isNullOperator = constant('APY\\DataGridBundle\\Grid\\Column\\Column::OPERATOR_ISNULL') %} {% set isNotNullOperator = constant('APY\\DataGridBundle\\Grid\\Column\\Column::OPERATOR_ISNOTNULL') %} {% set op = column.data.operator is defined ? column.data.operator : column.defaultOperator %} {% set from = column.data.from is defined ? column.data.from : null %} {% set to = column.data.to is defined ? column.data.to : null %} {{ grid_column_operator(column, grid, op, submitOnChange) }}
{% endblock grid_column_filter_type_input %} {# --------------------------------------------------- grid_titles -------------------------------------------------- #} {% block grid_titles %} {% for column in grid.columns %} {% if column.visible(grid.isReadyForExport) %} {{column.title}} {% endif %} {% endfor %} {% endblock grid_titles %} {# ------------------------------------------------ grid_column_actions_cell --------------------------------------------- #} {% block grid_column_actions_cell %} {% set actions = column.getActionsToRender(row) %} {% for action in actions %} {{ action.title|trans }} {% endfor %} {% endblock grid_column_actions_cell %}