<commit_before>{% macro filter_panel(list, checked_list, name, title, show = 4) %}
    {% spaceless %}
        {% if list is not empty %}
            {% set show = ((checked_list|length) > show ? checked_list|length : show) %}
            {% set unchecked_show = ((checked_list|length) < show ? show - (checked_list|length) : 0) %}
            {% set already_shown = [] %}
            <div class="panel">
                <a href="#{{ name }}-filter" class="filter-category" data-toggle="collapse" aria-expanded="true" aria-controls="{{ name }}-filter">{{ title }}</a>
                <ul class="collapse in" id="{{ name }}-filter">
                {# Checked first #}
                {% for item in list if checked_list is iterable and item.id in checked_list %}
                    {% if loop.index <= show %}
                        {% set already_shown = already_shown|merge([item.id]) %}
                        <li>
                            <input id="checkbox-{{ name }}-{{ item.id }}" checked type="checkbox" value="{{ item.id }}" live-form name="{{ name }}[]" />
                            <label for="checkbox-{{ name }}-{{ item.id }}" class="checkbox-name">{{ item.translate.name is not empty ? item.translate.name : item.name}}</label>
                        </li>
                    {% endif %}
                {% endfor %}
                {% for item in list if item.id not in already_shown %}
                    {% if loop.index <= unchecked_show  %}
                    {% set already_shown = already_shown|merge([item.id]) %}
                    <li>
                        <input id="checkbox-{{ name }}-{{ item.id }}" {% if checked_list is iterable and item.id in checked_list %} checked{% endif %} type="checkbox" value="{{ item.id }}" live-form name="{{ name }}[]" />
                        <label for="checkbox-{{ name }}-{{ item.id }}" class="checkbox-name">{{ item.translate.name is not empty ? item.translate.name : item.name}}</label>
                    </li>
                    {% endif %}
                {% endfor %}
                {% if (list|length) > show %}
                    <li class="collapsed-items">
                        <ul class="collapse" id="{{ name }}-more-filter">
                        {% for item in list if item.id not in already_shown %}
                            <li>
                                <input id="checkbox-{{ name }}-{{ item.id }}" {% if checked_list is iterable and item.id in checked_list %} checked{% endif %} type="checkbox" value="{{ item.id }}" live-form name="{{ name }}[]" />
                                <label for="checkbox-{{ name }}-{{ item.id }}" class="checkbox-name">{{ item.translate.name is not empty ? item.translate.name : item.name}}</label>
                            </li>
                        {% endfor %}
                        </ul>
                        <a href="#{{ name }}-more-filter" class="filter-category-more collapsed" data-toggle="collapse" aria-expanded="false" aria-controls="{{ name }}-more-filter"></a>
                    </li>
                {% endif %}
                </ul>
            </div>
        {% endif %}
    {% endspaceless %}
{% endmacro %}

{% macro sorting_panel(position, pagination) %}
    {% spaceless %}
        <div class="row {{ position }}-content-filter">
            <div class="col-md-6 col-sm-6 col-lg-4 col-md-offset-4 col-sm-offset-3 col-lg-offset-5">
                <div class="row text-center">
                    <ul class="shop-grid-controls">
                        <li>
                            <div class="form-group">
                                <label for="sortind" class="control-label">{{ 'frontend.sort_by'|trans }}
                                    <select name="sorting">
                                        <option>Position</option>
                                        <option>Price</option>
                                        <option>Category</option>
                                        <option>Rating</option>
                                        <option>Color</option>
                                    </select>
                                </label>
                            </div>
                        </li>
                        <li>
                            <div class="sort-block">
                                <div class="sort-button">
                                    <i class="fa fa-arrow-down"></i>
                                    <i class="fa fa-arrow-up"></i>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="entry">
                                <div class="view-button active grid"><i class="fa fa-th"></i></div>
                                <div class="view-button list"><i class="fa fa-list"></i></div>
                            </div>
                        </li>

                    </ul>
                </div>
            </div>
            <div class="col-md-2 col-sm-3 col-lg-3 text-right">
                {{ pagination }}
            </div>
        </div>
    {% endspaceless %}
{% endmacro %}

{% macro product_grid_view(product, grid = 4) %}
    <!-- one product -->
    <div class="col-md-{{ grid }} col-sm-{{ grid }} shop-grid-item " data-factory="{{ product.factory.name }}"><commit_msg>#2120 hide list/grid switcher on products page<commit_after>{% macro filter_panel(list, checked_list, name, title, show = 4) %}
    {% spaceless %}
        {% if list is not empty %}
            {% set show = ((checked_list|length) > show ? checked_list|length : show) %}
            {% set unchecked_show = ((checked_list|length) < show ? show - (checked_list|length) : 0) %}
            {% set already_shown = [] %}
            <div class="panel">
                <a href="#{{ name }}-filter" class="filter-category" data-toggle="collapse" aria-expanded="true" aria-controls="{{ name }}-filter">{{ title }}</a>
                <ul class="collapse in" id="{{ name }}-filter">
                {# Checked first #}
                {% for item in list if checked_list is iterable and item.id in checked_list %}
                    {% if loop.index <= show %}
                        {% set already_shown = already_shown|merge([item.id]) %}
                        <li>
                            <input id="checkbox-{{ name }}-{{ item.id }}" checked type="checkbox" value="{{ item.id }}" live-form name="{{ name }}[]" />
                            <label for="checkbox-{{ name }}-{{ item.id }}" class="checkbox-name">{{ item.translate.name is not empty ? item.translate.name : item.name}}</label>
                        </li>
                    {% endif %}
                {% endfor %}
                {% for item in list if item.id not in already_shown %}
                    {% if loop.index <= unchecked_show  %}
                    {% set already_shown = already_shown|merge([item.id]) %}
                    <li>
                        <input id="checkbox-{{ name }}-{{ item.id }}" {% if checked_list is iterable and item.id in checked_list %} checked{% endif %} type="checkbox" value="{{ item.id }}" live-form name="{{ name }}[]" />
                        <label for="checkbox-{{ name }}-{{ item.id }}" class="checkbox-name">{{ item.translate.name is not empty ? item.translate.name : item.name}}</label>
                    </li>
                    {% endif %}
                {% endfor %}
                {% if (list|length) > show %}
                    <li class="collapsed-items">
                        <ul class="collapse" id="{{ name }}-more-filter">
                        {% for item in list if item.id not in already_shown %}
                            <li>
                                <input id="checkbox-{{ name }}-{{ item.id }}" {% if checked_list is iterable and item.id in checked_list %} checked{% endif %} type="checkbox" value="{{ item.id }}" live-form name="{{ name }}[]" />
                                <label for="checkbox-{{ name }}-{{ item.id }}" class="checkbox-name">{{ item.translate.name is not empty ? item.translate.name : item.name}}</label>
                            </li>
                        {% endfor %}
                        </ul>
                        <a href="#{{ name }}-more-filter" class="filter-category-more collapsed" data-toggle="collapse" aria-expanded="false" aria-controls="{{ name }}-more-filter"></a>
                    </li>
                {% endif %}
                </ul>
            </div>
        {% endif %}
    {% endspaceless %}
{% endmacro %}

{% macro sorting_panel(position, pagination) %}
    {% spaceless %}
        <div class="row {{ position }}-content-filter">
            <div class="col-md-6 col-sm-6 col-lg-4 col-md-offset-4 col-sm-offset-3 col-lg-offset-5">
                <div class="row text-center">
                    <ul class="shop-grid-controls">
                        <li>
                            <div class="form-group">
                                <label for="sortind" class="control-label">{{ 'frontend.sort_by'|trans }}
                                    <select name="sorting">
                                        <option>Position</option>
                                        <option>Price</option>
                                        <option>Category</option>
                                        <option>Rating</option>
                                        <option>Color</option>
                                    </select>
                                </label>
                            </div>
                        </li>
                        <li>
                            <div class="sort-block">
                                <div class="sort-button">
                                    <i class="fa fa-arrow-down"></i>
                                    <i class="fa fa-arrow-up"></i>
                                </div>
                            </div>
                        </li>
                        {# LIST GRID SWITCHER#}
                        {#<li>#}
                            {#<div class="entry">#}
                                {#<div class="view-button active grid"><i class="fa fa-th"></i></div>#}
                                {#<div class="view-button list"><i class="fa fa-list"></i></div>#}
                            {#</div>#}
                        {#</li>#}
                    </ul>
                </div>
            </div>
            <div class="col-md-2 col-sm-3 col-lg-3 text-right">
                {{ pagination }}
            </div>
        </div>
    {% endspaceless %}
{% endmacro %}

{% macro product_grid_view(product, grid = 4) %}
    <!-- one product -->
    <div class="col-md-{{ grid }} col-sm-{{ grid }} shop-grid-item " data-factory="{{ product.factory.name }}">
{'fraction_non_alphanumeric': 0.15572715572715573, 'fraction_numerical': 0.002574002574002574, 'mean_word_length': 1.2017810159886662, 'pattern_counts': {'":': 0, '<': 167, '<?xml version=': 0, '>': 165, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6542366', 'n_tokens_mistral': 2933, 'n_tokens_neox': 2649, 'n_words': 633}