<commit_before>{#

This file is part of the Networking package.

(c) net working AG <<EMAIL>>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% extends base_template %}


{% block actions %}
    {% include 'NetworkingInitCmsBundle:Core:create_button.html.twig' %}
{% endblock %}

{% block side_menu %}{{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active'}, 'list') }}{% endblock %}

{% block list_table %}
    {% if not  app.request.isxmlhttprequest %}
        <div id="objectList">
    {% endif %}
    {% set batchactions = admin.batchactions %}
    {% if admin.datagrid.results|length > 0 %}
        <form action="{{ admin.generateUrl('batch', admin.filterParameters) }}" method="POST">
            <table class="table table-hover table-compact">
                {% block table_header %}
                    <thead>
                    <tr>
                        {% for field_description in admin.list.elements %}
                            {% if field_description.getOption('code') == '_batch' and batchactions|length > 0 %}
                                <th class="sonata-ba-list-field-header sonata-ba-list-field-header-batch">
                                    <input type="checkbox" id="list_batch_checkbox"/>
                                </th>
                            {% else %}
                                {% set sortable = false %}
                                {% if field_description.options.sortable is defined and field_description.options.sortable %}
                                    {% set sortable             = true %}
                                    {% set current              = admin.datagrid.values._sort_by == field_description %}
                                    {% set sort_parameters      = admin.modelmanager.sortparameters(field_description, admin.datagrid) %}
                                    {% set sort_active_class    = current ? 'sonata-ba-list-field-order-active' : '' %}
                                    {% set sort_by              = current ? admin.datagrid.values._sort_order : field_description.options._sort_order %}
                                {% endif %}

                                {% spaceless %}
                                    <th class="sonata-ba-list-field-header-{{ field_description.type }} {% if sortable %} sonata-ba-list-field-header-order-{{ sort_by|lower }} {{ sort_active_class }}{% endif %}">
                                        {% if sortable %}<a
                                            href="{{ admin.generateUrl('list', sort_parameters) }}">{% endif %}
                                        {{ admin.trans(field_description.label) }}
                                        {% if sortable %}</a>{% endif %}
                                    </th>
                                {% endspaceless %}
                            {% endif %}
                        {% endfor %}
                    </tr>
                    </thead>
                {% endblock %}

                {% block table_body %}
                    <tbody>
                    {% for object in admin.datagrid.results %}
                        <tr>
                            {% for field_description in admin.list.elements %}
                                {{ object|render_list_element(field_description) }}
                            {% endfor %}
                        </tr>
                    {% endfor %}
                    </tbody>
                {% endblock %}

                {% block table_footer %}
                    <tfoot>
                    <tr>
                        <th colspan="{{ admin.list.elements|length - 1 }}">
                            {{ block('batch') }}
                        </th>

                        <th class="align-right">
                            {% transchoice admin.datagrid.pager.nbresults with {'%count%': admin.datagrid.pager.nbresults} from 'SonataAdminBundle' %}
                            list_results_count{% endtranschoice %}
                        </th>
                    </tr>

                    {% if admin.datagrid.pager.haveToPaginate() %}
                        <tr>
                            <td colspan="{{ admin.list.elements|length }}">
                                {{ admin.datagrid.pager.page }} / {{ admin.datagrid.pager.lastpage }}
                                <div class="pagination pagination-centered">
                                    <ul>

                                        {% if admin.datagrid.pager.page != 1 %}
                                            <li>
                                                <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, 1)) }}"
                                                   title="{{ 'link_first_pager'|trans({}, 'SonataAdminBundle') }}">&laquo;</a>
                                            </li>
                                        {% endif %}

                                        {% if admin.datagrid.pager.page != admin.datagrid.pager.previouspage %}
                                            <li>
                                                <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.previouspage)) }}"
                                                   title="{{ 'link_previous_pager'|trans({}, 'SonataAdminBundle') }}">&lsaquo;</a>
                                            </li>
                                        {% endif %}

                                        {# Set the number of pages to display in the pager #}
                                        {% for page in admin.datagrid.pager.getLinks() %}
                                            {% if page == admin.datagrid.pager.page %}
                                                <li class="active"><a
                                                        href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, page)) }}">{{ page }}</a>
                                                </li>
                                            {% else %}
                                                <li>
                                                    <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, page)) }}">{{ page }}</a>
                                                </li>
                                            {% endif %}
                                        {% endfor %}

                                        {% if admin.datagrid.pager.page != admin.datagrid.pager.nextpage %}
                                            <li>
                                                <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.nextpage)) }}"
                                                   title="{{ 'link_next_pager'|trans({}, 'SonataAdminBundle') }}">&rsaquo;</a>
                                            </li>
                                        {% endif %}

                                        {% if admin.datagrid.pager.page != admin.datagrid.pager.lastpage %}
                                            <li>
                                                <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.lastpage)) }}"
                                                   title="{{ 'link_last_pager'|trans({}, 'SonataAdminBundle') }}">&raquo;</a>
                                            </li>
                                        {% endif %}

                                    </ul>
                                </div>

                            </td>
                        </tr>
                    {% endif %}
                    </tfoot>
                {% endblock %}
            </table>
            {% if admin.isGranted("EXPORT") and admin.getExportFormats()|length %}
                <p> {{ "label_export_download"|trans({}, "NetworkingInitCmsBundle") }}:
                    {% for format in admin.getExportFormats() %}
                            <a
                            href="{{ admin.generateUrl('export', admin.modelmanager.paginationparameters(admin.datagrid, 0) + {'format' : format}) }}">{{ format }}</a>{% if not loop.last %},{% endif %}
                    {% endfor %}
                </p>
            {% endif %}
        </form>
    {% else %}
        <p class="notice">
            {{ 'no_result'|trans({}, 'SonataAdminBundle') }}
        </p>
    {% endif %}

    {% if not  app.request.isxmlhttprequest %}
            </div>
        {% endif %}
{% endblock %}


