diff --git a/src/CoreBundle/Resources/views/Resource/grid.html.twig b/src/CoreBundle/Resources/views/Resource/grid.html.twig deleted file mode 100644 index 075a1731f6..0000000000 --- a/src/CoreBundle/Resources/views/Resource/grid.html.twig +++ /dev/null @@ -1,9 +0,0 @@ -{# Customization of the grid is located here: grid_theme.html.twig #} - -{#{{ grid_search(grid) }}#} -{#{{ grid(grid) }}#} - -{#{{ grid(grid, 'APYDataGridBundle::blocks_js.jquery.html.twig') }}#} - -{{ grid(grid, '@ChamiloCore/Resource/grid_theme_ajax.html.twig') }} - diff --git a/src/CoreBundle/Resources/views/Resource/grid_theme.html.twig b/src/CoreBundle/Resources/views/Resource/grid_theme.html.twig deleted file mode 100644 index dae045a158..0000000000 --- a/src/CoreBundle/Resources/views/Resource/grid_theme.html.twig +++ /dev/null @@ -1,289 +0,0 @@ -{% extends 'APYDataGridBundle::blocks.html.twig' %} - -{# This file is loaded from config/services.yaml and then used in all grids. #} - -{# See block documentation here: #} -{# https://github.com/APY/APYDataGridBundle/blob/master/Resources/doc/template/overriding_internal_blocks.md #} - -{% block grid_column_massaction_cell %} - -{% endblock grid_column_massaction_cell %} - -{% block grid_actions %} -{# #} -{# {{ 'Select visible'|trans }}#} -{# #} -{# #} -{# {{ 'Deselect visible'|trans }}#} -{# #} -{# #} -{# {{ 'Select all'|trans }}#} -{# #} -{# #} -{# {{ 'Deselect all'|trans }}#} -{# #} -{# #} - {% apply spaceless %} - - {% endapply %} - -{% endblock grid_actions %} - -{# Bootstrap changes #} -{% block grid_column_actions_cell %} - {% set actions = column.getActionsToRender(row) %} -
- {% for action in actions %} - {% if action.attributes.form_delete is defined and action.attributes.form_delete %} -
-
- - -
-
- {% else %} - {% if action.attributes.iframe is defined and action.attributes.iframe %} - - {% if action.attributes.icon is defined and action.attributes.icon %} - - {% else %} - {{ action.title|trans }} - {% endif %} - - {% else %} - - {% if action.attributes.icon is defined and action.attributes.icon %} - - {% else %} - {{ action.title|trans }} - {% endif %} - - {% endif %} - {% endif %} - {% endfor %} -
-{% endblock grid_column_actions_cell %} - -{% block grid_scripts %} - {{ parent() }} - - -{% endblock %} - -{% block grid %} -
-
- {% if grid.totalCount > 0 or grid.isFiltered or grid.noDataMessage is same as(false) %} -
- -
- {% if grid.massActions|length > 0 %} - {{ grid_actions(grid) }} - {% endif %} -
- -
- - {% if grid.isTitleSectionVisible %} - {{ grid_titles(grid) }} - {% endif %} - {% if grid.isFilterSectionVisible %} - {{ grid_filters(grid) }} - {% endif %} - {{ grid_rows(grid) }} -
-
- - {% if withjs %} - {{ grid_scripts(grid) }} - {% endif %} -
- {% else %} - {{ grid_no_data(grid) }} - {% endif %} -
-
-{% endblock grid %} - -{% block grid_search %} - {% if grid.isFilterSectionVisible %} -
- {% set searchContent %} - - {% endset %} -
-
{{ 'Filters' | trans }}
-
- {{ searchContent }} -
-
-
- {% endif %} -{% endblock grid_search %} - -{% 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 %} -
- -
- -
-
-{% endblock grid_column_filter_type_input %} - - - - - -{# ---------------------------------------------------- grid_pager_selectpage -------------------------------------------------- #} -{#{% block grid_pager_selectpage %}#} -{# {{ 'Page'|trans }}#} -{# {% spaceless %}#} -{# #} -{# #} -{# = grid.pageCount-1 %}disabled="disabled"{% endif %} onclick="return {{ grid.hash }}_nextPage();"/> {{ 'of %count%'|trans({ '%count%' : grid.pageCount }) }}#} -{# {% endspaceless %}#} -{#{% endblock grid_pager_selectpage %}#} -{# ---------------------------------------------------- grid_pager_results_perpage -------------------------------------------------- #} -{#{% block grid_pager_results_perpage %}#} -{# {{ ', Display'|trans }}#} -{# {{ 'Items per page'|trans }}#} -{#{% endblock grid_pager_results_perpage %}#} - diff --git a/src/CoreBundle/Resources/views/Resource/grid_theme_ajax.html.twig b/src/CoreBundle/Resources/views/Resource/grid_theme_ajax.html.twig deleted file mode 100644 index 2c506cdf37..0000000000 --- a/src/CoreBundle/Resources/views/Resource/grid_theme_ajax.html.twig +++ /dev/null @@ -1,89 +0,0 @@ -{% extends '@ChamiloCore/Resource/grid_theme.html.twig' %} - -{% block grid_scripts_goto %} - function {{ grid.hash }}_goto(url, data, type) - { - type = type || 'GET'; - data = data || []; - - $.ajax({ - url: url, - data: data, - type: type - }).done(function( msg ) { - var content = $(msg); - var grid = content.find('#{{ grid.hash }}'); - $('#{{ grid.hash }}').replaceWith(grid); - }); - return false - } -{% endblock grid_scripts_goto %} - -{% block grid_scripts_submit_form %} - function {{ grid.hash }}_submitForm(event, form) - { - if (event.type != 'keypress' || event.which == 13) { - var data = ''; - $('.grid-filter-operator select, .grid-filter-input-query-from, .grid-filter-input-query-to, .grid-filter-select-query-from, .grid-filter-select-query-to', form).each(function () { - if ($(this).is(':disabled') == false) { - var name = $(this).attr('name'); - var value = $(this).val(); - if (value != null) { - if ($(this).attr('multiple') == 'multiple') { - for(var i= 0; i < value.length; i++) - { - data += '&' + name + '=' + value[i]; - } - } else { - data += '&' + name + '=' + value; - } - } else { - data += '&' + name + '='; - } - } - }); - {{ grid.hash }}_goto('{{ grid.routeUrl }}', data.substring(1), 'POST'); - - return false; - } - } -{% endblock grid_scripts_submit_form %} - -{% block grid_scripts_ajax %} -$(function () { - // Order and pagerfanta links - $('.pagination li.disabled a', '#{{ grid.hash }}').click(function (e) { - return false; - }); - - // Order and pagerfanta links - $('a.order, nav a, a.searchOnClick, .pagination li:not(.disabled) a', '#{{ grid.hash }}').click(function () { - {{ grid.hash }}_goto(this.href); - - return false; - }); - - // Reset link - $('#{{ grid.hash }} a.grid-reset').click(function () { - {{ grid.hash }}_reset(); - - return false; - }); - - // Mass actions submit - $('#{{ grid.hash }} input.submit-massaction').click(function () { - var selector = $('#{{ grid.hash }} .grid_massactions select'); - - {{ grid.hash }}_goto('{{ grid.routeUrl }}', selector.attr('name') + '=' + selector.val(), 'POST'); - - return false; - }); - - // Grid_search submit (load only one time) - $('#{{ grid.hash }}_search').one('submit', function (event) { - {{ grid.hash }}_submitForm(event, this); - - return false; - }); -}); -{% endblock grid_scripts_ajax %}