summaryrefslogtreecommitdiff
path: root/addons/theme_bootswatch
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-12-21 10:37:10 +0000
committerqsm-odoo <qsm@odoo.com>2018-12-26 17:25:23 +0000
commit52ec536cef2ec84af0b36746f19a8cdf9f23fe2a (patch)
tree003b9e782fa078866d56f71a926338a65379e080 /addons/theme_bootswatch
parentec48392e39e551d9784f0431aa818f280edf9ce3 (diff)
[REF] *: make stronger bootstrap assets
* portal, theme_bootswatch, web, web_editor, website With less2sass and bs3tobs4 tasks, the assets structure was reviewed to handle the specificities of both framework and to prepare for our next odoo tasks. In particular, the assets_helpers and bootstrap overrides were basically split into 4 parts: utils, primary variables, secondary variables and bootstrap variables. (see https://github.com/odoo/odoo/commit/6e4db7d13a926845bf82f5b035afede42d6d5a89) Using the !default system for the bootstrap variables parts seems now a good improvement. This is part of what this commit does: adding the default flag for all bootstrap variables overrides and inverting the order of the files in the _assets_backend_helpers and _assets_frontend_helpers templates. This allows to avoid code like this: portal: ``` $body-bg: white; ``` website: ``` @​if $var != null { $body-bg: $var; } ``` This code makes the body white with portal or equal to $var with website if $var has a value. The same behavior in the new file order is achieved with: website: ``` $body-bg: $var !default; ``` portal: ``` $body-bg: white !default; ``` This order is now also followed for the _assets_secondary_variables templates (there are only a few). This commit also make better assets hierarchy by making website inherit from portal assets (instead of web) and portal inherit from web_editor assets (instead of web) (thus relying on strong dependencies instead of installation order which is not always right for migrated databases). closes odoo/odoo#29757
Diffstat (limited to 'addons/theme_bootswatch')
-rw-r--r--addons/theme_bootswatch/views/theme_bootswatch_templates.xml38
1 files changed, 19 insertions, 19 deletions
diff --git a/addons/theme_bootswatch/views/theme_bootswatch_templates.xml b/addons/theme_bootswatch/views/theme_bootswatch_templates.xml
index 44e061ea406..d59134c4a9c 100644
--- a/addons/theme_bootswatch/views/theme_bootswatch_templates.xml
+++ b/addons/theme_bootswatch/views/theme_bootswatch_templates.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Remove Odoo bootstrap overridde -->
- <template id="_assets_frontend_helpers" inherit_id="web._assets_frontend_helpers">
+ <template id="_assets_frontend_helpers" inherit_id="website._assets_frontend_helpers">
<xpath expr="//link[@href='/web_editor/static/src/scss/bootstrap_overridden.scss']" position="replace"/>
<xpath expr="//link[@href='/website/static/src/scss/bootstrap_overridden.scss']" position="replace"/>
</template>
@@ -25,8 +25,8 @@
</xpath>
</template>
- <template id="theme_cerulean_bs_variables" name="Cerulean" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_cerulean_bs_variables" name="Cerulean" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/cerulean/_variables.scss"/>
</xpath>
</template>
@@ -37,8 +37,8 @@
</xpath>
</template>
- <template id="theme_cosmo_bs_variables" name="Cosmo" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_cosmo_bs_variables" name="Cosmo" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/cosmo/_variables.scss"/>
</xpath>
</template>
@@ -49,8 +49,8 @@
</xpath>
</template>
- <template id="theme_cyborg_bs_variables" name="Cyborg" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_cyborg_bs_variables" name="Cyborg" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/cyborg/_variables.scss"/>
</xpath>
</template>
@@ -61,8 +61,8 @@
</xpath>
</template>
- <template id="theme_flatly_bs_variables" name="Flatly" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_flatly_bs_variables" name="Flatly" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/flatly/_variables.scss"/>
</xpath>
</template>
@@ -73,8 +73,8 @@
</xpath>
</template>
- <template id="theme_journal_bs_variables" name="Journal" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_journal_bs_variables" name="Journal" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/journal/_variables.scss"/>
</xpath>
</template>
@@ -85,8 +85,8 @@
</xpath>
</template>
- <template id="theme_simplex_bs_variables" name="Simplex" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_simplex_bs_variables" name="Simplex" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/simplex/_variables.scss"/>
</xpath>
</template>
@@ -97,8 +97,8 @@
</xpath>
</template>
- <template id="theme_slate_bs_variables" name="Slate" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_slate_bs_variables" name="Slate" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/slate/_variables.scss"/>
</xpath>
</template>
@@ -109,8 +109,8 @@
</xpath>
</template>
- <template id="theme_spacelab_bs_variables" name="Spacelab" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_spacelab_bs_variables" name="Spacelab" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/spacelab/_variables.scss"/>
</xpath>
</template>
@@ -121,8 +121,8 @@
</xpath>
</template>
- <template id="theme_united_bs_variables" name="United" inherit_id="web._assets_frontend_helpers" active="False">
- <xpath expr="//link[last()]" position="after">
+ <template id="theme_united_bs_variables" name="United" inherit_id="website._assets_frontend_helpers" active="False">
+ <xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/theme_bootswatch/static/lib/bootswatch/united/_variables.scss"/>
</xpath>
</template>