<?xml version="1.0"?>
<t name="Product Attribute Filters Form" t-name="website_sale.product_attribute_filters_form">
        <form t-attf-class="js_attributes {{('accordion accordion-flush d-flex flex-column ' + ('border-bottom' if attributes else '')) if isMobile else 'position-relative mb-2'}}" method="get" t-att-action="keep(attribute_values=0, tags=0)">
            <t t-set="visible_attributes" t-value="len([a for a in attributes if a.value_ids and len(a.value_ids) &gt; 1])"/>

            <t t-foreach="attributes" t-as="a">
                <t t-cache="a,attrib_set,visible_attributes,isMobile">
                    <t t-set="_status" t-value="'inactive'"/>
                    <t t-foreach="a.value_ids" t-as="v" t-if="v.id in attrib_set" t-set="_status" t-value="'active'"/>
                    <div t-if="a.value_ids and len(a.value_ids) &gt; 1" t-attf-class="accordion-item {{('border-top-0 ' + ('order-1' if _status == 'active' else 'order-2')) if isMobile else 'nav-item mb-1 rounded-0'}}">
                        <h2 t-if="isMobile" class="accordion-header mb-0" t-attf-id="o_wsale_offcanvas_attribute_{{a.id}}_header">
                            <button t-attf-class="o_wsale_offcanvas_title accordion-button rounded-0 {{'collapsed' if not attrib_values and visible_attributes &gt;= 4 else ''}}" type="button" t-att-data-status="_status" data-bs-toggle="collapse" t-attf-data-bs-target="#o_wsale_offcanvas_attribute_{{a.id}}" t-att-aria-expanded="(_status == 'active' or visible_attributes &lt; 4) and 'True' or 'False'" t-attf-aria-controls="o_wsale_offcanvas_attribute_{{a.id}}">
                                <b t-out="a.name"/>
                            </button>
                        </h2>
                        <h6 t-else="" class="mb-3">
                            <b class="d-none d-lg-block" t-field="a.name"/>
                        </h6>
                        <div t-attf-id="{{'o_wsale_offcanvas_attribute_' + str(a.id) if isMobile else 'o_products_attributes_' + str(a.id)}}" t-attf-class="{{'accordion-collapse collapse ' + ('show' if _status == 'active' or visible_attributes &lt; 4 else '') if isMobile else ''}}">
                            <div t-attf-class="{{'accordion-body pt-0' if isMobile else ''}}">
                                <div t-if="a.display_type == 'select'" t-attf-class="{{'my-2' if isMobile else 'mb-3'}}">
                                    <t t-call="website_sale.filter_select_attributes"/>
                                </div>
                                <div t-elif="a.display_type == 'color'" t-attf-class="{{'pt-1 pb-3' if isMobile else 'mb-3'}}">
                                    <t t-call="website_sale.filter_color_attributes"/>
                                </div>
                                <div t-elif="a.display_type in ('radio', 'multi')" t-attf-class="{{'list-group list-group-flush' if isMobile else 'flex-column mb-3'}}">
                                    <t t-call="website_sale.filter_radio_and_multi_attributes">
                                        <t t-set="isMobile" t-value="isMobile"/>
                                    </t>
                                </div>
                                <div t-elif="a.display_type == 'pills'" t-attf-class="btn-group-toggle {{'my-2' if isMobile else 'mb-3'}}" data-bs-toggle="buttons">
                                    <t t-call="website_sale.filter_pills_attributes"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </t>
            </t>
            <t t-if="isMobile">
                <t t-if="opt_wsale_filter_tags and (opt_wsale_attributes or opt_wsale_attributes_top)">
                    <t t-set="_status" t-value="'inactive'"/>
                    <t t-foreach="all_tags" t-as="v" t-if="v.id in tags" t-set="_status" t-value="'active'"/>
                    <div t-if="all_tags">
                        <h2 class="accordion-header mb-0" t-attf-id="o_wsale_offcanvas_tags_header">
                            <button t-attf-class="o_wsale_offcanvas_title accordion-button border-top rounded-0 {{not tags and 'collapsed'}}" type="button" t-att-data-status="_status" data-bs-toggle="collapse" t-attf-data-bs-target="#o_wsale_offcanvas_tags" t-att-aria-expanded="_status == 'active' and 'True' or 'False'" t-attf-aria-controls="o_wsale_offcanvas_tags">
                                <b>Tags</b>
                            </button>
                        </h2>
                        <div t-attf-id="o_wsale_offcanvas_tags" t-attf-class="accordion-collapse collapse {{(_status == 'active') and 'show'}}" t-att-aria-expanded="(_status == 'active') and 'True' or 'False'" t-attf-aria-labelledby="o_wsale_offcanvas_tags_header">
                            <div class="accordion-body pt-0">
                                <div class="list-group list-group-flush">
                                    <t t-call="website_sale.filter_products_tags_list">
                                        <t t-set="all_tags" t-value="all_tags"/>
                                    </t>
                                </div>
                            </div>
                        </div>
                    </div>
                </t>
            </t>
            <t t-else="">
                <t t-if="opt_wsale_filter_tags and opt_wsale_attributes" t-call="website_sale.filter_products_tags">
                    <t t-set="all_tags" t-value="all_tags"/>
                </t>
            </t>
        </form>
    </t>

    