[FIX] website: default options are possible to disable by xpath
If we don't do that, the default options get mixed up with theme modules (including our own theme_bootswatch). Even worse, when installing any theme (including theme_bootswatch), the menu to change these options is replaced by the new theme one, so you cannot disable the broken options. This trick allows theme modules to disable the default options so they don't conflict, while restoring the user choices when uninstalling the theme.
This commit is contained in:
@@ -2,6 +2,13 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Deactivate default website options before adding the theme ones -->
|
||||
<template id="reset_default_options" inherit_id="website.default_options">
|
||||
<xpath expr="//t[@id='default_options']" position="attributes">
|
||||
<attribute name="t-if">False</attribute>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="theme_customize" inherit_id="website.theme_customize" name="theme_customize Bootswatch">
|
||||
<xpath expr="div" position="replace">
|
||||
|
||||
|
||||
@@ -167,37 +167,64 @@
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Default Options Toggle -->
|
||||
<template id="default_options" name="Default Customize Options" inherit_id="website.theme">
|
||||
<xpath expr="//link[last()]" position="after">
|
||||
<!-- Default options inherit from this view so we can easily disable it to reset all options -->
|
||||
<t id="default_options" t-if="True"></t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Option layout -->
|
||||
|
||||
<template id="option_layout_boxed" name="option_layout_boxed" inherit_id="website.theme" active="False" customize_show="False">
|
||||
<xpath expr="//link[last()]" position="after">
|
||||
<link href="/website/static/src/less/option_layout_boxed.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
<template id="option_layout_boxed" name="option_layout_boxed" inherit_id="website.default_options" active="False" customize_show="False">
|
||||
<xpath expr="//t[@id='default_options']" position="inside">
|
||||
<link href="/website/static/src/less/option_layout_boxed.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Option color -->
|
||||
|
||||
<template id="option_color_stone" name="option_color_stone" inherit_id="website.theme" active="False" customize_show="False">
|
||||
<xpath expr="//link[last()]" position="after"><link href="/website/static/src/less/option_color_stone.less" rel="stylesheet" type="text/less"/></xpath>
|
||||
</template>
|
||||
<template id="option_color_emerald" name="option_color_emerald" inherit_id="website.theme" active="False" customize_show="False">
|
||||
<xpath expr="//link[last()]" position="after"><link href="/website/static/src/less/option_color_emerald.less" rel="stylesheet" type="text/less"/></xpath>
|
||||
</template>
|
||||
<template id="option_color_cobalt" name="option_color_cobalt" inherit_id="website.theme" active="False" customize_show="False">
|
||||
<xpath expr="//link[last()]" position="after"><link href="/website/static/src/less/option_color_cobalt.less" rel="stylesheet" type="text/less"/></xpath>
|
||||
</template>
|
||||
<template id="option_color_amethyst" name="option_color_amethyst" inherit_id="website.theme" active="False" customize_show="False">
|
||||
<xpath expr="//link[last()]" position="after"><link href="/website/static/src/less/option_color_amethyst.less" rel="stylesheet" type="text/less"/></xpath>
|
||||
</template>
|
||||
<template id="option_color_ruby" name="option_color_ruby" inherit_id="website.theme" active="False" customize_show="False">
|
||||
<xpath expr="//link[last()]" position="after"><link href="/website/static/src/less/option_color_ruby.less" rel="stylesheet" type="text/less"/></xpath>
|
||||
</template>
|
||||
<template id="option_color_gold" name="option_color_gold" inherit_id="website.theme" active="False" customize_show="False">
|
||||
<xpath expr="//link[last()]" position="after"><link href="/website/static/src/less/option_color_gold.less" rel="stylesheet" type="text/less"/></xpath>
|
||||
<template id="option_color_stone" name="option_color_stone" inherit_id="website.default_options" active="False" customize_show="False">
|
||||
<xpath expr="//t[@id='default_options']" position="inside">
|
||||
<link href="/website/static/src/less/option_color_stone.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="option_font" name="option_font" inherit_id="website.theme" active="False" customize_show="False">
|
||||
<xpath expr="//link[last()]" position="after"><link href="/website/static/src/less/option_font.less" rel="stylesheet" type="text/less"/></xpath>
|
||||
<template id="option_color_emerald" name="option_color_emerald" inherit_id="website.default_options" active="False" customize_show="False">
|
||||
<xpath expr="//t[@id='default_options']" position="inside">
|
||||
<link href="/website/static/src/less/option_color_emerald.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="option_color_cobalt" name="option_color_cobalt" inherit_id="website.default_options" active="False" customize_show="False">
|
||||
<xpath expr="//t[@id='default_options']" position="inside">
|
||||
<link href="/website/static/src/less/option_color_cobalt.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="option_color_amethyst" name="option_color_amethyst" inherit_id="website.default_options" active="False" customize_show="False">
|
||||
<xpath expr="//t[@id='default_options']" position="inside">
|
||||
<link href="/website/static/src/less/option_color_amethyst.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="option_color_ruby" name="option_color_ruby" inherit_id="website.default_options" active="False" customize_show="False">
|
||||
<xpath expr="//t[@id='default_options']" position="inside">
|
||||
<link href="/website/static/src/less/option_color_ruby.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="option_color_gold" name="option_color_gold" inherit_id="website.default_options" active="False" customize_show="False">
|
||||
<xpath expr="//t[@id='default_options']" position="inside">
|
||||
<link href="/website/static/src/less/option_color_gold.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="option_font" name="option_font" inherit_id="website.default_options" active="False" customize_show="False">
|
||||
<xpath expr="//t[@id='default_options']" position="inside">
|
||||
<link href="/website/static/src/less/option_font.less" rel="stylesheet" type="text/less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user