{"action":"created","comment":{"url":"https://api.github.com/repos/hasgeek/boxoffice/pulls/comments/108251994","pull_request_review_id":29271729,"id":108251994,"diff_hunk":"@@ -105,6 +109,93 @@ export const OrderView = {\n         }\n       });\n \n+      main_ractive.on('showRefundForm', function(event){\n+        //Close all other open side panels\n+        main_ractive.set('orders.*.showRefundForm', false);\n+        //Show individual order\n+        main_ractive.set(event.keypath + '.showRefundForm', true);\n+        let order_id = event.context.id;\n+        let ractive_id = \"#\" + main_ractive.el.id;\n+        scrollToElement(ractive_id);\n+      });\n+\n+      main_ractive.on('refundOrder', function(event, method) {\n+        let order = event.keypath,\n+          orderId = event.context.id,\n+          refundFormName = 'order-refund-form-' + orderId,\n+          refundUrl = event.context.refund_url,\n+          validationConfig = [{\n+              name: 'amount',\n+              rules: 'required|is_natural_no_zero'\n+            },\n+            {\n+              name: 'internal_note',\n+              rules: 'required'\n+            },\n+            {\n+              name: 'refund_description',\n+              rules: 'required'\n+            },\n+            {\n+              name: 'note_to_user',\n+              rules: 'required'\n+            }\n+          ];\n+\n+        let formValidator = new FormValidator(refundFormName, validationConfig, function (errors, event) {\n+          event.preventDefault();\n+          main_ractive.set(order + '.refund.errormsg.*', \"\");\n+          main_ractive.set(order + '.refund.status', \"\");\n+          if (errors.length > 0) {\n+            main_ractive.set(order + '.refund.errormsg.'+ errors[0].name, errors[0].message);\n+          } else {\n+          \tmain_ractive.set(order + '.refund.errormsg.*', \"\");\n+            let formSelector = '#refund-form-' + orderId;\n+\n+            if (window.confirm(\"Are you sure you want to refund this ticket?\")) {\n+              main_ractive.set(order + '.refunding', true);\n+              OrderModel.post({\n+                url: refundUrl,\n+                data: getFormParameters(formSelector),\n+                json: false\n+              }).done(function(response) {\n+              \tmain_ractive.set(order + '.refunding', false);\n+              \t//Update refund status\n+                main_ractive.set(order + '.refund.status', response.result.message);\n+              \t//Update the order net total\n+                main_ractive.set(order + '.net_amount', response.result.order_net_amount);","path":"boxoffice/static/js/views/admin_order.js","position":78,"original_position":78,"commit_id":"22ff361ce3a0a45806bb02768eced1e7d907af52","original_commit_id":"22ff361ce3a0a45806bb02768eced1e7d907af52","user":{"login":"shreyas-satish","id":380688,"avatar_url":"https://avatars1.githubusercontent.com/u/380688?v=3","gravatar_id":"","url":"https://api.github.com/users/shreyas-satish","html_url":"https://github.com/shreyas-satish","followers_url":"https://api.github.com/users/shreyas-satish/followers","following_url":"https://api.github.com/users/shreyas-satish/following{/other_user}","gists_url":"https://api.github.com/users/shreyas-satish/gists{/gist_id}","starred_url":"https://api.github.com/users/shreyas-satish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shreyas-satish/subscriptions","organizations_url":"https://api.github.com/users/shreyas-satish/orgs","repos_url":"https://api.github.com/users/shreyas-satish/repos","events_url":"https://api.github.com/users/shreyas-satish/events{/privacy}","received_events_url":"https://api.github.com/users/shreyas-satish/received_events","type":"User","site_admin":false},"body":"Can all these values be set in one call?","created_at":"2017-03-27T18:59:08Z","updated_at":"2017-03-27T18:59:08Z","html_url":"https://github.com/hasgeek/boxoffice/pull/140#discussion_r108251994","pull_request_url":"https://api.github.com/repos/hasgeek/boxoffice/pulls/140","_links":{"self":{"href":"https://api.github.com/repos/hasgeek/boxoffice/pulls/comments/108251994"},"html":{"href":"https://github.com/hasgeek/boxoffice/pull/140#discussion_r108251994"},"pull_request":{"href":"https://api.github.com/repos/hasgeek/boxoffice/pulls/140"}}},"pull_request":{"url":"https://api.github.com/repos/hasgeek/boxoffice/pulls/140","id":112699948,"html_url":"https://github.com/hasgeek/boxoffice/pull/140","diff_url":"https://github.com/hasgeek/boxoffice/pull/140.diff","patch_url":"https://github.com/hasgeek/boxoffice/pull/140.patch","issue_url":"https://api.github.com/repos/hasgeek/boxoffice/issues/140","number":140,"state":"open","locked":false,"title":"Add UI for refund on admin orders page","user":{"login":"vidya-ram","id":11267213,"avatar_url":"https://avatars2.githubusercontent.com/u/11267213?v=3","gravatar_id":"","url":"https://api.github.com/users/vidya-ram","html_url":"https://github.com/vidya-ram","followers_url":"https://api.github.com/users/vidya-ram/followers","following_url":"https://api.github.com/users/vidya-ram/following{/other_user}","gists_url":"https://api.github.com/users/vidya-ram/gists{/gist_id}","starred_url":"https://api.github.com/users/vidya-ram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vidya-ram/subscriptions","organizations_url":"https://api.github.com/users/vidya-ram/orgs","repos_url":"https://api.github.com/users/vidya-ram/repos","events_url":"https://api.github.com/users/vidya-ram/events{/privacy}","received_events_url":"https://api.github.com/users/vidya-ram/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-03-27T09:16:17Z","updated_at":"2017-03-27T18:59:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4bac1e53c58175a534309ab0db723b947e276169","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hasgeek/boxoffice/pulls/140/commits","review_comments_url":"https://api.github.com/repos/hasgeek/boxoffice/pulls/140/comments","review_comment_url":"https://api.github.com/repos/hasgeek/boxoffice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hasgeek/boxoffice/issues/140/comments","statuses_url":"https://api.github.com/repos/hasgeek/boxoffice/statuses/22ff361ce3a0a45806bb02768eced1e7d907af52","head":{"label":"hasgeek:ui_for_refund","ref":"ui_for_refund","sha":"22ff361ce3a0a45806bb02768eced1e7d907af52","user":{"login":"hasgeek","id":443850,"avatar_url":"https://avatars1.githubusercontent.com/u/443850?v=3","gravatar_id":"","url":"https://api.github.com/users/hasgeek","html_url":"https://github.com/hasgeek","followers_url":"https://api.github.com/users/hasgeek/followers","following_url":"https://api.github.com/users/hasgeek/following{/other_user}","gists_url":"https://api.github.com/users/hasgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/hasgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasgeek/subscriptions","organizations_url":"https://api.github.com/users/hasgeek/orgs","repos_url":"https://api.github.com/users/hasgeek/repos","events_url":"https://api.github.com/users/hasgeek/events{/privacy}","received_events_url":"https://api.github.com/users/hasgeek/received_events","type":"Organization","site_admin":false},"repo":{"id":3188285,"name":"boxoffice","full_name":"hasgeek/boxoffice","owner":{"login":"hasgeek","id":443850,"avatar_url":"https://avatars1.githubusercontent.com/u/443850?v=3","gravatar_id":"","url":"https://api.github.com/users/hasgeek","html_url":"https://github.com/hasgeek","followers_url":"https://api.github.com/users/hasgeek/followers","following_url":"https://api.github.com/users/hasgeek/following{/other_user}","gists_url":"https://api.github.com/users/hasgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/hasgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasgeek/subscriptions","organizations_url":"https://api.github.com/users/hasgeek/orgs","repos_url":"https://api.github.com/users/hasgeek/repos","events_url":"https://api.github.com/users/hasgeek/events{/privacy}","received_events_url":"https://api.github.com/users/hasgeek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hasgeek/boxoffice","description":"Ticketing","fork":false,"url":"https://api.github.com/repos/hasgeek/boxoffice","forks_url":"https://api.github.com/repos/hasgeek/boxoffice/forks","keys_url":"https://api.github.com/repos/hasgeek/boxoffice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hasgeek/boxoffice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hasgeek/boxoffice/teams","hooks_url":"https://api.github.com/repos/hasgeek/boxoffice/hooks","issue_events_url":"https://api.github.com/repos/hasgeek/boxoffice/issues/events{/number}","events_url":"https://api.github.com/repos/hasgeek/boxoffice/events","assignees_url":"https://api.github.com/repos/hasgeek/boxoffice/assignees{/user}","branches_url":"https://api.github.com/repos/hasgeek/boxoffice/branches{/branch}","tags_url":"https://api.github.com/repos/hasgeek/boxoffice/tags","blobs_url":"https://api.github.com/repos/hasgeek/boxoffice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hasgeek/boxoffice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hasgeek/boxoffice/git/refs{/sha}","trees_url":"https://api.github.com/repos/hasgeek/boxoffice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hasgeek/boxoffice/statuses/{sha}","languages_url":"https://api.github.com/repos/hasgeek/boxoffice/languages","stargazers_url":"https://api.github.com/repos/hasgeek/boxoffice/stargazers","contributors_url":"https://api.github.com/repos/hasgeek/boxoffice/contributors","subscribers_url":"https://api.github.com/repos/hasgeek/boxoffice/subscribers","subscription_url":"https://api.github.com/repos/hasgeek/boxoffice/subscription","commits_url":"https://api.github.com/repos/hasgeek/boxoffice/commits{/sha}","git_commits_url":"https://api.github.com/repos/hasgeek/boxoffice/git/commits{/sha}","comments_url":"https://api.github.com/repos/hasgeek/boxoffice/comments{/number}","issue_comment_url":"https://api.github.com/repos/hasgeek/boxoffice/issues/comments{/number}","contents_url":"https://api.github.com/repos/hasgeek/boxoffice/contents/{+path}","compare_url":"https://api.github.com/repos/hasgeek/boxoffice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hasgeek/boxoffice/merges","archive_url":"https://api.github.com/repos/hasgeek/boxoffice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hasgeek/boxoffice/downloads","issues_url":"https://api.github.com/repos/hasgeek/boxoffice/issues{/number}","pulls_url":"https://api.github.com/repos/hasgeek/boxoffice/pulls{/number}","milestones_url":"https://api.github.com/repos/hasgeek/boxoffice/milestones{/number}","notifications_url":"https://api.github.com/repos/hasgeek/boxoffice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hasgeek/boxoffice/labels{/name}","releases_url":"https://api.github.com/repos/hasgeek/boxoffice/releases{/id}","deployments_url":"https://api.github.com/repos/hasgeek/boxoffice/deployments","created_at":"2012-01-16T05:47:45Z","updated_at":"2017-03-14T19:40:26Z","pushed_at":"2017-03-27T10:11:26Z","git_url":"git://github.com/hasgeek/boxoffice.git","ssh_url":"git@github.com:hasgeek/boxoffice.git","clone_url":"https://github.com/hasgeek/boxoffice.git","svn_url":"https://github.com/hasgeek/boxoffice","homepage":"","size":21970,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":48,"forks":2,"open_issues":48,"watchers":8,"default_branch":"master"}},"base":{"label":"hasgeek:master","ref":"master","sha":"d6ddf30f768bf5e06434ad6df6d1100482346352","user":{"login":"hasgeek","id":443850,"avatar_url":"https://avatars1.githubusercontent.com/u/443850?v=3","gravatar_id":"","url":"https://api.github.com/users/hasgeek","html_url":"https://github.com/hasgeek","followers_url":"https://api.github.com/users/hasgeek/followers","following_url":"https://api.github.com/users/hasgeek/following{/other_user}","gists_url":"https://api.github.com/users/hasgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/hasgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasgeek/subscriptions","organizations_url":"https://api.github.com/users/hasgeek/orgs","repos_url":"https://api.github.com/users/hasgeek/repos","events_url":"https://api.github.com/users/hasgeek/events{/privacy}","received_events_url":"https://api.github.com/users/hasgeek/received_events","type":"Organization","site_admin":false},"repo":{"id":3188285,"name":"boxoffice","full_name":"hasgeek/boxoffice","owner":{"login":"hasgeek","id":443850,"avatar_url":"https://avatars1.githubusercontent.com/u/443850?v=3","gravatar_id":"","url":"https://api.github.com/users/hasgeek","html_url":"https://github.com/hasgeek","followers_url":"https://api.github.com/users/hasgeek/followers","following_url":"https://api.github.com/users/hasgeek/following{/other_user}","gists_url":"https://api.github.com/users/hasgeek/gists{/gist_id}","starred_url":"https://api.github.com/users/hasgeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasgeek/subscriptions","organizations_url":"https://api.github.com/users/hasgeek/orgs","repos_url":"https://api.github.com/users/hasgeek/repos","events_url":"https://api.github.com/users/hasgeek/events{/privacy}","received_events_url":"https://api.github.com/users/hasgeek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hasgeek/boxoffice","description":"Ticketing","fork":false,"url":"https://api.github.com/repos/hasgeek/boxoffice","forks_url":"https://api.github.com/repos/hasgeek/boxoffice/forks","keys_url":"https://api.github.com/repos/hasgeek/boxoffice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hasgeek/boxoffice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hasgeek/boxoffice/teams","hooks_url":"https://api.github.com/repos/hasgeek/boxoffice/hooks","issue_events_url":"https://api.github.com/repos/hasgeek/boxoffice/issues/events{/number}","events_url":"https://api.github.com/repos/hasgeek/boxoffice/events","assignees_url":"https://api.github.com/repos/hasgeek/boxoffice/assignees{/user}","branches_url":"https://api.github.com/repos/hasgeek/boxoffice/branches{/branch}","tags_url":"https://api.github.com/repos/hasgeek/boxoffice/tags","blobs_url":"https://api.github.com/repos/hasgeek/boxoffice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hasgeek/boxoffice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hasgeek/boxoffice/git/refs{/sha}","trees_url":"https://api.github.com/repos/hasgeek/boxoffice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hasgeek/boxoffice/statuses/{sha}","languages_url":"https://api.github.com/repos/hasgeek/boxoffice/languages","stargazers_url":"https://api.github.com/repos/hasgeek/boxoffice/stargazers","contributors_url":"https://api.github.com/repos/hasgeek/boxoffice/contributors","subscribers_url":"https://api.github.com/repos/hasgeek/boxoffice/subscribers","subscription_url":"https://api.github.com/repos/hasgeek/boxoffice/subscription","commits_url":"https://api.github.com/repos/hasgeek/boxoffice/commits{/sha}","git_commits_url":"https://api.github.com/repos/hasgeek/boxoffice/git/commits{/sha}","comments_url":"https://api.github.com/repos/hasgeek/boxoffice/comments{/number}","issue_comment_url":"https://api.github.com/repos/hasgeek/boxoffice/issues/comments{/number}","contents_url":"https://api.github.com/repos/hasgeek/boxoffice/contents/{+path}","compare_url":"https://api.github.com/repos/hasgeek/boxoffice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hasgeek/boxoffice/merges","archive_url":"https://api.github.com/repos/hasgeek/boxoffice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hasgeek/boxoffice/downloads","issues_url":"https://api.github.com/repos/hasgeek/boxoffice/issues{/number}","pulls_url":"https://api.github.com/repos/hasgeek/boxoffice/pulls{/number}","milestones_url":"https://api.github.com/repos/hasgeek/boxoffice/milestones{/number}","notifications_url":"https://api.github.com/repos/hasgeek/boxoffice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hasgeek/boxoffice/labels{/name}","releases_url":"https://api.github.com/repos/hasgeek/boxoffice/releases{/id}","deployments_url":"https://api.github.com/repos/hasgeek/boxoffice/deployments","created_at":"2012-01-16T05:47:45Z","updated_at":"2017-03-14T19:40:26Z","pushed_at":"2017-03-27T10:11:26Z","git_url":"git://github.com/hasgeek/boxoffice.git","ssh_url":"git@github.com:hasgeek/boxoffice.git","clone_url":"https://github.com/hasgeek/boxoffice.git","svn_url":"https://github.com/hasgeek/boxoffice","homepage":"","size":21970,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":48,"forks":2,"open_issues":48,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hasgeek/boxoffice/pulls/140"},"html":{"href":"https://github.com/hasgeek/boxoffice/pull/140"},"issue":{"href":"https://api.github.com/repos/hasgeek/boxoffice/issues/140"},"comments":{"href":"https://api.github.com/repos/hasgeek/boxoffice/issues/140/comments"},"review_comments":{"href":"https://api.github.com/repos/hasgeek/boxoffice/pulls/140/comments"},"review_comment":{"href":"https://api.github.com/repos/hasgeek/boxoffice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hasgeek/boxoffice/pulls/140/commits"},"statuses":{"href":"https://api.github.com/repos/hasgeek/boxoffice/statuses/22ff361ce3a0a45806bb02768eced1e7d907af52"}}}}
{"actor":{"display_login":"shreyas-satish"}}