{"action":"created","comment":{"url":"https://api.github.com/repos/OCA/website/pulls/comments/33812904","id":33812904,"diff_hunk":"@@ -0,0 +1,57 @@\n+# -*- coding: utf-8 -*-\n+# Python source code encoding : https://www.python.org/dev/peps/pep-0263/\n+##############################################################################\n+#\n+#    OpenERP, Open Source Management Solution\n+#    This module copyright :\n+#        (c) 2015 Antiun Ingenieria, SL (Madrid, Spain, http://www.antiun.com)\n+#                 Endika Iglesias <endikaig@antiun.com>\n+#\n+#    This program is free software: you can redistribute it and/or modify\n+#    it under the terms of the GNU Affero General Public License as\n+#    published by the Free Software Foundation, either version 3 of the\n+#    License, or (at your option) any later version.\n+#\n+#    This program is distributed in the hope that it will be useful,\n+#    but WITHOUT ANY WARRANTY; without even the implied warranty of\n+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+#    GNU Affero General Public License for more details.\n+#\n+#    You should have received a copy of the GNU Affero General Public License\n+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+#\n+##############################################################################\n+\n+from openerp.addons.web import http\n+from openerp.addons.website_blog.controllers.main import WebsiteBlog\n+from openerp.http import request\n+from openerp.addons.website.models.website import slug\n+\n+\n+class WebsiteBlog(WebsiteBlog):\n+\n+    def _base_url(self):\n+        config_pool = request.registry['ir.config_parameter']\n+        base_url = config_pool.get_param(\n+            request.cr, request.uid,\n+            'web.base.url', default=False)\n+        if base_url is False or len(base_url) <= 0:\n+            return False\n+        return base_url\n+\n+    @http.route([\n+        \"\"\"/blog/<model('blog.blog'):blog>/post/\"\"\"\n+        \"\"\"<model('blog.post', '[(\"blog_id\",\"=\", \"blog[0]\")]'):blog_post>\"\"\"],\n+        type='http', auth=\"public\", website=True)\n+    def blog_post(self, blog, blog_post,\n+                  tag_id=None, page=1, enable_editor=None, **post):\n+        response = super(WebsiteBlog, self).blog_post(\n+            blog, blog_post, tag_id=None, page=1, enable_editor=None, **post)\n+        response.qcontext['appId'] = request.website.facebook_appid\n+        response.qcontext['lang'] = request.context['lang']\n+        response.qcontext['numposts'] = request.website.facebook_numposts\n+        base_url = (self._base_url() + '/blog/' +\n+                    str(slug(response.qcontext['blog'])) + '/post/' +\n+                    str(slug(response.qcontext['blog_post'])))\n+        response.qcontext['base_url'] = base_url","path":"website_blog_facebook_comment/controllers/main.py","position":56,"original_position":56,"commit_id":"4cb3d792de204da29ca5f85a612bd77937f0cdf7","original_commit_id":"4cb3d792de204da29ca5f85a612bd77937f0cdf7","user":{"login":"pedrobaeza","id":7165771,"avatar_url":"https://avatars.githubusercontent.com/u/7165771?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrobaeza","html_url":"https://github.com/pedrobaeza","followers_url":"https://api.github.com/users/pedrobaeza/followers","following_url":"https://api.github.com/users/pedrobaeza/following{/other_user}","gists_url":"https://api.github.com/users/pedrobaeza/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrobaeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrobaeza/subscriptions","organizations_url":"https://api.github.com/users/pedrobaeza/orgs","repos_url":"https://api.github.com/users/pedrobaeza/repos","events_url":"https://api.github.com/users/pedrobaeza/events{/privacy}","received_events_url":"https://api.github.com/users/pedrobaeza/received_events","type":"User","site_admin":false},"body":"For what is this needed? You can obtain the current full URL querying request variable","created_at":"2015-07-02T19:19:10Z","updated_at":"2015-07-02T19:19:10Z","html_url":"https://github.com/OCA/website/pull/50#discussion_r33812904","pull_request_url":"https://api.github.com/repos/OCA/website/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/OCA/website/pulls/comments/33812904"},"html":{"href":"https://github.com/OCA/website/pull/50#discussion_r33812904"},"pull_request":{"href":"https://api.github.com/repos/OCA/website/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/OCA/website/pulls/50","id":38988630,"html_url":"https://github.com/OCA/website/pull/50","diff_url":"https://github.com/OCA/website/pull/50.diff","patch_url":"https://github.com/OCA/website/pull/50.patch","issue_url":"https://api.github.com/repos/OCA/website/issues/50","number":50,"state":"open","locked":false,"title":"[ADD] new addon website_blog_facebook_comment","user":{"login":"Endika","id":568585,"avatar_url":"https://avatars.githubusercontent.com/u/568585?v=3","gravatar_id":"","url":"https://api.github.com/users/Endika","html_url":"https://github.com/Endika","followers_url":"https://api.github.com/users/Endika/followers","following_url":"https://api.github.com/users/Endika/following{/other_user}","gists_url":"https://api.github.com/users/Endika/gists{/gist_id}","starred_url":"https://api.github.com/users/Endika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Endika/subscriptions","organizations_url":"https://api.github.com/users/Endika/orgs","repos_url":"https://api.github.com/users/Endika/repos","events_url":"https://api.github.com/users/Endika/events{/privacy}","received_events_url":"https://api.github.com/users/Endika/received_events","type":"User","site_admin":false},"body":"Blog with Facebook comment\r\n==========================\r\n\r\nThis module add facebook comments in blog post.","created_at":"2015-07-01T14:37:53Z","updated_at":"2015-07-02T19:19:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d92659434302d7ee806ec9f8d7e4ad1508fa059","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OCA/website/pulls/50/commits","review_comments_url":"https://api.github.com/repos/OCA/website/pulls/50/comments","review_comment_url":"https://api.github.com/repos/OCA/website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OCA/website/issues/50/comments","statuses_url":"https://api.github.com/repos/OCA/website/statuses/4cb3d792de204da29ca5f85a612bd77937f0cdf7","head":{"label":"Antiun:pr-website_blog_facebook_comment","ref":"pr-website_blog_facebook_comment","sha":"4cb3d792de204da29ca5f85a612bd77937f0cdf7","user":{"login":"Antiun","id":8735718,"avatar_url":"https://avatars.githubusercontent.com/u/8735718?v=3","gravatar_id":"","url":"https://api.github.com/users/Antiun","html_url":"https://github.com/Antiun","followers_url":"https://api.github.com/users/Antiun/followers","following_url":"https://api.github.com/users/Antiun/following{/other_user}","gists_url":"https://api.github.com/users/Antiun/gists{/gist_id}","starred_url":"https://api.github.com/users/Antiun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antiun/subscriptions","organizations_url":"https://api.github.com/users/Antiun/orgs","repos_url":"https://api.github.com/users/Antiun/repos","events_url":"https://api.github.com/users/Antiun/events{/privacy}","received_events_url":"https://api.github.com/users/Antiun/received_events","type":"Organization","site_admin":false},"repo":{"id":30604094,"name":"website","full_name":"Antiun/website","owner":{"login":"Antiun","id":8735718,"avatar_url":"https://avatars.githubusercontent.com/u/8735718?v=3","gravatar_id":"","url":"https://api.github.com/users/Antiun","html_url":"https://github.com/Antiun","followers_url":"https://api.github.com/users/Antiun/followers","following_url":"https://api.github.com/users/Antiun/following{/other_user}","gists_url":"https://api.github.com/users/Antiun/gists{/gist_id}","starred_url":"https://api.github.com/users/Antiun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antiun/subscriptions","organizations_url":"https://api.github.com/users/Antiun/orgs","repos_url":"https://api.github.com/users/Antiun/repos","events_url":"https://api.github.com/users/Antiun/events{/privacy}","received_events_url":"https://api.github.com/users/Antiun/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Antiun/website","description":"","fork":true,"url":"https://api.github.com/repos/Antiun/website","forks_url":"https://api.github.com/repos/Antiun/website/forks","keys_url":"https://api.github.com/repos/Antiun/website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Antiun/website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Antiun/website/teams","hooks_url":"https://api.github.com/repos/Antiun/website/hooks","issue_events_url":"https://api.github.com/repos/Antiun/website/issues/events{/number}","events_url":"https://api.github.com/repos/Antiun/website/events","assignees_url":"https://api.github.com/repos/Antiun/website/assignees{/user}","branches_url":"https://api.github.com/repos/Antiun/website/branches{/branch}","tags_url":"https://api.github.com/repos/Antiun/website/tags","blobs_url":"https://api.github.com/repos/Antiun/website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Antiun/website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Antiun/website/git/refs{/sha}","trees_url":"https://api.github.com/repos/Antiun/website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Antiun/website/statuses/{sha}","languages_url":"https://api.github.com/repos/Antiun/website/languages","stargazers_url":"https://api.github.com/repos/Antiun/website/stargazers","contributors_url":"https://api.github.com/repos/Antiun/website/contributors","subscribers_url":"https://api.github.com/repos/Antiun/website/subscribers","subscription_url":"https://api.github.com/repos/Antiun/website/subscription","commits_url":"https://api.github.com/repos/Antiun/website/commits{/sha}","git_commits_url":"https://api.github.com/repos/Antiun/website/git/commits{/sha}","comments_url":"https://api.github.com/repos/Antiun/website/comments{/number}","issue_comment_url":"https://api.github.com/repos/Antiun/website/issues/comments{/number}","contents_url":"https://api.github.com/repos/Antiun/website/contents/{+path}","compare_url":"https://api.github.com/repos/Antiun/website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Antiun/website/merges","archive_url":"https://api.github.com/repos/Antiun/website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Antiun/website/downloads","issues_url":"https://api.github.com/repos/Antiun/website/issues{/number}","pulls_url":"https://api.github.com/repos/Antiun/website/pulls{/number}","milestones_url":"https://api.github.com/repos/Antiun/website/milestones{/number}","notifications_url":"https://api.github.com/repos/Antiun/website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Antiun/website/labels{/name}","releases_url":"https://api.github.com/repos/Antiun/website/releases{/id}","created_at":"2015-02-10T17:22:19Z","updated_at":"2015-05-08T11:45:58Z","pushed_at":"2015-07-02T14:44:17Z","git_url":"git://github.com/Antiun/website.git","ssh_url":"git@github.com:Antiun/website.git","clone_url":"https://github.com/Antiun/website.git","svn_url":"https://github.com/Antiun/website","homepage":null,"size":533,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"8.0"}},"base":{"label":"OCA:8.0","ref":"8.0","sha":"9e91a03bd1f9ba4dfce5d8dd1cbc78f3902a0ba4","user":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"repo":{"id":21942491,"name":"website","full_name":"OCA/website","owner":{"login":"OCA","id":7600578,"avatar_url":"https://avatars.githubusercontent.com/u/7600578?v=3","gravatar_id":"","url":"https://api.github.com/users/OCA","html_url":"https://github.com/OCA","followers_url":"https://api.github.com/users/OCA/followers","following_url":"https://api.github.com/users/OCA/following{/other_user}","gists_url":"https://api.github.com/users/OCA/gists{/gist_id}","starred_url":"https://api.github.com/users/OCA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OCA/subscriptions","organizations_url":"https://api.github.com/users/OCA/orgs","repos_url":"https://api.github.com/users/OCA/repos","events_url":"https://api.github.com/users/OCA/events{/privacy}","received_events_url":"https://api.github.com/users/OCA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OCA/website","description":"Odoo website and website_sale builder Addons","fork":false,"url":"https://api.github.com/repos/OCA/website","forks_url":"https://api.github.com/repos/OCA/website/forks","keys_url":"https://api.github.com/repos/OCA/website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OCA/website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OCA/website/teams","hooks_url":"https://api.github.com/repos/OCA/website/hooks","issue_events_url":"https://api.github.com/repos/OCA/website/issues/events{/number}","events_url":"https://api.github.com/repos/OCA/website/events","assignees_url":"https://api.github.com/repos/OCA/website/assignees{/user}","branches_url":"https://api.github.com/repos/OCA/website/branches{/branch}","tags_url":"https://api.github.com/repos/OCA/website/tags","blobs_url":"https://api.github.com/repos/OCA/website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OCA/website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OCA/website/git/refs{/sha}","trees_url":"https://api.github.com/repos/OCA/website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OCA/website/statuses/{sha}","languages_url":"https://api.github.com/repos/OCA/website/languages","stargazers_url":"https://api.github.com/repos/OCA/website/stargazers","contributors_url":"https://api.github.com/repos/OCA/website/contributors","subscribers_url":"https://api.github.com/repos/OCA/website/subscribers","subscription_url":"https://api.github.com/repos/OCA/website/subscription","commits_url":"https://api.github.com/repos/OCA/website/commits{/sha}","git_commits_url":"https://api.github.com/repos/OCA/website/git/commits{/sha}","comments_url":"https://api.github.com/repos/OCA/website/comments{/number}","issue_comment_url":"https://api.github.com/repos/OCA/website/issues/comments{/number}","contents_url":"https://api.github.com/repos/OCA/website/contents/{+path}","compare_url":"https://api.github.com/repos/OCA/website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OCA/website/merges","archive_url":"https://api.github.com/repos/OCA/website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OCA/website/downloads","issues_url":"https://api.github.com/repos/OCA/website/issues{/number}","pulls_url":"https://api.github.com/repos/OCA/website/pulls{/number}","milestones_url":"https://api.github.com/repos/OCA/website/milestones{/number}","notifications_url":"https://api.github.com/repos/OCA/website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OCA/website/labels{/name}","releases_url":"https://api.github.com/repos/OCA/website/releases{/id}","created_at":"2014-07-17T13:16:54Z","updated_at":"2015-06-30T01:20:02Z","pushed_at":"2015-07-02T15:29:39Z","git_url":"git://github.com/OCA/website.git","ssh_url":"git@github.com:OCA/website.git","clone_url":"https://github.com/OCA/website.git","svn_url":"https://github.com/OCA/website","homepage":"","size":7138,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":24,"forks":43,"open_issues":24,"watchers":11,"default_branch":"8.0"}},"_links":{"self":{"href":"https://api.github.com/repos/OCA/website/pulls/50"},"html":{"href":"https://github.com/OCA/website/pull/50"},"issue":{"href":"https://api.github.com/repos/OCA/website/issues/50"},"comments":{"href":"https://api.github.com/repos/OCA/website/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/OCA/website/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/OCA/website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OCA/website/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/OCA/website/statuses/4cb3d792de204da29ca5f85a612bd77937f0cdf7"}}}}