<commit_before>{% import '@Backend/base/macros.html.twig' as macro %}
<table class="table table-striped table-hover responsive nowrap">
  <thead>
  <tr>
    {% set hasFilters = false %}
    {% for column in dataGrid.columns %}
      <th scope="col">
        {% if column.route is null %}
          {% if(column.sortable) %}
            {{ knp_pagination_sortable(dataGrid.paginator, column.label|trans|ucfirst, column.fullName) }}
          {% else %}
            {{ column.label|trans|ucfirst }}
          {% endif %}
          {% if(column.filterable) %}
            {% set hasFilters = true %}
          {% endif %}
        {% endif %}
      </th>
    {% endfor %}
  </tr>
  {% if(hasFilters) %}
    <tr>
      {% for column in dataGrid.columns %}
        <th scope="col">
          {% if(column.filterable) %}
            {{ knp_pagination_filter(dataGrid.paginator, {(column.fullName): column.label}, {button: 'lbl.Filter'}) }}
          {% endif %}
        </th>
      {% endfor %}
    </tr>
  {% endif %}
  </thead>
  <tfoot>
  <tr>
    <td colspan="{{ dataGrid.columns|count }}">
      <div class="d-flex align-self-center justify-content-center">{{ knp_pagination_render(dataGrid.paginator) }}</div>
    </td>
  </tr>
  </tfoot>
  <tbody>
  {% for row in dataGrid.paginator %}
    <tr>
      {% for column in dataGrid.columns %}
        <td>
          {% if column.route is null %}
            {%if column.isHtml %}
              {{ column.value(attribute(row, column.name))|raw }}
            {%else%}
              {{ column.value(attribute(row, column.name)) }}
            {%endif%}
          {% else %}
            <a href="{{ path(column.route, column.routeAttributes(row)) }}"{% if column.class %} class="{{ column.class }}"{% endif %}>{% if column.iconClass %}{{ macro.icon(column.iconClass) }} {% endif %}{{ column.label|trans|ucfirst }}</a>
          {% endif %}
        </td>
      {% endfor %}
    </tr>
  {% endfor %}
  {% if dataGrid.paginator is empty %}
    <tr>
      <td colspan="{{ dataGrid.columns|count }}">{{ (dataGrid.noResultsMessage == 'No results' ? 'lbl.NoResultsFound' : dataGrid.noResultsMessage)|trans|ucfirst }}</td>
    </tr>
  {% endif %}
  </tbody>
</table><commit_msg>Show icons when displaying booleans in datagrids<commit_after>{% import '@Backend/base/macros.html.twig' as macro %}
<table class="table table-striped table-hover responsive nowrap">
  <thead>
  <tr>
    {% set hasFilters = false %}
    {% for column in dataGrid.columns %}
      <th scope="col">
        {% if column.route is null %}
          {% if(column.sortable) %}
            {{ knp_pagination_sortable(dataGrid.paginator, column.label|trans|ucfirst, column.fullName) }}
          {% else %}
            {{ column.label|trans|ucfirst }}
          {% endif %}
          {% if(column.filterable) %}
            {% set hasFilters = true %}
          {% endif %}
        {% endif %}
      </th>
    {% endfor %}
  </tr>
  {% if(hasFilters) %}
    <tr>
      {% for column in dataGrid.columns %}
        <th scope="col">
          {% if(column.filterable) %}
            {{ knp_pagination_filter(dataGrid.paginator, {(column.fullName): column.label}, {button: 'lbl.Filter'}) }}
          {% endif %}
        </th>
      {% endfor %}
    </tr>
  {% endif %}
  </thead>
  <tfoot>
  <tr>
    <td colspan="{{ dataGrid.columns|count }}">
      <div class="d-flex align-self-center justify-content-center">{{ knp_pagination_render(dataGrid.paginator) }}</div>
    </td>
  </tr>
  </tfoot>
  <tbody>
  {% for row in dataGrid.paginator %}
    <tr>
      {% for column in dataGrid.columns %}
        <td>
          {% if column.route is null %}
            {% set columnValue = column.value(attribute(row, column.name)) %}
            {%if column.isHtml %}
              {{ columnValue|raw }}
            {% elseif columnValue is same as true %}
              <span class="text-success">{{ macro.infoTooltip('lbl.Yes'|trans|ucfirst, 'check') }}</span>
            {% elseif columnValue is same as false %}
              <span class="text-danger">{{ macro.infoTooltip('lbl.No'|trans|ucfirst, 'times') }}</span>
            {% else%}
              {{ columnValue }}
            {% endif %}
          {% else %}
            <a href="{{ path(column.route, column.routeAttributes(row)) }}"{% if column.class %} class="{{ column.class }}"{% endif %}>{% if column.iconClass %}{{ macro.icon(column.iconClass) }} {% endif %}{{ column.label|trans|ucfirst }}</a>
          {% endif %}
        </td>
      {% endfor %}
    </tr>
  {% endfor %}
  {% if dataGrid.paginator is empty %}
    <tr>
      <td colspan="{{ dataGrid.columns|count }}">{{ (dataGrid.noResultsMessage == 'No results' ? 'lbl.NoResultsFound' : dataGrid.noResultsMessage)|trans|ucfirst }}</td>
    </tr>
  {% endif %}
  </tbody>
</table>
{'fraction_non_alphanumeric': 0.18386491557223264, 'fraction_numerical': 0.0, 'mean_word_length': 2.2795625427204373, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, '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': '5453830', 'n_tokens_mistral': 1644, 'n_tokens_neox': 1497, 'n_words': 305}