From 8694a48ef1a3e251a91d57b878d188503523aa84 Mon Sep 17 00:00:00 2001 From: "chm@openerp.com" <> Date: Mon, 10 Mar 2014 15:19:47 +0100 Subject: [PATCH] [IMP] website: use mailto for share snippet insead of mail form bzr revid: chm@openerp.com-20140310141947-zs9ltuzx48k5ej5x --- addons/website/controllers/main.py | 8 ---- .../static/src/js/website.snippets.animation.js | 21 ++------- addons/website/views/snippets.xml | 49 -------------------- 3 files changed, 3 insertions(+), 75 deletions(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index b155317..95c7ad8 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -378,14 +378,6 @@ class Website(openerp.addons.web.controllers.main.Home): del response.headers['Content-Length'] return response - - @http.route(['/website/current_user/'], type='json', auth="public", website=True) - def get_current_user(self, fields): - cr, uid, context = request.cr, request.uid, request.context - if request.registry["website"].get_public_user(cr, uid, context=context) != uid: - return request.registry["res.users"].read(cr, openerp.SUPERUSER_ID, [uid], fields, context=context)[0] - else: - return None #------------------------------------------------------ # Server actions diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js index 173cdf3..8d7b634 100644 --- a/addons/website/static/src/js/website.snippets.animation.js +++ b/addons/website/static/src/js/website.snippets.animation.js @@ -143,25 +143,10 @@ "https://plus.google.com/share?url="+url); this.$target.find("a").click(function () { window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600'); + return false; }); - - var $modal = this.$target.find(".oe_share_mail_modal"); - var $from = $modal.find("input[name='from']").parent().parent(); - this.$target.find(".oe_share_mail").off("click").click(function () { - // open popover - $modal.modal("show"); - }); - $modal.find("input[name='url']").attr("value", window.location.href); - openerp.jsonRpc('/website/current_user/', 'call', { - fields: ["email"] - }).then(function (result) { - if (result) $from.addClass("hidden"); - else $from.removeClass("hidden"); - }); - $modal.find(".btn-primary").click(function () { - $modal.modal("hide"); - console.log("valid"); - }); + this.$target.find(".oe_share_mail").attr("href", + "mailto:?body="+url+"&subject="+title).off("click"); }, }); })(); diff --git a/addons/website/views/snippets.xml b/addons/website/views/snippets.xml index f592286..3586133 100644 --- a/addons/website/views/snippets.xml +++ b/addons/website/views/snippets.xml @@ -351,55 +351,6 @@ - - - -- 1.7.10.4