parent
0a6a4f3194
commit
a6975ceab1
@ -0,0 +1,161 @@ |
||||
{% extends 'APYDataGridBundle::blocks.html.twig' %} |
||||
|
||||
{# See block documentation here: #} |
||||
{# https://github.com/APY/APYDataGridBundle/blob/master/Resources/doc/template/overriding_internal_blocks.md #} |
||||
|
||||
{% block grid_actions %} |
||||
<div class="mass-actions"> |
||||
<div class="btn-group" role="group"> |
||||
<a class="btn btn-secondary" href="#" onclick="return {{ grid.hash }}_markVisible(true);"> |
||||
{{ 'Select visible'|trans }} |
||||
</a> |
||||
<a class="btn btn-secondary" href="#" onclick="return {{ grid.hash }}_markVisible(false);"> |
||||
{{ 'Deselect visible'|trans }} |
||||
</a> |
||||
<a class="btn btn-secondary" href="#" onclick="return {{ grid.hash }}_markAll(true);"> |
||||
{{ 'Select all'|trans }} |
||||
</a> |
||||
<a class="btn btn-secondary" href="#" onclick="return {{ grid.hash }}_markAll(false);"> |
||||
{{ 'Deselect all'|trans }} |
||||
</a> |
||||
<span class="mass-actions-selected" id="{{ grid.hash }}_mass_action_selected"></span> |
||||
</div> |
||||
{% apply spaceless %} |
||||
<div style="float:right;" class="grid_massactions"> |
||||
{{ 'Action'|trans }} |
||||
<input type="hidden" id="{{ grid.hash }}_mass_action_all" |
||||
name="{{ grid.hash }}[{{ constant('APY\\DataGridBundle\\Grid\\Grid::REQUEST_QUERY_MASS_ACTION_ALL_KEYS_SELECTED') }}]" |
||||
value="0"/> |
||||
<select name="{{ grid.hash }}[{{ constant('APY\\DataGridBundle\\Grid\\Grid::REQUEST_QUERY_MASS_ACTION') }}]" |
||||
class="show-tick"> |
||||
<option value="-1"></option> |
||||
{% for key, massAction in grid.massActions %} |
||||
<option value="{{ key }}">{{ massAction.title|trans }}</option> |
||||
{% endfor %} |
||||
</select> |
||||
<input class="btn btn-secondary" type="submit" value="{{ 'Submit'|trans }}"/> |
||||
</div> |
||||
{% endapply %} |
||||
</div> |
||||
{% endblock grid_actions %} |
||||
|
||||
{# Bootstrap changes #} |
||||
{% block grid_column_actions_cell %} |
||||
{% set actions = column.getActionsToRender(row) %} |
||||
<div class="btn-group"> |
||||
{% for action in actions %} |
||||
{% if action.attributes.form_delete is defined and action.attributes.form_delete %} |
||||
<div class="btn-group"> |
||||
<form method="post" action="{{ url(action.route, column.routeParameters(row, action), false) }}"> |
||||
<input type="hidden" name="_method" value="DELETE" /> |
||||
<button type="submit" class="btn btn-danger"> |
||||
{{ action.title|trans }} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
{% else %} |
||||
<a class="btn btn-secondary" |
||||
href="{{ url(action.route, column.routeParameters(row, action), false) }}" |
||||
target="{{ action.target }}"{% if action.confirm %} onclick="return confirm('{{ action.confirmMessage }}')"{% endif %}{% for name, value in action.attributes %} {{ name }}="{{ value }}" {% endfor %}> |
||||
{{ action.title|trans }} |
||||
</a> |
||||
{% endif %} |
||||
{% endfor %} |
||||
</div> |
||||
{% endblock grid_column_actions_cell %} |
||||
|
||||
{% block grid %} |
||||
<div class="col-md-12"> |
||||
<div class="box box-primary"> |
||||
<div class="box-body table-responsive no-padding"> |
||||
{% if grid.totalCount > 0 or grid.isFiltered or grid.noDataMessage is same as(false) %} |
||||
<form id="{{ grid.hash }}" action="{{ grid.routeUrl }}" |
||||
method="post"> |
||||
<div class="grid_header"> |
||||
{% if grid.massActions|length > 0 %} |
||||
{{ grid_actions(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
<div class="grid_body"> |
||||
<table class="table table-bordered table-striped"> |
||||
{% if grid.isTitleSectionVisible %} |
||||
{{ grid_titles(grid) }} |
||||
{% endif %} |
||||
{% if grid.isFilterSectionVisible %} |
||||
{{ grid_filters(grid) }} |
||||
{% endif %} |
||||
{{ grid_rows(grid) }} |
||||
</table> |
||||
</div> |
||||
<div class="grid_footer"> |
||||
{% if grid.isPagerSectionVisible %} |
||||
{{ grid_pager(grid) }} |
||||
{% endif %} |
||||
{% if grid.exports|length > 0 %} |
||||
{{ grid_exports(grid) }} |
||||
{% endif %} |
||||
{% if grid.tweaks|length > 0 %} |
||||
{{ grid_tweaks(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
{% if withjs %} |
||||
{{ grid_scripts(grid) }} |
||||
{% endif %} |
||||
</form> |
||||
{% else %} |
||||
{{ grid_no_data(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock grid %} |
||||
|
||||
{% block grid_search %} |
||||
{% if grid.isFilterSectionVisible %} |
||||
<div class="col-md-12"> |
||||
{% set searchContent %} |
||||
<form id="{{ grid.hash }}_search" action="{{ grid.routeUrl }}" method="post"> |
||||
{% for column in grid.columns %} |
||||
{% if column.isFilterable and column.type not in ['actions', 'massaction'] %} |
||||
{% set columnTitle = grid.prefixTitle ~ column.title %} |
||||
<div class="{{ cycle(['odd', 'even'], loop.index) }}"> |
||||
<label>{{ columnTitle|trans }}</label> |
||||
{{ grid_filter(column, grid, false)|raw }} |
||||
</div> |
||||
{% endif %} |
||||
{% endfor %} |
||||
<div class="grid-search-action"> |
||||
<input type="submit" class="btn btn-secondary grid-search-submit" value="{{ 'Search'|trans }}"/> |
||||
<input type="button" class="btn btn-secondary grid-search-reset" value="{{ 'Reset'|trans }}" |
||||
onclick="return {{ grid.hash }}_reset();"/> |
||||
</div> |
||||
</form> |
||||
{% endset %} |
||||
<div class="card"> |
||||
<div class="card-header"> {{ 'Filters' | trans }} </div> |
||||
<div class="card-body"> |
||||
{{ searchContent }} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% 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 %} |
||||
<div class="form-group row"> |
||||
<label for="staticEmail" class="col-sm-2 col-form-label"> |
||||
{{ grid_column_operator(column, grid, op, submitOnChange) }} |
||||
<input type="{{ column.inputType }}" value="{{ to }}" class="grid-filter-input-query-to" name="{{ grid.hash }}[{{ column.id }}][to]" id="{{ grid.hash }}__{{ column.id }}__query__to" {% if submitOnChange is same as (true) %}onkeypress="return {{ grid.hash }}_submitForm(event, this.form);"{% endif%} {{ ( op == btwOperator or op == btweOperator ) ? '': 'style="display: none;" disabled="disabled"' }} /> |
||||
</label> |
||||
<div class="col-sm-10"> |
||||
<input type="{{ column.inputType }}" value="{{ from }}" class="form-control grid-filter-input-query-from" name="{{ grid.hash }}[{{ column.id }}][from]" id="{{ grid.hash }}__{{ column.id }}__query__from" {% if submitOnChange is same as (true) %}onkeypress="return {{ grid.hash }}_submitForm(event, this.form);"{% endif%} {{ ( op == isNullOperator or op == isNotNullOperator ) ? 'style="display: none;" disabled="disabled"' : '' }} /> |
||||
</div> |
||||
</div> |
||||
{% endblock grid_column_filter_type_input %} |
@ -1,135 +0,0 @@ |
||||
{% import "@ChamiloTheme/Macros/box.html.twig" as macro %} |
||||
|
||||
|
||||
{% extends 'APYDataGridBundle::blocks.html.twig' %} |
||||
|
||||
{% block grid_actions %} |
||||
<div class="mass-actions"> |
||||
<div class="btn-group" role="group"> |
||||
{#<a class="btn btn-secondary" href="#" onclick="return {{ grid.hash }}_markVisible(true);">#} |
||||
{#{{ 'Select visible'|trans }}#} |
||||
{#</a>#} |
||||
{#<a class="btn btn-secondary" href="#" onclick="return {{ grid.hash }}_markVisible(false);">#} |
||||
{#{{ 'Deselect visible'|trans }}#} |
||||
{#</a>#} |
||||
<a class="btn btn-secondary" href="#" onclick="return {{ grid.hash }}_markAll(true);"> |
||||
{{ 'Select all'|trans }} |
||||
</a> |
||||
<a class="btn btn-secondary" href="#" onclick="return {{ grid.hash }}_markAll(false);"> |
||||
{{ 'Deselect all'|trans }} |
||||
</a> |
||||
<span class="mass-actions-selected" id="{{ grid.hash }}_mass_action_selected"></span> |
||||
</div> |
||||
{% apply spaceless %} |
||||
<div style="float:right;" class="grid_massactions"> |
||||
{{ 'Action'|trans }} |
||||
<input type="hidden" id="{{ grid.hash }}_mass_action_all" |
||||
name="{{ grid.hash }}[{{ constant('APY\\DataGridBundle\\Grid\\Grid::REQUEST_QUERY_MASS_ACTION_ALL_KEYS_SELECTED') }}]" |
||||
value="0"/> |
||||
<select name="{{ grid.hash }}[{{ constant('APY\\DataGridBundle\\Grid\\Grid::REQUEST_QUERY_MASS_ACTION') }}]"> |
||||
<option value="-1"></option> |
||||
{% for key, massAction in grid.massActions %} |
||||
<option value="{{ key }}">{{ massAction.title|trans }}</option> |
||||
{% endfor %} |
||||
</select> |
||||
<input class="btn btn-secondary" type="submit" value="{{ 'Submit Action'|trans }}"/> |
||||
</div> |
||||
{% endapply %} |
||||
</div> |
||||
{% endblock grid_actions %} |
||||
|
||||
{# Bootstrap changes #} |
||||
{% block grid_column_actions_cell %} |
||||
{% set actions = column.getActionsToRender(row) %} |
||||
<div class="btn-group"> |
||||
{% for action in actions %} |
||||
{% if action.attributes.form_delete is defined and action.attributes.form_delete %} |
||||
<div class="btn-group"> |
||||
<form method="post" action="{{ url(action.route, column.routeParameters(row, action), false) }}"> |
||||
<input type="hidden" name="_method" value="DELETE" /> |
||||
<button type="submit" class="btn btn-danger"> |
||||
{{ action.title|trans }} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
{% else %} |
||||
<a class="btn btn-secondary" |
||||
href="{{ url(action.route, column.routeParameters(row, action), false) }}" |
||||
target="{{ action.target }}"{% if action.confirm %} onclick="return confirm('{{ action.confirmMessage }}')"{% endif %}{% for name, value in action.attributes %} {{ name }}="{{ value }}" {% endfor %}> |
||||
{{ action.title|trans }} |
||||
</a> |
||||
{% endif %} |
||||
{% endfor %} |
||||
</div> |
||||
{% endblock grid_column_actions_cell %} |
||||
|
||||
{% block grid %} |
||||
<div class="col-md-10"> |
||||
<div class="box box-primary"> |
||||
<div class="box-body table-responsive no-padding"> |
||||
{% if grid.totalCount > 0 or grid.isFiltered or grid.noDataMessage is same as(false) %} |
||||
<form id="{{ grid.hash }}" action="{{ grid.routeUrl }}" |
||||
method="post"> |
||||
<div class="grid_header"> |
||||
{% if grid.massActions|length > 0 %} |
||||
{{ grid_actions(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
<div class="grid_body"> |
||||
<table class="table table-bordered table-striped"> |
||||
{% if grid.isTitleSectionVisible %} |
||||
{{ grid_titles(grid) }} |
||||
{% endif %} |
||||
{% if grid.isFilterSectionVisible %} |
||||
{{ grid_filters(grid) }} |
||||
{% endif %} |
||||
{{ grid_rows(grid) }} |
||||
</table> |
||||
</div> |
||||
<div class="grid_footer"> |
||||
{% if grid.isPagerSectionVisible %} |
||||
{{ grid_pager(grid) }} |
||||
{% endif %} |
||||
{% if grid.exports|length > 0 %} |
||||
{{ grid_exports(grid) }} |
||||
{% endif %} |
||||
{% if grid.tweaks|length > 0 %} |
||||
{{ grid_tweaks(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
{% if withjs %} |
||||
{{ grid_scripts(grid) }} |
||||
{% endif %} |
||||
</form> |
||||
{% else %} |
||||
{{ grid_no_data(grid) }} |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock grid %} |
||||
|
||||
{% block grid_search %} |
||||
{% if grid.isFilterSectionVisible %} |
||||
<div class="col-md-2"> |
||||
{% set searchContent %} |
||||
<form id="{{ grid.hash }}_search" action="{{ grid.routeUrl }}" method="post"> |
||||
{% for column in grid.columns %} |
||||
{% if column.isFilterable and column.type not in ['actions', 'massaction'] %} |
||||
{% set columnTitle = grid.prefixTitle ~ column.title %} |
||||
<div class="{{ cycle(['odd', 'even'], loop.index) }}"> |
||||
<label>{{ columnTitle|trans }}</label> |
||||
{{ grid_filter(column, grid, false)|raw }} |
||||
</div> |
||||
{% endif %} |
||||
{% endfor %} |
||||
<div class="grid-search-action"> |
||||
<input type="submit" class="grid-search-submit" value="{{ 'Search'|trans }}"/> |
||||
<input type="button" class="grid-search-reset" value="{{ 'Reset'|trans }}" onclick="return {{ grid.hash }}_reset();"/> |
||||
</div> |
||||
</form> |
||||
{% endset %} |
||||
{{ macro.panel('Filters' | trans, searchContent) }} |
||||
</div> |
||||
{% endif %} |
||||
{% endblock grid_search %} |
Loading…
Reference in new issue