[FIX] theme_*: check cta_btn_text is not False before applying upper
The themes cobalt, paptic and vehicle apply upper on cta_btn_text for some snippets. In some case cta_btn_text is a boolean (False) and not a string. We must check cta_btn_text is not False before calling upper on it. task-2518565 closes odoo/design-themes#33 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -169,7 +169,7 @@
|
|||||||
<!-- ==== Call To Action ===== -->
|
<!-- ==== Call To Action ===== -->
|
||||||
<template id="s_call_to_action" inherit_id="website.s_call_to_action" name="Cobalt s_call_to_action">
|
<template id="s_call_to_action" inherit_id="website.s_call_to_action" name="Cobalt s_call_to_action">
|
||||||
<xpath expr="//t[@t-esc='cta_btn_text']" position="replace">
|
<xpath expr="//t[@t-esc='cta_btn_text']" position="replace">
|
||||||
<t t-esc="cta_btn_text.upper()">START NOW</t>
|
<t t-esc="cta_btn_text and cta_btn_text.upper()">START NOW</t>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<xpath expr="//p[2]" position="replace">
|
<xpath expr="//p[2]" position="replace">
|
||||||
<p class="text-o-color-3">
|
<p class="text-o-color-3">
|
||||||
<a href="#" class="btn btn-lg btn-primary mb-2">START NOW</a>    
|
<a href="#" class="btn btn-lg btn-primary mb-2">START NOW</a>    
|
||||||
<a t-att-href="cta_btn_href" class="btn btn-lg btn-secondary mb-2"><t t-esc="cta_btn_text.upper()">SCHEDULE A DEMO</t></a>
|
<a t-att-href="cta_btn_href" class="btn btn-lg btn-secondary mb-2"><t t-esc="cta_btn_text and cta_btn_text.upper()">SCHEDULE A DEMO</t></a>
|
||||||
</p>
|
</p>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<font style="font-size: 62px;font-weight: bold;">Start the Engine</font>
|
<font style="font-size: 62px;font-weight: bold;">Start the Engine</font>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//a[hasclass('btn')]" position="replace">
|
<xpath expr="//a[hasclass('btn')]" position="replace">
|
||||||
<a t-att-href="cta_btn_href" class="btn btn-primary btn-lg mb-2"><t t-esc="cta_btn_text.upper()">START THE ENGINE</t></a>
|
<a t-att-href="cta_btn_href" class="btn btn-primary btn-lg mb-2"><t t-esc="cta_btn_text and cta_btn_text.upper()">START THE ENGINE</t></a>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user