summaryrefslogtreecommitdiff
path: root/addons/website_customer
diff options
context:
space:
mode:
authorRichard Mathot <rim@openerp.com>2014-06-03 16:34:30 +0200
committerRichard Mathot <rim@openerp.com>2014-06-03 16:34:30 +0200
commitf04e6de2e729c8d638f6589f77abdfa4535b110e (patch)
tree378d9d126eb95938c63f03fc539256e6924cbc3c /addons/website_customer
parentc1ae43c80764fafd154f09bbff4c12543e881609 (diff)
[FIX][IMP] Make partner maps work properly
[FIX] website*: unfuck buggy controllers [IMP] website*: display GoogleMap in a human-usable interface [IMP] website_google_map: large module cleaning - There is now only one controller, data is sent once for all! - Map is now fully resizable in its hosting template - HTML/CSS cleaning - JavaScript is now human-readable ;-)
Diffstat (limited to 'addons/website_customer')
-rw-r--r--addons/website_customer/controllers/main.py2
-rw-r--r--addons/website_customer/views/website_customer.xml24
2 files changed, 21 insertions, 5 deletions
diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py
index 3e396f23fcf..6310fe4986d 100644
--- a/addons/website_customer/controllers/main.py
+++ b/addons/website_customer/controllers/main.py
@@ -84,7 +84,7 @@ class WebsiteCustomer(http.Controller):
# Do not use semantic controller due to SUPERUSER_ID
@http.route(['/customers/<partner_id>'], type='http', auth="public", website=True)
def partners_detail(self, partner_id, **post):
- mo = re.search('-([-0-9]+)$', str(partner_id))
+ mo = re.search('([-0-9]+)$', str(partner_id))
if mo:
partner_id = int(mo.group(1))
partner = request.registry['res.partner'].browse(request.cr, SUPERUSER_ID, partner_id, context=request.context)
diff --git a/addons/website_customer/views/website_customer.xml b/addons/website_customer/views/website_customer.xml
index f9bdea2d72b..db64eb916f4 100644
--- a/addons/website_customer/views/website_customer.xml
+++ b/addons/website_customer/views/website_customer.xml
@@ -66,11 +66,27 @@
</template>
<!-- Option: left column: World Map -->
-<template id="opt_country" inherit_id="website_customer.index" optional="disabled" name="Show Map">
+<template id="opt_country" inherit_id="website_customer.index" optional="enabled" name="Show Map">
<xpath expr="//div[@id='ref_left_column']" position="inside">
-
- <iframe t-attf-src="/google_map/?partner_ids=#{ google_map_partner_ids }&amp;partner_url=/customers/&amp;output=embed"
- style="width:100%; border:0; padding:0; margin:0;"></iframe>
+ <!-- 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>
+ </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;"></iframe>
+ </ul>
</xpath>
</template>