[IMP] website: determine map snippet visibility based on presence of key

Before this commit both Google Map and Map snippets were always
available in the block list.

After this commit:
- if the Google Maps API key is specified: only the Google Map snippet
is available
- if the Google Maps API key is not specified: only the Map snippet is
available
- if debug mode is activated: both snippets are available

https://github.com/odoo/odoo/pull/68529
This commit is contained in:
Benoit Socias
2021-03-30 13:53:54 +00:00
parent a64e76e90a
commit 8555d11bfd
+3 -2
View File
@@ -108,8 +108,9 @@
<div class="o_panel_header">Dynamic Content</div>
<div class="o_panel_body">
<t id="form_form_hook"/>
<t t-snippet="website.s_map" t-thumbnail="/website/static/src/img/snippets_thumbs/s_map.svg"/>
<t t-snippet="website.s_google_map" t-thumbnail="/website/static/src/img/snippets_thumbs/s_google_map.svg"/>
<t t-set="google_maps_api_key" t-value="request.env['website'].get_current_website().google_maps_api_key"/>
<t t-if="debug or not google_maps_api_key" t-snippet="website.s_map" t-thumbnail="/website/static/src/img/snippets_thumbs/s_map.svg"/>
<t t-if="debug or google_maps_api_key" t-snippet="website.s_google_map" t-thumbnail="/website/static/src/img/snippets_thumbs/s_google_map.svg"/>
<t t-if="debug" t-snippet="website.s_dynamic_snippet" t-thumbnail="/website/static/src/img/snippets_thumbs/s_dynamic_snippet.svg"/>
<t t-if="debug" t-snippet="website.s_dynamic_snippet_carousel" t-thumbnail="/website/static/src/img/snippets_thumbs/s_dynamic_carousel.svg"/>
<t id="sale_products_hook"/>