summaryrefslogtreecommitdiff
path: root/addons/website_customer
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-09-02 16:28:28 +0200
committerChristophe Simonis <chs@odoo.com>2016-09-02 16:28:28 +0200
commit54e5bbdf3531ecfee84fb6aae627d346c2425c30 (patch)
tree2920139e3f9b019371cb2f332a53e0ab5ff8d142 /addons/website_customer
parent198c080b3512e8b7fbcd9ab47d15746776d5d1a6 (diff)
parent897b9b8fc0548c5165d30b7f20b47aa00e918f1d (diff)
[MERGE] forward port branch saas-10 up to 897b9b8
Diffstat (limited to 'addons/website_customer')
-rw-r--r--addons/website_customer/controllers/main.py2
-rw-r--r--addons/website_customer/views/website_customer.xml36
2 files changed, 21 insertions, 17 deletions
diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py
index e7a68808a57..d5a0dc1052c 100644
--- a/addons/website_customer/controllers/main.py
+++ b/addons/website_customer/controllers/main.py
@@ -85,6 +85,7 @@ class WebsiteCustomer(http.Controller):
context=request.context)
google_map_partner_ids = ','.join(map(str, partner_ids))
partners = partner_obj.browse(request.cr, openerp.SUPERUSER_ID, partner_ids, request.context)
+ google_maps_api_key = request.env['ir.config_parameter'].sudo().get_param('google_maps_api_key')
tag_obj = request.registry['res.partner.tag']
tag_ids = tag_obj.search(cr, uid, [('website_published', '=', True), ('partner_ids', 'in', partner_ids)],
@@ -103,6 +104,7 @@ class WebsiteCustomer(http.Controller):
'search_path': "?%s" % werkzeug.url_encode(post),
'tag': tag,
'tags': tags,
+ 'google_maps_api_key': google_maps_api_key,
}
return request.website.render("website_customer.index", values)
diff --git a/addons/website_customer/views/website_customer.xml b/addons/website_customer/views/website_customer.xml
index 680b82c4a18..f13d3ec6d6d 100644
--- a/addons/website_customer/views/website_customer.xml
+++ b/addons/website_customer/views/website_customer.xml
@@ -68,25 +68,27 @@
<!-- Option: left column: World Map -->
<template id="opt_country" inherit_id="website_customer.index" customize_show="True" name="Show Map">
<xpath expr="//div[@id='ref_left_column']" position="inside">
- <!-- modal for large map -->
- <div class="modal fade customer_map_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">World Map</h4>
+ <t t-if="google_maps_api_key">
+ <!-- modal for large map -->
+ <div class="modal fade customer_map_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
+ <div class="modal-dialog modal-lg">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h4 class="modal-title">World Map</h4>
+ </div>
+ <iframe t-attf-src="/google_map/?width=898&amp;height=485&amp;partner_ids=#{ google_map_partner_ids }&amp;partner_url=/customers/"
+ style="width:898px; height:485px; border:0; padding:0; margin:0;"></iframe>
</div>
- <iframe t-attf-src="/google_map/?width=898&amp;height=485&amp;partner_ids=#{ google_map_partner_ids }&amp;partner_url=/customers/"
- style="width:898px; height:485px; border:0; padding:0; margin:0;"></iframe>
+ </div>
</div>
- </div>
- </div>
- <!-- modal end -->
- <h3>World Map<button class="btn btn-link" data-toggle="modal" data-target=".customer_map_modal"><span class="fa fa-external-link" /></button></h3>
- <ul class="nav">
- <iframe t-attf-src="/google_map?width=260&amp;height=240&amp;partner_ids=#{ google_map_partner_ids }&amp;partner_url=/customers/"
- style="width:260px; height:240px; border:0; padding:0; margin:0;" scrolling="no"></iframe>
- </ul>
+ <!-- modal end -->
+ <h3>World Map<button class="btn btn-link" data-toggle="modal" data-target=".customer_map_modal"><span class="fa fa-external-link" /></button></h3>
+ <ul class="nav">
+ <iframe t-attf-src="/google_map?width=260&amp;height=240&amp;partner_ids=#{ google_map_partner_ids }&amp;partner_url=/customers/"
+ style="width:260px; height:240px; border:0; padding:0; margin:0;" scrolling="no"></iframe>
+ </ul>
+ </t>
</xpath>
</template>