diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-12-18 14:08:40 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-02-08 14:36:43 +0000 |
| commit | 4edb9c4f60f98719cb7f8666b5ee7f6ab4c7441f (patch) | |
| tree | cf0b635e93a4b497b61e044efd030c37256920e0 /addons/website/static/src/xml | |
| parent | e6e206b14e3c3f0274b9d8e723ab1f40c53efe68 (diff) | |
[IMP] website: improve theme customize dialog
- Make the controller part more readable and more efficient (O(1) ORM
operations instead of O(n)) and remove deprecated code.
- Add the possibility to have a toggle standalone option. This is
used as soon as an `<opt/>` is alone in its container (note that now,
the container can be any tag and will be ignored during rendering).
- If an option has no specified 'string' to attach to it, the name of
the first view it toggles will be used.
PR https://github.com/odoo/odoo/pull/29624
task-1904244
Diffstat (limited to 'addons/website/static/src/xml')
| -rw-r--r-- | addons/website/static/src/xml/website.editor.xml | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml index 46d5de05c12..293b68a93a6 100644 --- a/addons/website/static/src/xml/website.editor.xml +++ b/addons/website/static/src/xml/website.editor.xml @@ -22,9 +22,9 @@ <!-- Custom checkbox (material-design-like toggle) --> <t t-name="website.components.switch"> <label class="o_switch" t-att-for="id"> - <input type="checkbox" t-att-id="id"/> + <input type="checkbox" t-att-id="id" t-att-checked="checked ? 'checked' : undefined"/> <span/> - <t t-if="label"><t t-esc="label"/></t> + <div t-if="label"><t t-esc="label"/></div> </label> </t> @@ -39,9 +39,13 @@ <t t-name="website.theme_customize_modal_option"> <div t-attf-class="o_theme_customize_option my-1 flex-grow-0 #{font ? 'o_theme_customize_option_font_' + font : ''}"> <img t-if="icon" t-att-src="icon"/> - <label t-attf-class="#{widget ? 'd-none' : 'd-flex'} align-items-center justify-content-center text-center"> - <input t-att-id="id" t-att-name="name" type="radio" class="o_theme_customize_option_input" t-att-data-xmlid="xmlid" t-att-data-enable="enable" t-att-data-disable="disable" t-att-data-reload="reload"/> - <span><t t-esc="string"/></span> + + <t t-set="label" t-value="font ? '' : string"/> + <t t-set="_classes" t-value="widget ? 'd-none' : 'd-flex'"/> + <t t-if="alone and !widget" t-call="website.components.switch"/> + <label t-else="" t-attf-class="#{_classes} align-items-center justify-content-center text-center"> + <input t-att-id="id" t-att-name="name" type="radio" t-att-checked="checked ? 'checked' : undefined"/> + <span><t t-esc="label"/></span> </label> </div> </t> |
