<commit_before>{% import '@bolt/_macro/_macro.twig' as macro %}
{% import '@bolt/_macro/_buic.twig' as buic %}

{% set modifiable = permissions.create or permissions.edit or permissions.delete or permissions.publish or permissions.depublish %}

{#
 # GROUPNAME: If we have 'grouping', print the row with the groupname.
 #}
{% if not compact and content.group.name is defined and (loop.first or content.group.name != lastgroup) and request('order') == '' %}
    {% if not loop.first %}</tbody>{% endif %}
    <tbody {% if modifiable %}class="sortable"{% endif %}>
    <tr class="grouping">
        <th colspan="{% block listing_columns %}6{% endblock %}">
            <h3 {% if loop.first %}class="first"{% endif %}>
                {% if content.group.name %}
                    {{ content.group.name }}
                {% else %}
                    {{ __('(no group)') }}
                {% endif %}
            </h3>
        </th>
    </tr>
{% endif %}

{#
 # HEADER ROW: Print the header for the first row.
 #}
{% if not compact and (loop.first or (content.group.name is defined and content.group.name != lastgroup) and request('order') == '') %}
    {% set lastgroup = content.group.name|default %}
    {% if "filter" in app.request.query.all|keys %}
        {% set filter = "filter=" ~ app.request.query.all.filter ~ "&" %}
    {% else %}
        {% set filter = "" %}
    {% endif %}
    {% set link = "?" ~ filter ~ "order=" %}

    <tr>
        {% block listing_header %}
            {% if not compact and modifiable %}
                <th class="check hidden-xs"><input type="checkbox" name="checkRow" title="{{ __('Select all') }}" /></th>
            {% else %}
                <th style="margin: 0; padding: 0;"></th>
            {% endif %}

            <th class="hidden-xs">
                <a href="{{ link }}{% if request('order') == 'id' %}-{% endif %}id">{{ __('Id') }}</a>
            </th>

            <th style="width:80%">
                <a href="{{ link }}{% if request('order') == content.TitleColumnName()|first %}-{% endif %}{{ content.TitleColumnName()|first }}">
                    {{ __('Title') }} / {{ __('Excerpt') }}
                </a>
            </th>

            <th>&nbsp;</th>

            <th class="username hidden-xs">
                <a href="{{ link }}{% if request('order') == "datecreated" %}-{% endif %}datecreated">{{ __('Meta') }}</a>
            </th>

            <th>
                <a href="?">{{ __('Actions') }}</a>
            </th>
        {% endblock %}
    </tr>
{% endif %}

{#
 # DATA ROW
 #}
<tr {% if content.status!='published' %}class="dim"{% endif %}{% if not compact and modifiable %} id="item_{{ content.id }}"{% endif %}>

    {### BLOCK: ID ###}
    {% block listing_id %}
        {% if not compact and permissions.delete %}
            <td class="check hidden-xs"><input type="checkbox" name="checkRow"></td>
        {% else %}
            <td style="margin: 0; padding: 0;"></td>
        {% endif %}
        <td class="id hidden-xs">№ {{ content.id }}</td>
    {% endblock %}

    {### BLOCK: CONTENT ###}<commit_msg>Precalculate header order refs<commit_after>{% import '@bolt/_macro/_macro.twig' as macro %}
{% import '@bolt/_macro/_buic.twig' as buic %}

{% set modifiable = permissions.create or permissions.edit or permissions.delete or permissions.publish or permissions.depublish %}

{#
 # GROUPNAME: If we have 'grouping', print the row with the groupname.
 #}
{% if not compact and content.group.name is defined and (loop.first or content.group.name != lastgroup) and request('order') == '' %}
    {% if not loop.first %}</tbody>{% endif %}
    <tbody {% if modifiable %}class="sortable"{% endif %}>
    <tr class="grouping">
        <th colspan="{% block listing_columns %}6{% endblock %}">
            <h3 {% if loop.first %}class="first"{% endif %}>
                {% if content.group.name %}
                    {{ content.group.name }}
                {% else %}
                    {{ __('(no group)') }}
                {% endif %}
            </h3>
        </th>
    </tr>
{% endif %}

{#
 # HEADER ROW: Print the header for the first row.
 #}
{% if not compact and (loop.first or (content.group.name is defined and content.group.name != lastgroup) and request('order') == '') %}
    {% set lastgroup = content.group.name|default %}
    {% if "filter" in app.request.query.all|keys %}
        {% set filter = "filter=" ~ app.request.query.all.filter ~ "&" %}
    {% else %}
        {% set filter = "" %}
    {% endif %}
    {% set link = "?" ~ filter ~ "order=" %}

    <tr>
        {% block listing_header %}
            {% set column_title = content.TitleColumnName()|first %}
            {% set href_sort = link ~ (request('order') == column_title ? '-' : '') ~ column_title %}
            {% set href_meta = link ~ (request('order') == 'datecreated' ? '-' : '') ~ 'datecreated' %}

            {% if not compact and modifiable %}
                <th class="check hidden-xs"><input type="checkbox" name="checkRow" title="{{ __('Select all') }}" /></th>
            {% else %}
                <th style="margin: 0; padding: 0;"></th>
            {% endif %}

            <th class="hidden-xs">
                <a href="{{ link }}{% if request('order') == 'id' %}-{% endif %}id">{{ __('Id') }}</a>
            </th>

            <th style="width:80%">
                <a href="{{ href_sort }}">{{ __('Title') }} / {{ __('Excerpt') }}</a>
            </th>

            <th>&nbsp;</th>

            <th class="username hidden-xs">
                <a href="{{ href_meta }}">{{ __('Meta') }}</a>
            </th>

            <th>
                <a href="?">{{ __('Actions') }}</a>
            </th>
        {% endblock %}
    </tr>
{% endif %}

{#
 # DATA ROW
 #}
<tr {% if content.status!='published' %}class="dim"{% endif %}{% if not compact and modifiable %} id="item_{{ content.id }}"{% endif %}>

    {### BLOCK: ID ###}
    {% block listing_id %}
        {% if not compact and permissions.delete %}
            <td class="check hidden-xs"><input type="checkbox" name="checkRow"></td>
        {% else %}
            <td style="margin: 0; padding: 0;"></td>
        {% endif %}
        <td class="id hidden-xs">№ {{ content.id }}</td>
    {% endblock %}

    {### BLOCK: CONTENT ###}
{'fraction_non_alphanumeric': 0.2043900111340862, 'fraction_numerical': 0.002863050739621441, 'mean_word_length': 2.1067193675889326, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 85, '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': '5608085', 'n_tokens_mistral': 2097, 'n_tokens_neox': 1843, 'n_words': 488}