<commit_before>{% import 'macros/actions.html' as actions_macros %}
{% import 'macros/batch_actions.html' as batch_actions_macros %}

{% macro get_list_page(configuration, pager) -%}
{% if pager.get_nb_results() == 0 or pager.get_results() == None %}
<p>{{ gettext('No result') }}</p>
{% else %}
{{ get_table(pager) }}
{% if pager.have_to_paginate %}{{ get_pager(pager=pager, page=page, url=url_for('user.user_list')) }}{% endif %}
{% if pager.is_batch() %}{{ batch_actions_macros.batch_script(id='lw_admin_list_batch_checkbox', class='lw_admin_batch_checkbox') }}{%  endif %}
{% endif %}
{%- endmacro %}

{% macro get_table(pager) -%}
{% set pk = pager.get_pk() %}
{% set elements = pager.get_list_display() %}
{% set cols = elements|count + 2 if pager.is_batch() else elements|count + 1 %}
<table class="table table-hover table-striped">
    <thead>
    <tr>
        {% if pager.is_batch() %}{{ batch_actions_macros.batch_head_row(id='lw_admin_list_batch_checkbox') }}{% endif %}
        {% for element in elements %}
        <th>{{ element['label'] }}</th>
        {% endfor %}
        <th>Actions</th><commit_msg>icon can  be set in display list in table head<commit_after>{% import 'macros/actions.html' as actions_macros %}
{% import 'macros/batch_actions.html' as batch_actions_macros %}

{% macro get_list_page(configuration, pager) -%}
{% if pager.get_nb_results() == 0 or pager.get_results() == None %}
<p>{{ gettext('No result') }}</p>
{% else %}
{{ get_table(pager) }}
{% if pager.have_to_paginate %}{{ get_pager(pager=pager, page=page, url=url_for('user.user_list')) }}{% endif %}
{% if pager.is_batch() %}{{ batch_actions_macros.batch_script(id='lw_admin_list_batch_checkbox', class='lw_admin_batch_checkbox') }}{%  endif %}
{% endif %}
{%- endmacro %}

{% macro get_table(pager) -%}
{% set pk = pager.get_pk() %}
{% set elements = pager.get_list_display() %}
{% set cols = elements|count + 2 if pager.is_batch() else elements|count + 1 %}
<table class="table table-hover table-striped">
    <thead>
    <tr>
        {% if pager.is_batch() %}{{ batch_actions_macros.batch_head_row(id='lw_admin_list_batch_checkbox') }}{% endif %}
        {% for element in elements %}
        <th>{% if element['icon']  %}<i class="{{ element['icon'] }}"></i>{% if not element['only_icon'] %}&nbsp;{% endif %}{% endif %}{% if element['label'] and not element['only_icon'] %}{{ element['label'] }}{% endif %}</th>
        {% endfor %}
        <th>Actions</th>
{'fraction_non_alphanumeric': 0.19959266802443992, 'fraction_numerical': 0.002443991853360489, 'mean_word_length': 4.861575178997613, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '5204618', 'n_tokens_mistral': 958, 'n_tokens_neox': 873, 'n_words': 172}