<commit_before>{% extends '@BaseEasyAdmin/default/list.html.twig' %}

{% set requestFilters = app.request.get('filters', {}) %}
{% set _request_parameters = _request_parameters|default({})|merge({
    filters: requestFilters
}) %}

{% block request_parameters_as_hidden %}
  {% for field, value in requestFilters %}
    {% if value is iterable %}
      {% for val in value %}
        <input type="hidden" name="filters[{{ field }}][]" value="{{ val }}">
      {% endfor %}
    {% else %}
      <input type="hidden" name="filters[{{ field }}]" value="{{ value }}">
    {% endif %}
  {% endfor %}
{% endblock %}

{% block content_title_wrapper %}
  <h1 class="title">
    {{ block('content_title') }}
    {# Show applied filters informations #}
    {% if requestFilters|length > 0 %}
      <span class="pull-right">
        <a href="#" id="applied-request-filters-popover" data-toggle="collapse" data-target="#applied-request-filters">
          <i class="fa fa-filter text-warning"></i>
        </a>
      </span>
    {% endif %}
  </h1>
  <div class="pull-right collapse" id="applied-request-filters">
    <dl class="dl-horizontal">
    {% for filterKey, filterValue in requestFilters %}
      <dt>{{ filterKey }}</dt><dd>{{ filterValue is iterable ? filterValue|join(',') : filterValue }}</dd>
    {% endfor %}
    </dl>
  </div>
{% endblock %}

{# Do not display SEARCH form if not granted #}
{% block search_action %}
  {% if is_easyadmin_granted(_entity_config, 'search') %}
    {{ parent() }}
  {% endif %}
{% endblock %}

{# Do not display NEW button if not granted #}
{% block new_action %}
  {% if is_easyadmin_granted(_entity_config, 'new') %}
    {{ parent() }}
  {% endif %}
{% endblock %}

{# Do not display list action items if not granted #}
{% block item_actions %}
  {% set _list_item_actions = _list_item_actions|prune_item_actions(_entity_config, [], item) %}
  {{ parent() }}
{% endblock %}

{# Adds request filters to the search form #}
{% block search_form %}
  {{ block('request_parameters_as_hidden') }}
  {{ parent() }}
{% endblock %}

{% block list_form_filters %}
  {% if _entity_config.list.form_filters is defined and _entity_config.list.form_filters is not empty %}
  {% set list_form_filters = list_form_filters(_entity_config.list.form_filters) %}
  <div id="list-form-filters" class="panel panel-default">
    <div class="panel-heading" role="button" data-toggle="collapse" data-target="#list-form-filters-form">
      <span class="panel-title">{{ 'list_form_filters.heading_title'|trans(_trans_parameters, 'EasyAdminBundle') }}</span>
      <em class="text-info pull-right">
        <small>{{ 'list_form_filters.heading_expandcollapse'|trans(_trans_parameters, 'EasyAdminBundle') }}</small>
      </em>
    </div>
    <form id="list-form-filters-form" class="collapse {{ list_form_filters.vars.submitted ? 'in' }}" method="GET" action="{{ path('easyadmin', _request_parameters) }}">
      <div id="list-form-filters-panel-body" class="panel-body">
        <div class="row" style="display: flex; align-items: stretch;">
          <div class="col-sm-10">
            {% form_theme list_form_filters '@EasyAdmin/form/bootstrap_3_layout.html.twig' %}
            {{ block('request_parameters_as_hidden') }}
            <input type="hidden" name="entity" value="{{ _request_parameters.entity }}">
            <input type="hidden" name="sortField" value="{{ _entity_config.search.sort.field|default(_request_parameters.sortField) }}">
            <input type="hidden" name="sortDirection" value="{{ _entity_config.search.sort.direction|default(_request_parameters.sortDirection) }}">
            <input type="hidden" name="menuIndex" value="{{ _request_parameters.menuIndex }}">
            <input type="hidden" name="submenuIndex" value="{{ _request_parameters.submenuIndex }}">
            <div class="row">
              {% for field in list_form_filters %}
                <div class="col-sm-4">{{ form_row(field) }}</div>
              {% endfor %}
              <div class="clearfix"></div>
            </div>
          </div>
          <div class="col-sm-2">
            <button class="btn btn-primary btn-block" style="height: 100%;" type="submit">
              {{ 'list_form_filters.submit'|trans(_trans_parameters, 'EasyAdminBundle') }}
            </button>
          </div>
          <div class="clearfix"></div>
        </div>
      </div>
    </form>
  </div>
  {% endif %}
{% endblock %}

{# Display FILTERS form if defined #}
{% block main %}
  {{ block('list_form_filters') }}
  {{ parent() }}
{% endblock %}

{% block body_javascript %}
  {{ parent() }}
  {{ include('@EasyAdmin/default/includes/_select2_widget.html.twig') }}
  <script type="text/javascript">
    $(function () {
      createAutoCompleteFields();
    });
  </script>
{% endblock %}<commit_msg>By pressing anywhere on the panel-heading show form filters (#81)<commit_after>{% extends '@BaseEasyAdmin/default/list.html.twig' %}

{% set requestFilters = app.request.get('filters', {}) %}
{% set _request_parameters = _request_parameters|default({})|merge({
    filters: requestFilters
}) %}

{% block request_parameters_as_hidden %}
  {% for field, value in requestFilters %}
    {% if value is iterable %}
      {% for val in value %}
        <input type="hidden" name="filters[{{ field }}][]" value="{{ val }}">
      {% endfor %}
    {% else %}
      <input type="hidden" name="filters[{{ field }}]" value="{{ value }}">
    {% endif %}
  {% endfor %}
{% endblock %}

{% block content_title_wrapper %}
  <h1 class="title">
    {{ block('content_title') }}
    {# Show applied filters informations #}
    {% if requestFilters|length > 0 %}
      <span class="pull-right">
        <a href="#" id="applied-request-filters-popover" data-toggle="collapse" data-target="#applied-request-filters">
          <i class="fa fa-filter text-warning"></i>
        </a>
      </span>
    {% endif %}
  </h1>
  <div class="pull-right collapse" id="applied-request-filters">
    <dl class="dl-horizontal">
    {% for filterKey, filterValue in requestFilters %}
      <dt>{{ filterKey }}</dt><dd>{{ filterValue is iterable ? filterValue|join(',') : filterValue }}</dd>
    {% endfor %}
    </dl>
  </div>
{% endblock %}

{# Do not display SEARCH form if not granted #}
{% block search_action %}
  {% if is_easyadmin_granted(_entity_config, 'search') %}
    {{ parent() }}
  {% endif %}
{% endblock %}

{# Do not display NEW button if not granted #}
{% block new_action %}
  {% if is_easyadmin_granted(_entity_config, 'new') %}
    {{ parent() }}
  {% endif %}
{% endblock %}

{# Do not display list action items if not granted #}
{% block item_actions %}
  {% set _list_item_actions = _list_item_actions|prune_item_actions(_entity_config, [], item) %}
  {{ parent() }}
{% endblock %}

{# Adds request filters to the search form #}
{% block search_form %}
  {{ block('request_parameters_as_hidden') }}
  {{ parent() }}
{% endblock %}

{% block list_form_filters %}
  {% if _entity_config.list.form_filters is defined and _entity_config.list.form_filters is not empty %}
  {% set list_form_filters = list_form_filters(_entity_config.list.form_filters) %}
  <div id="list-form-filters" class="panel panel-default">
    <div class="panel-heading" role="button" data-toggle="collapse" data-target="#list-form-filters-form">
      <span class="panel-title">{{ 'list_form_filters.heading_title'|trans(_trans_parameters, 'EasyAdminBundle') }}</span>
      <em class="text-info pull-right">
        <small>{{ 'list_form_filters.heading_expandcollapse'|trans(_trans_parameters, 'EasyAdminBundle') }}</small>
      </em>
    </div>
    <form id="list-form-filters-form" class="collapse {{ list_form_filters.vars.submitted ? 'in' }}" method="GET" action="{{ path('easyadmin', _request_parameters) }}">
      <div id="list-form-filters-panel-body" class="panel-body">
        <div class="row" style="display: flex; align-items: stretch;">
          <div class="col-sm-10">
            {% form_theme list_form_filters '@EasyAdmin/form/bootstrap_3_layout.html.twig' %}
            {{ block('request_parameters_as_hidden') }}
            <input type="hidden" name="entity" value="{{ _request_parameters.entity }}">
            <input type="hidden" name="sortField" value="{{ _entity_config.search.sort.field|default(_request_parameters.sortField) }}">
            <input type="hidden" name="sortDirection" value="{{ _entity_config.search.sort.direction|default(_request_parameters.sortDirection) }}">
            <input type="hidden" name="menuIndex" value="{{ _request_parameters.menuIndex }}">
            <input type="hidden" name="submenuIndex" value="{{ _request_parameters.submenuIndex }}">
            <div class="row">
              {% for field in list_form_filters %}
                <div class="col-sm-4">{{ form_row(field) }}</div>
              {% endfor %}
              <div class="clearfix"></div>
            </div>
          </div>
          <div class="col-sm-2">
            <button class="btn btn-primary btn-block" style="height: 100%;" type="submit">
              {{ 'list_form_filters.submit'|trans(_trans_parameters, 'EasyAdminBundle') }}
            </button>
          </div>
          <div class="clearfix"></div>
        </div>
      </div>
    </form>
  </div>
  {% endif %}
{% endblock %}

{# Display FILTERS form if defined #}
{% block main %}
  {{ block('list_form_filters') }}
  {{ parent() }}
{% endblock %}

{% block body_javascript %}
  {{ parent() }}
  {{ include('@EasyAdmin/default/includes/_select2_widget.html.twig') }}
  <script type="text/javascript">
    $(function () {
      createAutoCompleteFields();
    });
    $("#list-form-filters [data-toggle][data-target=\"#list-form-filters-form\"] *").click(function() {
      $('#list-form-filters-form').collapse('toggle');
    });
  </script>
{% endblock %}
{'fraction_non_alphanumeric': 0.17929421336316484, 'fraction_numerical': 0.002644157429065392, 'mean_word_length': 3.492462311557789, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 115, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '241100', 'n_tokens_mistral': 3180, 'n_tokens_neox': 2962, 'n_words': 607}