diff options
| author | Andrea Ulliana <aul@odoo.com> | 2019-01-22 14:48:44 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-02-05 14:28:29 +0000 |
| commit | 515e7bc50f07c983eb932825d763753978346e66 (patch) | |
| tree | 65dc17a032f13dd1318c88d63fdc566fe4f6a8d4 /addons/website/controllers/web_editor.py | |
| parent | 7f2ce89554e3675f553d2658fc0a04cd5facf088 (diff) | |
[IMP] website, *: improve CSS edition usability + add JS edition
* web_editor
Currently, when an user wants to edit the css of its website, he has
access to lots of files and, in debug mode, to even more files. While
the feature is nice for people who know what they are doing, a lambda
person can easily break its website by changing the wrong files. Also,
nothing warns the user that the files that are edited will never receive
updates anymore (unless if they are reset). The goal is to prevent
those behavior while still allowing the add custom css. Another goal
is to be able to *add* custom javascript.
Custom files created for the user:
SCSS: user_custom_rules.scss, user_custom_bootstrap_overridden.scss
JS: user_custom_javascript.js
See https://github.com/odoo/odoo/pull/29999
task-1919350
Diffstat (limited to 'addons/website/controllers/web_editor.py')
| -rw-r--r-- | addons/website/controllers/web_editor.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/website/controllers/web_editor.py b/addons/website/controllers/web_editor.py index 530c9ef2b10..92aa9bb1d8a 100644 --- a/addons/website/controllers/web_editor.py +++ b/addons/website/controllers/web_editor.py @@ -11,16 +11,16 @@ class Web_Editor(Web_Editor): res.append('website_id') return res - def save_scss_view_hook(self): - res = super(Web_Editor, self).save_scss_view_hook() + def save_scss_or_js_view_hook(self): + res = super(Web_Editor, self).save_scss_or_js_view_hook() website = request.env['website'].get_current_website() if website: res['website_id'] = website.id return res - def save_scss_attachment_hook(self): - res = super(Web_Editor, self).save_scss_attachment_hook() + def save_scss_or_js_attachment_hook(self): + res = super(Web_Editor, self).save_scss_or_js_attachment_hook() website = request.env['website'].get_current_website() if website: |
