|
1 | 1 | <?xml version="1.0" encoding="utf-8"?>
|
2 | 2 | <odoo>
|
3 |
| - <template id="website_appointment_filter_template" inherit_id="website_appointment.website_calendar_index_topbar"> |
| 3 | + <template id="website_appointment_filter_template" |
| 4 | + inherit_id="website_appointment.website_calendar_index_topbar"> |
4 | 5 | <xpath expr="//h4" position="after">
|
5 | 6 | <div class="d-flex flex-grow-1 justify-content-end gap-2 px-2">
|
6 |
| - <t t-set="filter_options" t-value="[ |
| 7 | + <t t-set="filter_options" |
| 8 | + t-value="[ |
7 | 9 | {
|
8 | 10 | 'title': 'Type',
|
9 | 11 | 'param': 'appointment_type',
|
|
31 | 33 | {'value': 'resources', 'label': 'Resources'}
|
32 | 34 | ]
|
33 | 35 | }
|
34 |
| - ]"/> |
| 36 | + ]" /> |
35 | 37 | <t t-foreach="filter_options" t-as="dropdown">
|
36 | 38 | <div class="dropdown">
|
37 |
| - <t t-set="current_selection" t-value="request.params.get(dropdown['param'], 'all')"/> |
38 |
| - <button class="btn btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown"> |
39 |
| - <t t-esc="dropdown['title']"/> |
| 39 | + <t t-set="current_selection" |
| 40 | + t-value="request.params.get(dropdown['param'], 'all')" /> |
| 41 | + <button class="btn btn-light dropdown-toggle" type="button" |
| 42 | + data-bs-toggle="dropdown"> |
| 43 | + <t t-esc="dropdown['title']" /> |
40 | 44 | <t t-if="current_selection != 'all'">
|
41 | 45 | <span class="badge bg-secondary ms-2">1</span>
|
42 | 46 | </t>
|
43 | 47 | </button>
|
44 | 48 | <div class="dropdown-menu">
|
45 | 49 | <t t-foreach="dropdown['choices']" t-as="choice">
|
46 |
| - <t t-set="updated_params" t-value="dict(request.params, **{dropdown['param']: choice['value']})"/> |
47 |
| - <a t-att-href="'/appointment?' + '&'.join(['%s=%s' % (k, v) for k, v in updated_params.items() if v and v != 'all'])" |
48 |
| - t-att-class="'dropdown-item' + (' active' if current_selection == choice['value'] else '')"> |
49 |
| - <t t-esc="choice['label']"/> |
| 50 | + <t t-set="updated_params" |
| 51 | + t-value="dict(request.params, **{dropdown['param']: choice['value']})" /> |
| 52 | + <a |
| 53 | + t-att-href="'/appointment?' + '&'.join(['%s=%s' % (k, v) for k, v in updated_params.items() if v and v != 'all'])" |
| 54 | + t-att-class="'dropdown-item' + (' active' if current_selection == choice['value'] else '')"> |
| 55 | + <t t-esc="choice['label']" /> |
50 | 56 | </a>
|
51 | 57 | </t>
|
52 | 58 | </div>
|
|
0 commit comments