{% block list_filters %}
    {% if admin.datagrid.filters and not app.request.isxmlhttprequest %}

        <form action="{{ admin.generateUrl('list') }}" method="GET" class="filters">

            {% set filter_main = '' %}
            {% set filter_hidden = '' %}
            {% for filter in admin.datagrid.filters %}

                {% if filter.options.hidden is not defined  or (filter.options.hidden == false) %}
                    {% set filter_main %}
                    {{ filter_main }}
                    {{ form_widget(form.children[filter.formName].children['type'], {'attr':{'class': 'input-medium' }}) }}
                    {{ form_widget(form.children[filter.formName].children['value'], {'attr':{'placeholder': admin.trans(filter.label), 'class': 'input-medium'} }) }}
                    {% endset %}
                {% else %}
                    {% set filter_hidden %}
                    {{ filter_hidden }}
                    <label class="filter {{ filter.isActive ? 'active' : 'inactive' }}"> {{ admin.trans(filter.label) }}</label>
                    {{ form_widget(form.children[filter.formName].children['type'], {'attr':{'class': 'input-medium' }}) }}
                    {{ form_widget(form.children[filter.formName].children['value'], {'attr':{'class': 'input-medium' }}) }}
                    {% endset %}
                {% endif %}
            {% endfor %}
            {#<strong>{{ 'label_filters'|trans({}, admin.translationDomain) }}</strong>#}

            <div>
                <div class="pull-left form-inline ">
                    <strong>{{ 'info.filter'|trans({'%admin_label%': admin.label}, 'NetworkingInitCmsBundle') }}</strong>
                    {{ filter_main }}
                    <input type="hidden" name="filter[_page]" id="filter__page" value="1"/>
                    {% set foo = form.children['_page'].setRendered() %}
                    {{ form_rest(form) }}

                    <input type="submit" class="btn btn-small"
                           value="{{ 'btn_filter'|trans({}, 'NetworkingInitCmsBundle') }}"/>

                    <a href="{{ admin.generateUrl('list', {filters: 'reset'}) }}" class="link-underlined">
                        {{ 'link_reset_filter'|trans({'%admin_label%': admin.label}, 'NetworkingInitCmsBundle') }}</a>
                    {% if filter_hidden %}
                        <a data-toggle="collapse" data-target="#hidden_filters" id="filter_toggle" class="filter-close">
                            {{ 'link.show_more_filters'|trans({}, 'NetworkingInitCmsBundle') }}
                        </a>
                    {% endif %}
                </div>
                <div class="clearfix">&nbsp;</div>
            </div>


            <div id="hidden_filters" class="collapse">
                {% if filter_hidden != '' %}
                    {# add div with hidden / show function #}
                    {{ filter_hidden }}

                {% endif %}
            </div>

        </form>
    {% endif %}
{% endblock %}

{% block batch %}
    {% if batchactions|length > 0 %}


        <script type="text/javascript">
            {% block batch_javascript %}
            jQuery(document).ready(function ($) {
                $('#list_batch_checkbox').click(function () {
                    $(this).closest('table').find("td input[type='checkbox']").attr('checked', $(this).is(':checked')).parent().parent().toggleClass('sonata-ba-list-row-selected', $(this).is(':checked'));
                });
                $("td.sonata-ba-list-field-batch input[type='checkbox']").change(function () {
                    $(this).parent().parent().toggleClass('sonata-ba-list-row-selected', $(this).is(':checked'));
                });
            });
            {% endblock %}
        </script>

        <div class="actions initcms-list-actions">
            {% block batch_actions %}
                <input type="checkbox" name="all_elements"/>
                <select name="action">
                    {% for action, options in batchactions %}
                        <option value="{{ action }}">{{ options.label }}</option>
                    {% endfor %}
                </select>



                <input type="submit" class="btn btn-primary btn-mini batch-dialog-link"
                       value="{{ 'btn_batch'|trans({}, 'SonataAdminBundle') }}"/><commit_msg>make checkbox select all checkboxes<commit_after>{#

This file is part of the Networking package.

(c) net working AG <<EMAIL>>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}

{% extends base_template %}


{% block actions %}
    {% include 'NetworkingInitCmsBundle:Core:create_button.html.twig' %}
{% endblock %}

{% block side_menu %}{{ knp_menu_render(admin.sidemenu(action), {'currentClass' : 'active'}, 'list') }}{% endblock %}

{% block list_table %}
    {% if not  app.request.isxmlhttprequest %}
        <div id="objectList">
    {% endif %}
    {% set batchactions = admin.batchactions %}
    {% if admin.datagrid.results|length > 0 %}
        <form action="{{ admin.generateUrl('batch', admin.filterParameters) }}" method="POST">
            <table class="table table-hover table-compact">
                {% block table_header %}
                    <thead>
                    <tr>
                        {% for field_description in admin.list.elements %}
                            {% if field_description.getOption('code') == '_batch' and batchactions|length > 0 %}
                                <th class="sonata-ba-list-field-header sonata-ba-list-field-header-batch">
                                    <input type="checkbox" id="list_batch_checkbox"/>
                                </th>
                            {% else %}
                                {% set sortable = false %}
                                {% if field_description.options.sortable is defined and field_description.options.sortable %}
                                    {% set sortable             = true %}
                                    {% set current              = admin.datagrid.values._sort_by == field_description %}
                                    {% set sort_parameters      = admin.modelmanager.sortparameters(field_description, admin.datagrid) %}
                                    {% set sort_active_class    = current ? 'sonata-ba-list-field-order-active' : '' %}
                                    {% set sort_by              = current ? admin.datagrid.values._sort_order : field_description.options._sort_order %}
                                {% endif %}

                                {% spaceless %}
                                    <th class="sonata-ba-list-field-header-{{ field_description.type }} {% if sortable %} sonata-ba-list-field-header-order-{{ sort_by|lower }} {{ sort_active_class }}{% endif %}">
                                        {% if sortable %}<a
                                            href="{{ admin.generateUrl('list', sort_parameters) }}">{% endif %}
                                        {{ admin.trans(field_description.label) }}
                                        {% if sortable %}</a>{% endif %}
                                    </th>
                                {% endspaceless %}
                            {% endif %}
                        {% endfor %}
                    </tr>
                    </thead>
                {% endblock %}

                {% block table_body %}
                    <tbody>
                    {% for object in admin.datagrid.results %}
                        <tr>
                            {% for field_description in admin.list.elements %}
                                {{ object|render_list_element(field_description) }}
                            {% endfor %}
                        </tr>
                    {% endfor %}
                    </tbody>
                {% endblock %}

                {% block table_footer %}
                    <tfoot>
                    <tr>
                        <th colspan="{{ admin.list.elements|length - 1 }}">
                            {{ block('batch') }}
                        </th>

                        <th class="align-right">
                            {% transchoice admin.datagrid.pager.nbresults with {'%count%': admin.datagrid.pager.nbresults} from 'SonataAdminBundle' %}
                            list_results_count{% endtranschoice %}
                        </th>
                    </tr>

                    {% if admin.datagrid.pager.haveToPaginate() %}
                        <tr>
                            <td colspan="{{ admin.list.elements|length }}">
                                {{ admin.datagrid.pager.page }} / {{ admin.datagrid.pager.lastpage }}
                                <div class="pagination pagination-centered">
                                    <ul>

                                        {% if admin.datagrid.pager.page != 1 %}
                                            <li>
                                                <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, 1)) }}"
                                                   title="{{ 'link_first_pager'|trans({}, 'SonataAdminBundle') }}">&laquo;</a>
                                            </li>
                                        {% endif %}

                                        {% if admin.datagrid.pager.page != admin.datagrid.pager.previouspage %}
                                            <li>
                                                <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.previouspage)) }}"
                                                   title="{{ 'link_previous_pager'|trans({}, 'SonataAdminBundle') }}">&lsaquo;</a>
                                            </li>
                                        {% endif %}

                                        {# Set the number of pages to display in the pager #}
                                        {% for page in admin.datagrid.pager.getLinks() %}
                                            {% if page == admin.datagrid.pager.page %}
                                                <li class="active"><a
                                                        href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, page)) }}">{{ page }}</a>
                                                </li>
                                            {% else %}
                                                <li>
                                                    <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, page)) }}">{{ page }}</a>
                                                </li>
                                            {% endif %}
                                        {% endfor %}

                                        {% if admin.datagrid.pager.page != admin.datagrid.pager.nextpage %}
                                            <li>
                                                <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.nextpage)) }}"
                                                   title="{{ 'link_next_pager'|trans({}, 'SonataAdminBundle') }}">&rsaquo;</a>
                                            </li>
                                        {% endif %}

                                        {% if admin.datagrid.pager.page != admin.datagrid.pager.lastpage %}
                                            <li>
                                                <a href="{{ admin.generateUrl('list', admin.modelmanager.paginationparameters(admin.datagrid, admin.datagrid.pager.lastpage)) }}"
                                                   title="{{ 'link_last_pager'|trans({}, 'SonataAdminBundle') }}">&raquo;</a>
                                            </li>
                                        {% endif %}

                                    </ul>
                                </div>

                            </td>
                        </tr>
                    {% endif %}
                    </tfoot>
                {% endblock %}
            </table>
            {% if admin.isGranted("EXPORT") and admin.getExportFormats()|length %}
                <p> {{ "label_export_download"|trans({}, "NetworkingInitCmsBundle") }}:
                    {% for format in admin.getExportFormats() %}
                            <a
                            href="{{ admin.generateUrl('export', admin.modelmanager.paginationparameters(admin.datagrid, 0) + {'format' : format}) }}">{{ format }}</a>{% if not loop.last %},{% endif %}
                    {% endfor %}
                </p>
            {% endif %}
        </form>
    {% else %}
        <p class="notice">
            {{ 'no_result'|trans({}, 'SonataAdminBundle') }}
        </p>
    {% endif %}

    {% if not  app.request.isxmlhttprequest %}
            </div>
        {% endif %}
{% endblock %}


