[FIX] website: confusion/dangerous config options for CDN
Users are tempted to enable all features they see under the former "Speed" section of the website settings, even if they have no idea what they do. One of them was `CDN Base URL` and had a default value that was wrong and very likely to break your website if enabled by mistake. This commit replaces the default value with a placeholder that looks more like a `sample` URL, and makes the fields required when the CDN option is enabled. It also moves the whole "Speed" options to technical features / debug mode.
This commit is contained in:
@@ -3149,7 +3149,7 @@ msgstr ""
|
||||
|
||||
#. module: website
|
||||
#: model:ir.ui.view,arch_db:website.view_website_config_settings
|
||||
msgid "Speed"
|
||||
msgid "Optimization"
|
||||
msgstr ""
|
||||
|
||||
#. module: website
|
||||
|
||||
@@ -179,7 +179,7 @@ class website(osv.osv):
|
||||
'company_id': lambda self,cr,uid,c: self.pool['ir.model.data'].xmlid_to_res_id(cr, openerp.SUPERUSER_ID,'base.main_company'),
|
||||
'compress_html': False,
|
||||
'cdn_activated': False,
|
||||
'cdn_url': '//localhost:8069/',
|
||||
'cdn_url': '',
|
||||
'cdn_filters': '\n'.join(DEFAULT_CDN_FILTERS),
|
||||
}
|
||||
|
||||
|
||||
@@ -100,8 +100,8 @@
|
||||
<label for="module_website_version"/>
|
||||
</div>
|
||||
</div>
|
||||
<label for="id" string="Speed"/>
|
||||
<div>
|
||||
<label for="id" string="Optimization" groups="base.group_no_one"/>
|
||||
<div groups="base.group_no_one">
|
||||
<div>
|
||||
<field name="compress_html"/>
|
||||
<label for="compress_html"/>
|
||||
@@ -109,11 +109,16 @@
|
||||
<div>
|
||||
<field name="cdn_activated"/>
|
||||
<label for="cdn_activated"/>
|
||||
</div><div>
|
||||
</div>
|
||||
<div attrs="{'invisible': [('cdn_activated', '=', False)]}">
|
||||
<label for="cdn_url"/>
|
||||
<field name="cdn_url" attrs="{'invisible': [('cdn_activated', '=', False)] }"/>
|
||||
<field name="cdn_url"
|
||||
attrs="{'required': [('cdn_activated', '=', True)]}"
|
||||
placeholder="//mycompany.mycdn.com/"
|
||||
t-translation="off"/>
|
||||
<label for="cdn_filters"/>
|
||||
<field name="cdn_filters" attrs="{'invisible': [('cdn_activated', '=', False)] }"/>
|
||||
<field name="cdn_filters"
|
||||
attrs="{'required': [('cdn_activated', '=', True)]}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user