{"action":"created","comment":{"url":"https://api.github.com/repos/shoopio/shoop/pulls/comments/50369528","id":50369528,"diff_hunk":"@@ -0,0 +1,43 @@\n+# -*- coding: utf-8 -*-\n+# This file is part of Shoop.\n+#\n+# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.\n+#\n+# This source code is licensed under the AGPLv3 license found in the\n+# LICENSE file in the root directory of this source tree.\n+from __future__ import unicode_literals\n+\n+from django.core.urlresolvers import reverse\n+from django.utils.translation import ugettext_lazy as _\n+\n+from shoop.admin.toolbar import DropdownActionButton, DropdownItem\n+\n+\n+class SimplePrintoutsToolbarButton(DropdownActionButton):\n+    def __init__(self, order, **kwargs):\n+        self.split_button = None\n+        kwargs[\"icon\"] = \"fa fa-print\"\n+        kwargs[\"text\"] = _(\"Print\")\n+        kwargs[\"extra_css_class\"] = \"btn-info\"\n+        self.order = order\n+        self.items = self.get_menu_items()\n+        super(SimplePrintoutsToolbarButton, self).__init__(self.items, **kwargs)\n+\n+    def get_menu_items(self):\n+        shipment_items = []\n+        for shipment_id in self.order.shipments.values_list(\"pk\", flat=True):\n+            shipment_items.append(\n+                DropdownItem(\n+                    text=_(\"PDF delivery slip %(id)s\" % {\"id\": shipment_id}),","path":"shoop/printouts/admin_module/toolbar.py","position":31,"original_position":31,"commit_id":"a6f124ac11d8d750c7cc70fa90a6336540dfbb56","original_commit_id":"a6f124ac11d8d750c7cc70fa90a6336540dfbb56","user":{"login":"akx","id":58669,"avatar_url":"https://avatars.githubusercontent.com/u/58669?v=3","gravatar_id":"","url":"https://api.github.com/users/akx","html_url":"https://github.com/akx","followers_url":"https://api.github.com/users/akx/followers","following_url":"https://api.github.com/users/akx/following{/other_user}","gists_url":"https://api.github.com/users/akx/gists{/gist_id}","starred_url":"https://api.github.com/users/akx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akx/subscriptions","organizations_url":"https://api.github.com/users/akx/orgs","repos_url":"https://api.github.com/users/akx/repos","events_url":"https://api.github.com/users/akx/events{/privacy}","received_events_url":"https://api.github.com/users/akx/received_events","type":"User","site_admin":false},"body":"Verbs for menu items maybe? `\"Get Delivery Slip (Shipment %(id)s)\"`\r\n\r\nAlso, the % interpolation must happen outside of the `_()` call.\r\n\r\n","created_at":"2016-01-21T07:56:32Z","updated_at":"2016-01-21T07:56:32Z","html_url":"https://github.com/shoopio/shoop/pull/321#discussion_r50369528","pull_request_url":"https://api.github.com/repos/shoopio/shoop/pulls/321","_links":{"self":{"href":"https://api.github.com/repos/shoopio/shoop/pulls/comments/50369528"},"html":{"href":"https://github.com/shoopio/shoop/pull/321#discussion_r50369528"},"pull_request":{"href":"https://api.github.com/repos/shoopio/shoop/pulls/321"}}},"pull_request":{"url":"https://api.github.com/repos/shoopio/shoop/pulls/321","id":56662429,"html_url":"https://github.com/shoopio/shoop/pull/321","diff_url":"https://github.com/shoopio/shoop/pull/321.diff","patch_url":"https://github.com/shoopio/shoop/pull/321.patch","issue_url":"https://api.github.com/repos/shoopio/shoop/issues/321","number":321,"state":"open","locked":false,"title":"Simple printouts with weasyprint","user":{"login":"tulimaki","id":4940349,"avatar_url":"https://avatars.githubusercontent.com/u/4940349?v=3","gravatar_id":"","url":"https://api.github.com/users/tulimaki","html_url":"https://github.com/tulimaki","followers_url":"https://api.github.com/users/tulimaki/followers","following_url":"https://api.github.com/users/tulimaki/following{/other_user}","gists_url":"https://api.github.com/users/tulimaki/gists{/gist_id}","starred_url":"https://api.github.com/users/tulimaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tulimaki/subscriptions","organizations_url":"https://api.github.com/users/tulimaki/orgs","repos_url":"https://api.github.com/users/tulimaki/repos","events_url":"https://api.github.com/users/tulimaki/events{/privacy}","received_events_url":"https://api.github.com/users/tulimaki/received_events","type":"User","site_admin":false},"body":"* Enhance order admin\r\n* Add contact address for shop\r\n* Add printouts for orders\r\n\r\nRefs SHOOP-1767","created_at":"2016-01-20T20:28:09Z","updated_at":"2016-01-21T07:56:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fa71dbd6f25fad39958f962d03c93f9ab8150a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shoopio/shoop/pulls/321/commits","review_comments_url":"https://api.github.com/repos/shoopio/shoop/pulls/321/comments","review_comment_url":"https://api.github.com/repos/shoopio/shoop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shoopio/shoop/issues/321/comments","statuses_url":"https://api.github.com/repos/shoopio/shoop/statuses/a6f124ac11d8d750c7cc70fa90a6336540dfbb56","head":{"label":"tulimaki:simple-printouts-with-weasyprint","ref":"simple-printouts-with-weasyprint","sha":"a6f124ac11d8d750c7cc70fa90a6336540dfbb56","user":{"login":"tulimaki","id":4940349,"avatar_url":"https://avatars.githubusercontent.com/u/4940349?v=3","gravatar_id":"","url":"https://api.github.com/users/tulimaki","html_url":"https://github.com/tulimaki","followers_url":"https://api.github.com/users/tulimaki/followers","following_url":"https://api.github.com/users/tulimaki/following{/other_user}","gists_url":"https://api.github.com/users/tulimaki/gists{/gist_id}","starred_url":"https://api.github.com/users/tulimaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tulimaki/subscriptions","organizations_url":"https://api.github.com/users/tulimaki/orgs","repos_url":"https://api.github.com/users/tulimaki/repos","events_url":"https://api.github.com/users/tulimaki/events{/privacy}","received_events_url":"https://api.github.com/users/tulimaki/received_events","type":"User","site_admin":false},"repo":{"id":41303409,"name":"shoop","full_name":"tulimaki/shoop","owner":{"login":"tulimaki","id":4940349,"avatar_url":"https://avatars.githubusercontent.com/u/4940349?v=3","gravatar_id":"","url":"https://api.github.com/users/tulimaki","html_url":"https://github.com/tulimaki","followers_url":"https://api.github.com/users/tulimaki/followers","following_url":"https://api.github.com/users/tulimaki/following{/other_user}","gists_url":"https://api.github.com/users/tulimaki/gists{/gist_id}","starred_url":"https://api.github.com/users/tulimaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tulimaki/subscriptions","organizations_url":"https://api.github.com/users/tulimaki/orgs","repos_url":"https://api.github.com/users/tulimaki/repos","events_url":"https://api.github.com/users/tulimaki/events{/privacy}","received_events_url":"https://api.github.com/users/tulimaki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tulimaki/shoop","description":"E-Commerce Platform","fork":true,"url":"https://api.github.com/repos/tulimaki/shoop","forks_url":"https://api.github.com/repos/tulimaki/shoop/forks","keys_url":"https://api.github.com/repos/tulimaki/shoop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tulimaki/shoop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tulimaki/shoop/teams","hooks_url":"https://api.github.com/repos/tulimaki/shoop/hooks","issue_events_url":"https://api.github.com/repos/tulimaki/shoop/issues/events{/number}","events_url":"https://api.github.com/repos/tulimaki/shoop/events","assignees_url":"https://api.github.com/repos/tulimaki/shoop/assignees{/user}","branches_url":"https://api.github.com/repos/tulimaki/shoop/branches{/branch}","tags_url":"https://api.github.com/repos/tulimaki/shoop/tags","blobs_url":"https://api.github.com/repos/tulimaki/shoop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tulimaki/shoop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tulimaki/shoop/git/refs{/sha}","trees_url":"https://api.github.com/repos/tulimaki/shoop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tulimaki/shoop/statuses/{sha}","languages_url":"https://api.github.com/repos/tulimaki/shoop/languages","stargazers_url":"https://api.github.com/repos/tulimaki/shoop/stargazers","contributors_url":"https://api.github.com/repos/tulimaki/shoop/contributors","subscribers_url":"https://api.github.com/repos/tulimaki/shoop/subscribers","subscription_url":"https://api.github.com/repos/tulimaki/shoop/subscription","commits_url":"https://api.github.com/repos/tulimaki/shoop/commits{/sha}","git_commits_url":"https://api.github.com/repos/tulimaki/shoop/git/commits{/sha}","comments_url":"https://api.github.com/repos/tulimaki/shoop/comments{/number}","issue_comment_url":"https://api.github.com/repos/tulimaki/shoop/issues/comments{/number}","contents_url":"https://api.github.com/repos/tulimaki/shoop/contents/{+path}","compare_url":"https://api.github.com/repos/tulimaki/shoop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tulimaki/shoop/merges","archive_url":"https://api.github.com/repos/tulimaki/shoop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tulimaki/shoop/downloads","issues_url":"https://api.github.com/repos/tulimaki/shoop/issues{/number}","pulls_url":"https://api.github.com/repos/tulimaki/shoop/pulls{/number}","milestones_url":"https://api.github.com/repos/tulimaki/shoop/milestones{/number}","notifications_url":"https://api.github.com/repos/tulimaki/shoop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tulimaki/shoop/labels{/name}","releases_url":"https://api.github.com/repos/tulimaki/shoop/releases{/id}","created_at":"2015-08-24T13:04:05Z","updated_at":"2016-01-12T06:01:42Z","pushed_at":"2016-01-20T20:40:29Z","git_url":"git://github.com/tulimaki/shoop.git","ssh_url":"git@github.com:tulimaki/shoop.git","clone_url":"https://github.com/tulimaki/shoop.git","svn_url":"https://github.com/tulimaki/shoop","homepage":"https://shoop.io","size":5108,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"shoopio:master","ref":"master","sha":"347ecf550bde8ccbbf1a2c902751fa6832f9a390","user":{"login":"shoopio","id":12714852,"avatar_url":"https://avatars.githubusercontent.com/u/12714852?v=3","gravatar_id":"","url":"https://api.github.com/users/shoopio","html_url":"https://github.com/shoopio","followers_url":"https://api.github.com/users/shoopio/followers","following_url":"https://api.github.com/users/shoopio/following{/other_user}","gists_url":"https://api.github.com/users/shoopio/gists{/gist_id}","starred_url":"https://api.github.com/users/shoopio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoopio/subscriptions","organizations_url":"https://api.github.com/users/shoopio/orgs","repos_url":"https://api.github.com/users/shoopio/repos","events_url":"https://api.github.com/users/shoopio/events{/privacy}","received_events_url":"https://api.github.com/users/shoopio/received_events","type":"Organization","site_admin":false},"repo":{"id":36803364,"name":"shoop","full_name":"shoopio/shoop","owner":{"login":"shoopio","id":12714852,"avatar_url":"https://avatars.githubusercontent.com/u/12714852?v=3","gravatar_id":"","url":"https://api.github.com/users/shoopio","html_url":"https://github.com/shoopio","followers_url":"https://api.github.com/users/shoopio/followers","following_url":"https://api.github.com/users/shoopio/following{/other_user}","gists_url":"https://api.github.com/users/shoopio/gists{/gist_id}","starred_url":"https://api.github.com/users/shoopio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoopio/subscriptions","organizations_url":"https://api.github.com/users/shoopio/orgs","repos_url":"https://api.github.com/users/shoopio/repos","events_url":"https://api.github.com/users/shoopio/events{/privacy}","received_events_url":"https://api.github.com/users/shoopio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shoopio/shoop","description":"E-Commerce Platform","fork":false,"url":"https://api.github.com/repos/shoopio/shoop","forks_url":"https://api.github.com/repos/shoopio/shoop/forks","keys_url":"https://api.github.com/repos/shoopio/shoop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shoopio/shoop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shoopio/shoop/teams","hooks_url":"https://api.github.com/repos/shoopio/shoop/hooks","issue_events_url":"https://api.github.com/repos/shoopio/shoop/issues/events{/number}","events_url":"https://api.github.com/repos/shoopio/shoop/events","assignees_url":"https://api.github.com/repos/shoopio/shoop/assignees{/user}","branches_url":"https://api.github.com/repos/shoopio/shoop/branches{/branch}","tags_url":"https://api.github.com/repos/shoopio/shoop/tags","blobs_url":"https://api.github.com/repos/shoopio/shoop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shoopio/shoop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shoopio/shoop/git/refs{/sha}","trees_url":"https://api.github.com/repos/shoopio/shoop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shoopio/shoop/statuses/{sha}","languages_url":"https://api.github.com/repos/shoopio/shoop/languages","stargazers_url":"https://api.github.com/repos/shoopio/shoop/stargazers","contributors_url":"https://api.github.com/repos/shoopio/shoop/contributors","subscribers_url":"https://api.github.com/repos/shoopio/shoop/subscribers","subscription_url":"https://api.github.com/repos/shoopio/shoop/subscription","commits_url":"https://api.github.com/repos/shoopio/shoop/commits{/sha}","git_commits_url":"https://api.github.com/repos/shoopio/shoop/git/commits{/sha}","comments_url":"https://api.github.com/repos/shoopio/shoop/comments{/number}","issue_comment_url":"https://api.github.com/repos/shoopio/shoop/issues/comments{/number}","contents_url":"https://api.github.com/repos/shoopio/shoop/contents/{+path}","compare_url":"https://api.github.com/repos/shoopio/shoop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shoopio/shoop/merges","archive_url":"https://api.github.com/repos/shoopio/shoop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shoopio/shoop/downloads","issues_url":"https://api.github.com/repos/shoopio/shoop/issues{/number}","pulls_url":"https://api.github.com/repos/shoopio/shoop/pulls{/number}","milestones_url":"https://api.github.com/repos/shoopio/shoop/milestones{/number}","notifications_url":"https://api.github.com/repos/shoopio/shoop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shoopio/shoop/labels{/name}","releases_url":"https://api.github.com/repos/shoopio/shoop/releases{/id}","created_at":"2015-06-03T12:53:21Z","updated_at":"2016-01-20T23:43:02Z","pushed_at":"2016-01-21T02:04:49Z","git_url":"git://github.com/shoopio/shoop.git","ssh_url":"git@github.com:shoopio/shoop.git","clone_url":"https://github.com/shoopio/shoop.git","svn_url":"https://github.com/shoopio/shoop","homepage":"https://shoop.io","size":7739,"stargazers_count":255,"watchers_count":255,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":83,"mirror_url":null,"open_issues_count":16,"forks":83,"open_issues":16,"watchers":255,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shoopio/shoop/pulls/321"},"html":{"href":"https://github.com/shoopio/shoop/pull/321"},"issue":{"href":"https://api.github.com/repos/shoopio/shoop/issues/321"},"comments":{"href":"https://api.github.com/repos/shoopio/shoop/issues/321/comments"},"review_comments":{"href":"https://api.github.com/repos/shoopio/shoop/pulls/321/comments"},"review_comment":{"href":"https://api.github.com/repos/shoopio/shoop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shoopio/shoop/pulls/321/commits"},"statuses":{"href":"https://api.github.com/repos/shoopio/shoop/statuses/a6f124ac11d8d750c7cc70fa90a6336540dfbb56"}}}}