From 198673bf35f14e3a797d2ff09208a289e12bec4e Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 7 Dec 2016 14:41:40 +0100 Subject: [ADD] web_editor, website, web: new LESS editor The old "HTML" editor now handles LESS edition. The editor has now a button to switch between XML and LESS edition. By default, it only displays the odoo files which only appear in the assets_frontend bundle and in debug mode, it allows to see all the files that influenced the page design. The new editor has a new set of options which allows to use it as a xml editor only or a less editor only if needed. Also: make the "include bundles" option appear only in debug mode. Technical details: - When saving a modified LESS file, an attachment is created with the full modified content and an extension view xpaths the bundle where the original file was added to link this attachment instead. This relies on the fact that qweb, when generating assets bundle, replaces missing files by the "datas" contents of the ir.attachment's which have an "url" field equal to the urls it is searching. - If a LESS error is introduced, the recent changes in assets bundle generation (see c248674a5c615c9db113357eec9d9adaf50b888e) will not break the design but only open a dialog on page loading, with the LESS error. The user can then go to the LESS editor and reset its changes. This feature code has been started with original work of @pga-odoo --- addons/web_editor/static/src/less/web_editor.ui.components.less | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/less') diff --git a/addons/web_editor/static/src/less/web_editor.ui.components.less b/addons/web_editor/static/src/less/web_editor.ui.components.less index 9d40da2a9f3..709e9b03b2e 100644 --- a/addons/web_editor/static/src/less/web_editor.ui.components.less +++ b/addons/web_editor/static/src/less/web_editor.ui.components.less @@ -135,11 +135,16 @@ .o-justify-content(space-between); padding: @grid-gutter-width/4; + > .o_ace_type_switcher > button::after { + .o-caret-down(); + margin-left: 4px; + } + > * { .o-flex(0, 0, auto); margin: 0 @grid-gutter-width/4; - &.oe_include_bundles { + &.o_include_option { .o-flex-display(); .o-align-items(center); font-size: 11px; -- cgit v1.2.3