<commit_before>{#
 # This file is part of the CRUDlex package.
 #
 # (c) <NAME> <<EMAIL>>
 #
 # For the full copyright and license information, please view the LICENSE
 # file that was distributed with this source code.
 #}

{%extends layout %}

{% block content %}
    {% set fields = definition.getListFieldNames() %}
    <a id="crudBtnNew" href="{{ app.url_generator.generate('crudCreate', {'entity': crudEntity}) }}" class="btn btn-success btn-crudlex">{{ 'crudlex.button.new'|trans }}</a>


    {% if filter %}

        <a class="btn btn-success" data-toggle="collapse" href="#collapseFilter" aria-expanded="false" aria-controls="collapseFilter">{{ 'crudlex.list.button.filter'|trans }}</a>
        <div class="collapse {{ filterActive ? 'in' : '' }}" id="collapseFilter">
            <div class="well">
                <form role="form" method="GET" action="{{ app.url_generator.generate('crudList', {'entity': crudEntity}) }}">
                    {% for filterField, filterValue in filter %}
                        {% set type = crudData.getDefinition().getType(filterField) %}
                        {% if type == 'bool' %}
                            {% include app.crud.getTemplate(app, 'template', 'fieldLabel', crudEntity) with {
                                field: filterField,
                                definition: definition,
                                annotations: false
                            } only %}
                            <select class="form-control" id="{{ filterField }}" name="{{ 'crudFilter' ~ filterField }}">
                                {% set values = ['', 'true', 'false'] %}
                                {% for setValue in values %}
                                    <option value="{{ setValue }}" {% if filterValue and setValue == filterValue %}selected="selected" {% endif %}>{{ setValue }}</option>
                                {% endfor %}
                            </select>
                        {% else %}
                            <div class="form-group">
                                {% if type == 'file' %}
                                    {% set type = 'text' %}
                                {% endif %}
                                {% include app.crud.getTemplate(app, 'template', type ~ 'Field', crudEntity) with {
                                    field: filterField,
                                    fieldNamePrefix: 'crudFilter',
                                    crudData: crudData,
                                    value: filterValue,
                                    annotations: false,
                                    crudEntity: crudEntity
                                } only %}
                            </div>
                        {% endif %}
                    {% endfor %}
                    <button type="submit" id="crudBtnSubmit" class="btn btn-default btn-success">{{ 'crudlex.list.button.doFilter'|trans }}</button>
                </form>
            </div>
        </div>

    {% endif %}


    <div class="table-responsive">
    <table class="table table-striped">

        <tr>
            {% for field in fields %}
                <th>{{ definition.getFieldLabel(field) }}</th>
            {% endfor %}
            <th>Action</th>
        </tr>

        {% for entity in entities %}<commit_msg>added a responsive class<commit_after>{#
 # This file is part of the CRUDlex package.
 #
 # (c) <NAME> <<EMAIL>>
 #
 # For the full copyright and license information, please view the LICENSE
 # file that was distributed with this source code.
 #}

{%extends layout %}

{% block content %}
    {% set fields = definition.getListFieldNames() %}
    <a id="crudBtnNew" href="{{ app.url_generator.generate('crudCreate', {'entity': crudEntity}) }}" class="btn btn-success btn-crudlex">{{ 'crudlex.button.new'|trans }}</a>


    {% if filter %}

        <a class="btn btn-success" data-toggle="collapse" href="#collapseFilter" aria-expanded="false" aria-controls="collapseFilter">{{ 'crudlex.list.button.filter'|trans }}</a>
        <div class="collapse {{ filterActive ? 'in' : '' }}" id="collapseFilter">
            <div class="well">
                <form role="form" method="GET" action="{{ app.url_generator.generate('crudList', {'entity': crudEntity}) }}">
                    {% for filterField, filterValue in filter %}
                        {% set type = crudData.getDefinition().getType(filterField) %}
                        {% if type == 'bool' %}
                            {% include app.crud.getTemplate(app, 'template', 'fieldLabel', crudEntity) with {
                                field: filterField,
                                definition: definition,
                                annotations: false
                            } only %}
                            <select class="form-control" id="{{ filterField }}" name="{{ 'crudFilter' ~ filterField }}">
                                {% set values = ['', 'true', 'false'] %}
                                {% for setValue in values %}
                                    <option value="{{ setValue }}" {% if filterValue and setValue == filterValue %}selected="selected" {% endif %}>{{ setValue }}</option>
                                {% endfor %}
                            </select>
                        {% else %}
                            <div class="form-group">
                                {% if type == 'file' %}
                                    {% set type = 'text' %}
                                {% endif %}
                                {% include app.crud.getTemplate(app, 'template', type ~ 'Field', crudEntity) with {
                                    field: filterField,
                                    fieldNamePrefix: 'crudFilter',
                                    crudData: crudData,
                                    value: filterValue,
                                    annotations: false,
                                    crudEntity: crudEntity
                                } only %}
                            </div>
                        {% endif %}
                    {% endfor %}
                    <button type="submit" id="crudBtnSubmit" class="btn btn-default btn-success">{{ 'crudlex.list.button.doFilter'|trans }}</button>
                </form>
            </div>
        </div>

    {% endif %}


    <div class="table-responsive table-wrapper">
    <table class="table table-striped">

        <tr>
            {% for field in fields %}
                <th>{{ definition.getFieldLabel(field) }}</th>
            {% endfor %}
            <th>Action</th>
        </tr>

        {% for entity in entities %}
{'fraction_non_alphanumeric': 0.134257189688571, 'fraction_numerical': 0.0, 'mean_word_length': 1.3208852005532503, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4291108', 'n_tokens_mistral': 1746, 'n_tokens_neox': 1564, 'n_words': 388}