{% block list_filters %}
    {% if admin.datagrid.filters and not app.request.isxmlhttprequest %}

        <form action="{{ admin.generateUrl('list') }}" method="GET" class="filters">

            {% set filter_main = '' %}
            {% set filter_hidden = '' %}
            {% for filter in admin.datagrid.filters %}

                {% if filter.options.hidden is not defined  or (filter.options.hidden == false) %}
                    {% set filter_main %}
                    {{ filter_main }}
                    {{ form_widget(form.children[filter.formName].children['type'], {'attr':{'class': 'input-medium' }}) }}
                    {{ form_widget(form.children[filter.formName].children['value'], {'attr':{'placeholder': admin.trans(filter.label), 'class': 'input-medium'} }) }}
                    {% endset %}
                {% else %}
                    {% set filter_hidden %}
                    {{ filter_hidden }}
                    <label class="filter {{ filter.isActive ? 'active' : 'inactive' }}"> {{ admin.trans(filter.label) }}</label>
                    {{ form_widget(form.children[filter.formName].children['type'], {'attr':{'class': 'input-medium' }}) }}
                    {{ form_widget(form.children[filter.formName].children['value'], {'attr':{'class': 'input-medium' }}) }}
                    {% endset %}
                {% endif %}
            {% endfor %}
            {#<strong>{{ 'label_filters'|trans({}, admin.translationDomain) }}</strong>#}

            <div>
                <div class="pull-left form-inline ">
                    <strong>{{ 'info.filter'|trans({'%admin_label%': admin.label}, 'NetworkingInitCmsBundle') }}</strong>
                    {{ filter_main }}
                    <input type="hidden" name="filter[_page]" id="filter__page" value="1"/>
                    {% set foo = form.children['_page'].setRendered() %}
                    {{ form_rest(form) }}

                    <input type="submit" class="btn btn-small"
                           value="{{ 'btn_filter'|trans({}, 'NetworkingInitCmsBundle') }}"/>

                    <a href="{{ admin.generateUrl('list', {filters: 'reset'}) }}" class="link-underlined">
                        {{ 'link_reset_filter'|trans({'%admin_label%': admin.label}, 'NetworkingInitCmsBundle') }}</a>
                    {% if filter_hidden %}
                        <a data-toggle="collapse" data-target="#hidden_filters" id="filter_toggle" class="filter-close">
                            {{ 'link.show_more_filters'|trans({}, 'NetworkingInitCmsBundle') }}
                        </a>
                    {% endif %}
                </div>
                <div class="clearfix">&nbsp;</div>
            </div>


            <div id="hidden_filters" class="collapse">
                {% if filter_hidden != '' %}
                    {# add div with hidden / show function #}
                    {{ filter_hidden }}

                {% endif %}
            </div>

        </form>
    {% endif %}
{% endblock %}

{% block batch %}
    {% if batchactions|length > 0 %}


        <script type="text/javascript">
            {% block batch_javascript %}
            jQuery(document).ready(function ($) {
                $('#list_batch_checkbox').click(function () {
                    $(this).closest('table').find("td input[type='checkbox']").attr('checked', $(this).is(':checked')).parent().parent().toggleClass('sonata-ba-list-row-selected', $(this).is(':checked'));
                });
                $("div.initcms-list-actions input[type='checkbox']").change(function () {
                    $(this).closest('table').find("td input[type='checkbox']").attr('checked', $(this).is(':checked')).parent().parent().toggleClass('sonata-ba-list-row-selected', $(this).is(':checked'));
                });
            });
            {% endblock %}
        </script>

        <div class="actions initcms-list-actions">
            {% block batch_actions %}
                <input type="checkbox" name="all_elements"/>
                <select name="action">
                    {% for action, options in batchactions %}
                        <option value="{{ action }}">{{ options.label }}</option>
                    {% endfor %}
                </select>



                <input type="submit" class="btn btn-primary btn-mini batch-dialog-link"
                       value="{{ 'btn_batch'|trans({}, 'SonataAdminBundle') }}"/>
{'fraction_non_alphanumeric': 0.139037837021373, 'fraction_numerical': 0.0006041839740200891, 'mean_word_length': 1.1834446368208427, 'pattern_counts': {'":': 0, '<': 203, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 200, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6069429', 'n_tokens_mistral': 6617, 'n_tokens_neox': 5873, 'n_words': 1076}