summaryrefslogtreecommitdiff
path: root/addons/website/static/src/xml/website.editor.xml
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-12-18 16:08:31 +0000
committerqsm-odoo <qsm@odoo.com>2019-02-08 14:37:52 +0000
commit45a54104bfdee9f0459bc35d7da15c6e586b4982 (patch)
tree6e9bac01497c65f950fcefd67641f114500c7280 /addons/website/static/src/xml/website.editor.xml
parent065957b9817b3eb800a0a604b2660d7106718700 (diff)
[REF] website: unify the theme customize dialog color options
Before this commit, color options in the theme customize were treated as big exception in the system. The whole color panel XML was defined client-side and used custom design. Now, all colors are defined as options in the "server-side" template, allowing for more customizations and better maintenance. This commit also makes the color saving system generic to allow for more new options in the future (like customizing the logo height or the font size, which is the next task). PR https://github.com/odoo/odoo/pull/29624 task-1904244
Diffstat (limited to 'addons/website/static/src/xml/website.editor.xml')
-rw-r--r--addons/website/static/src/xml/website.editor.xml47
1 files changed, 5 insertions, 42 deletions
diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml
index 293b68a93a6..d02d82eb5aa 100644
--- a/addons/website/static/src/xml/website.editor.xml
+++ b/addons/website/static/src/xml/website.editor.xml
@@ -37,58 +37,21 @@
<div class="form-row justify-content-between o_options_container"/>
</div>
<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 : ''}">
+ <div t-attf-class="o_theme_customize_option my-1 flex-grow-0 #{font ? 'o_theme_customize_option_font_' + font : ''} #{widget ? 'o_theme_customize_with_widget' : ''}">
<img t-if="icon" t-att-src="icon"/>
<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">
+ <label t-else="">
<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>
- <t t-name="website.theme_customize_color_palette">
- <div class="o_theme_customize_color_previews">
- <div>
- <h6>Main colors</h6>
- <t t-foreach="{'primary': _t('Primary'), 'secondary': _t('Secondary'), 'alpha': _t('Primary'), 'beta': _t('Secondary'), 'gamma': _t('Extra Color'), 'delta': _t('Extra Color'), 'epsilon': _t('Extra Color')}" t-as="color">
- <t t-call="website.theme_customize_color_palette_button">
- <t t-set="color_type" t-value="'theme'"/>
- </t>
- </t>
- </div>
- <div>
- <h6>Background colors</h6>
- <t t-foreach="{'body': _t('Body'), 'menu': _t('Menus'), 'footer': _t('Footer')}" t-as="color">
- <t t-call="website.theme_customize_color_palette_button"/>
- </t>
- </div>
- <div>
- <h6>Text colors</h6>
- <t t-foreach="{'text': _t('Text'), 'h1': _t('Headings 1'), 'h2': _t('Headings 2'), 'h3': _t('Headings 3'), 'h4': _t('Headings 4'), 'h5': _t('Headings 5'), 'h6': _t('Headings 6')}" t-as="color">
- <t t-call="website.theme_customize_color_palette_button"/>
- </t>
- </div>
- <div>
- <h6>State colors</h6>
- <t t-foreach="{'success': _t('Success'), 'info': _t('Info'), 'warning': _t('Warning'), 'danger': _t('Error')}" t-as="color">
- <t t-call="website.theme_customize_color_palette_button">
- <t t-set="color_type" t-value="'theme'"/>
- </t>
- </t>
- </div>
- </div>
- </t>
- <t t-name="website.theme_customize_color_palette_button">
- <button type="button"
- t-attf-class="btn btn-secondary #{color == 'primary' or color == 'secondary' ? 'd-none' : 'd-flex'} align-items-center w-100 mt-2 justify-content-between o_theme_customize_color o_theme_customize_color_#{color}"
+ <t t-name="website.theme_customize_widget_color">
+ <div t-attf-class="bg-#{color} o_theme_customize_color o_theme_customize_color_#{color}"
t-att-data-color="color"
- t-att-data-color-type="color_type">
- <span class="o_color_name"><t t-esc="color_value"/></span>
- <span t-attf-class="o_color_preview bg-#{color}"/>
- </button>
+ t-att-data-color-type="colorType"/>
</t>
<t t-extend="wysiwyg.widgets.link">