[FIX] website_(crm_partner_assign, customer): radio filters

Before this commit, radio buttons in the offcanvas filters (displayed
on mobile) were not working as they should: clicking on the label
worked fine but the click on the radio itself did not trigger anything.

We impeach input's `pointer-event` so, the `<a>` becomes main and only
interaction

This commit also fixes an contrast issue in the tag filter in the
offcanvas

task-3649662

closes odoo/odoo#158350

X-original-commit: f1808866aaddf82452536edfa46c6906368bd0cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Antoine Sougné (anso) <anso@odoo.com>
This commit is contained in:
Antoine (anso)
2024-03-21 11:11:37 +00:00
parent 91b43f3999
commit 3a910816ed
2 changed files with 6 additions and 6 deletions
@@ -91,7 +91,7 @@
<a t-attf-href="/partners#{ grade['grade_id'][0] and '/grade/%s' % grade['grade_id'][0] or '' }#{ current_country and '/country/%s' % slug(current_country) or '' }#{ '?' + (search_path or '') + '&amp;' + keep_query('country_all') }"
class="text-reset" aria-label="See categories filters">
<div class="form-check">
<input class="form-check-input" type="radio" t-attf-name="#{grade['grade_id'][1]}" t-att-checked="bool(grade['active'])"/>
<input class="form-check-input pe-none" type="radio" t-attf-name="#{grade['grade_id'][1]}" t-att-checked="bool(grade['active'])"/>
<label class="form-check-label" t-attf-for="#{grade['grade_id'][1]}" t-out="grade['grade_id'][1]"/>
</div>
</a>
@@ -120,7 +120,7 @@
<a t-attf-href="/partners#{ current_grade and '/grade/%s' % slug(current_grade) or ''}#{country['country_id'][0] and '/country/%s' % country['country_id'][0] or '' }#{ '?' + (search_path or '') + (country['country_id'][0] == 0 and '&amp;country_all=True' or '')}"
class="text-reset" aria-label="See countries filters">
<div class="form-check">
<input class="form-check-input" type="radio" t-attf-name="#{country['country_id'][1]}" t-att-checked="bool(country['active'])"/>
<input class="form-check-input pe-none" type="radio" t-attf-name="#{country['country_id'][1]}" t-att-checked="bool(country['active'])"/>
<label class="form-check-label" t-attf-for="#{country['country_id'][1]}" t-out="country['country_id'][1]"/>
</div>
</a>
@@ -51,7 +51,7 @@
<a t-attf-href="/customers/#{ industry_dict['industry_id'][0] and 'industry/%s/' % slug(industry_dict['industry_id']) or '' }#{ current_country_id and 'country/%s' % current_country_id or '' }#{ search_path }"
class="text-reset" aria-label="See industries filters">
<div class="form-check">
<input class="form-check-input" type="radio" t-attf-name="#{industry_dict['industry_id'][1]}" t-att-checked="industry_dict['industry_id'][0] == current_industry_id and true or false"/>
<input class="form-check-input pe-none" type="radio" t-attf-name="#{industry_dict['industry_id'][1]}" t-att-checked="industry_dict['industry_id'][0] == current_industry_id and true or false"/>
<label class="form-check-label" t-attf-for="#{industry_dict['industry_id'][1]}" t-out="industry_dict['industry_id'][1]"/>
</div>
</a>
@@ -82,7 +82,7 @@
<a t-attf-href="/customers/#{ current_industry_id and 'industry/%s/' % slug(current_industry) or '' }#{ country_dict['country_id'][0] and 'country/%s' % slug(country_dict['country_id']) or '' }#{ search_path }"
class="text-reset" aria-label="See countries filters">
<div class="form-check">
<input class="form-check-input" type="radio" t-attf-name="{country_dict['country_id'][1]}" t-att-checked="country_dict['country_id'][0] == current_country_id and true or false"/>
<input class="form-check-input pe-none" type="radio" t-attf-name="{country_dict['country_id'][1]}" t-att-checked="country_dict['country_id'][0] == current_country_id and true or false"/>
<label class="form-check-label" t-attf-for="{country_dict['country_id'][1]}" t-out="country_dict['country_id'][1]"/>
</div>
</a>
@@ -107,10 +107,10 @@
<div class="o_wc_offcanvas_tags accordion-collapse collapse">
<div class="accordion-body">
<div class="d-flex flex-wrap align-items-center gap-1 mb-4" t-if="len(tags)">
<a class="me-2" t-attf-href="/customers/#{ current_industry_id and 'industry/%s/' % slug(current_industry) or '' }#{ current_country_id and 'country/%s' % slug(current_country) or '' }">
<a class="badge text-bg-light" t-attf-href="/customers/#{ current_industry_id and 'industry/%s/' % slug(current_industry) or '' }#{ current_country_id and 'country/%s' % slug(current_country) or '' }">
<span class="fa fa-1x fa-tags"/> All </a>
<t t-foreach="tags" t-as="o_tag">
<a t-attf-class="bg-#{o_tag.classname} badge" t-out="o_tag.name" t-att-style="tag and tag.id==o_tag.id and 'text-decoration: underline'"
<a t-attf-class="badge text-bg-#{o_tag.classname}" t-out="o_tag.name" t-att-style="tag and tag.id==o_tag.id and 'text-decoration: underline'"
t-attf-href="/customers/#{ current_industry_id and 'industry/%s/' % slug(current_industry) or '' }#{ current_country_id and 'country/%s' % slug(current_country) or '' }?tag_id=#{slug(o_tag)}"/>
</t>
</div>