-
-
Notifications
You must be signed in to change notification settings - Fork 551
Expand file tree
/
Copy pathtemplates.xml
More file actions
181 lines (180 loc) · 8.6 KB
/
templates.xml
File metadata and controls
181 lines (180 loc) · 8.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="website_sale_filter_brand_products_brands"
inherit_id="website_sale.products_attributes"
name="Brands Filter"
active="True"
customize_show="True"
priority="999"
>
<xpath expr="//form[hasclass('js_attributes')]" position="inside">
<div t-if="len(brands)" class="accordion-item nav-item mb-3 rounded-0">
<h6 class="accordion-header">
<button
class="accordion-button px-0 bg-transparent shadow-none"
type="button"
data-bs-toggle="collapse"
t-attf-data-bs-target="#o_products_attributes_brand"
t-attf-aria-controls="o_products_attributes_brand"
aria-expanded="true"
>
<b>Brand</b>
</button>
</h6>
<div t-attf-id="o_products_attributes_brand" class="">
<t t-foreach="brands" t-as="brand">
<t
t-if="not selected_brand_ids or brand.id in selected_brand_ids"
>
<div class="form-check mb-1">
<input
type="checkbox"
name="brand"
class="form-check-input"
t-att-id="brand.id"
t-att-value="brand.id"
t-att-checked="'checked' if brand.id in selected_brand_ids else None"
/>
<label
class="form-check-label fw-normal"
t-att-for="brand.id"
t-field="brand.name"
/>
</div>
</t>
</t>
</div>
</div>
</xpath>
<xpath
expr="//div[@t-if='attrib_values or tags' and hasclass('accordion-item')]"
position="replace"
>
<div
t-if="attrib_values or tags or selected_brand_ids"
class="accordion-item rounded-0 border-top-0 py-3"
>
<a
t-att-href="keep('/shop' + ('/category/' + slug(category)) if category else None, attribute_value=0, tags=0, brand=0, brand_ids=0)"
t-attf-class="btn btn-{{navClass}} d-flex align-items-center py-1"
title="Clear Filters"
>
<small class="mx-auto">
<b>Clear Filters</b>
</small>
<i class="oi oi-close" role="presentation" />
</a>
</div>
</xpath>
<xpath
expr="//div[@t-if='attributes or all_tags' and @id='wsale_products_attributes_collapse']"
position="attributes"
>
<attribute
name="t-if"
>attributes or all_tags or selected_brand_ids</attribute>
</xpath>
</template>
<template id="search_brands" name="Search Box" inherit_id="website_sale.search">
<xpath expr="//t[contains(@t-if, 'attrib_values')]" position="after">
<t t-if="brand_ids">
<t t-foreach="brand_ids" t-as="brand">
<input type="hidden" name="brand" t-att-value="brand" />
</t>
</t>
</xpath>
</template>
<template
id="website_sale_filter_brand_top_products_brands"
inherit_id="website_sale.o_wsale_offcanvas"
priority="999"
>
<xpath
expr="//form[@t-if='opt_wsale_attributes or opt_wsale_attributes_top']"
position="inside"
>
<t
t-if="is_view_active('website_sale_product_brand.website_sale_filter_brand_products_brands')"
>
<t t-if="brands">
<!-- status activo si hay marca seleccionada -->
<t
t-set="_brand_status"
t-value="selected_brand_ids and 'active' or 'inactive'"
/>
<div
t-attf-class="accordion-item border-top-0 {{(_brand_status == 'active') and 'order-1' or 'order-2'}}"
>
<h2
class="accordion-header mb-0"
t-attf-id="o_wsale_offcanvas_brand_header"
>
<button
t-attf-class="o_wsale_offcanvas_title accordion-button rounded-0 {{ (not selected_brand_ids) and 'collapsed' }}"
type="button"
t-att-data-status="_brand_status"
data-bs-toggle="collapse"
t-attf-data-bs-target="#o_wsale_offcanvas_brand"
t-att-aria-expanded="_brand_status == 'active' and 'True' or 'False'"
t-attf-aria-controls="o_wsale_offcanvas_brand"
>
<b>Brand</b>
</button>
</h2>
<div
t-attf-id="o_wsale_offcanvas_brand"
t-attf-class="accordion-collapse collapse {{ (_brand_status == 'active') and 'show' }}"
t-att-aria-expanded="(_brand_status == 'active') and 'True' or 'False'"
t-attf-aria-labelledby="o_wsale_offcanvas_brand_header"
>
<div class="accordion-body pt-0">
<div class="list-group list-group-flush">
<t t-foreach="brands" t-as="brand">
<t
t-if="not selected_brand_ids or brand.id in selected_brand_ids"
>
<div
class="list-group-item border-0 ps-0 pb-0"
>
<div class="form-check mb-1">
<input
type="checkbox"
name="brand"
class="form-check-input"
t-att-id="'brand-%s' % brand.id"
t-att-value="brand.id"
t-att-checked="'checked' if brand.id in (selected_brand_ids or []) else None"
/>
<label
class="form-check-label fw-normal"
t-att-for="'brand-%s' % brand.id"
t-field="brand.name"
/>
</div>
</div>
</t>
</t>
</div>
</div>
</div>
</div>
</t>
</t>
</xpath>
<xpath expr="//a[@href='/shop']" position="replace">
<t
t-set="_has_any_filters"
t-value="bool(attrib_values) or bool(isFilteringByPrice) or bool(tags) or bool(selected_brand_ids)"
/>
<a
t-att-href="keep('/shop' + ('/category/' + slug(category)) if category else None, attribute_value=0, tags=0, brand=0, brand_ids=0)"
t-attf-class="btn btn-{{navClass}} d-flex py-1 mb-2 {{ (not _has_any_filters) and 'disabled' }}"
t-att-aria-disabled="(not _has_any_filters) and 'true' or 'false'"
title="Clear Filters"
>
Clear Filters
</a>
</xpath>
</template>
</odoo>