GitHub PullRequestReviewCommentEvent at 2014-12-01 13:07:20
Repository: community-platform
Actor: MariagraziaAlastra
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/duckduckgo/community-platform/pulls/comments/21087163","id":21087163,"diff_hunk":"@@ -195,29 +207,208 @@ sub ia  :Chained('ia_base') :PathPart('') :Args(0) {\n     my ( $self, $c ) = @_;\n }\n \n+sub commit_base :Chained('base') :PathPart('commit') :CaptureArgs(1) {\n+    my ( $self, $c, $answer_id ) = @_;\n+\n+    $c->stash->{ia} = $c->d->rs('InstantAnswer')->find($answer_id);\n+    $c->stash->{ia_page} = \"IAPageCommit\";\n+}\n+\n+sub commit :Chained('commit_base') :PathPart('') :Args(0) {\n+    my ( $self, $c ) = @_;\n+}\n+\n+sub commit_json :Chained('commit_base') :PathPart('json') :Args(0) {\n+    my ( $self, $c ) = @_;\n+\n+    my $ia = $c->stash->{ia};\n+    my $edits = get_edits($c->d, $ia->name);\n+    my @topics = map { $_->name} $ia->topics;\n+\n+    my @name;\n+    my @desc;\n+    my @status;\n+    my @topic;\n+    my @example_query;\n+    my @other_queries;\n+    my @code;\n+    my %original;\n+    my $new_edits;\n+    my $is_admin;\n+\n+    if ($c->user) {\n+        $is_admin = $c->user->admin;\n+    }\n+\n+    use JSON;\n+\n+    %original = (\n+        name => $ia->name,\n+        description => $ia->description,\n+        status => $ia->status,\n+        topic => \\@topics,\n+        example_query => $ia->example_query,\n+        other_queries => decode_json($ia->other_queries),\n+        code => decode_json($ia->code)\n+    );\n+\n+    if (ref $edits eq 'ARRAY') {\n+        $new_edits = 1;\n+        for my $edit (@{ $edits }) {\n+            my $cur_time = time;\n+            my $diff_time;\n+\n+            for my $time (keys %{$edit}) {\n+                my %hash_edit = %{$edit};\n+                my $temp_diff_time = $cur_time - $hash_edit{$time};\n+\n+                if (!$diff_time || $temp_diff_time < $diff_time) {","path":"lib/DDGC/Web/Controller/InstantAnswer.pm","position":108,"original_position":108,"commit_id":"9daa352a5f4b50e8a4b74acf419efe0387948e9f","original_commit_id":"9daa352a5f4b50e8a4b74acf419efe0387948e9f","user":{"login":"MariagraziaAlastra","id":3652195,"avatar_url":"https://avatars.githubusercontent.com/u/3652195?v=3","gravatar_id":"","url":"https://api.github.com/users/MariagraziaAlastra","html_url":"https://github.com/MariagraziaAlastra","followers_url":"https://api.github.com/users/MariagraziaAlastra/followers","following_url":"https://api.github.com/users/MariagraziaAlastra/following{/other_user}","gists_url":"https://api.github.com/users/MariagraziaAlastra/gists{/gist_id}","starred_url":"https://api.github.com/users/MariagraziaAlastra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariagraziaAlastra/subscriptions","organizations_url":"https://api.github.com/users/MariagraziaAlastra/orgs","repos_url":"https://api.github.com/users/MariagraziaAlastra/repos","events_url":"https://api.github.com/users/MariagraziaAlastra/events{/privacy}","received_events_url":"https://api.github.com/users/MariagraziaAlastra/received_events","type":"User","site_admin":false},"body":"@russellholt what do you mean by edit time? If you mean when the edit was submitted, that's already taken into account to determine which one is the last edit.","created_at":"2014-12-01T13:07:20Z","updated_at":"2014-12-01T13:07:20Z","html_url":"https://github.com/duckduckgo/community-platform/pull/322#discussion_r21087163","pull_request_url":"https://api.github.com/repos/duckduckgo/community-platform/pulls/322","_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/community-platform/pulls/comments/21087163"},"html":{"href":"https://github.com/duckduckgo/community-platform/pull/322#discussion_r21087163"},"pull_request":{"href":"https://api.github.com/repos/duckduckgo/community-platform/pulls/322"}}},"pull_request":{"url":"https://api.github.com/repos/duckduckgo/community-platform/pulls/322","id":24717208,"html_url":"https://github.com/duckduckgo/community-platform/pull/322","diff_url":"https://github.com/duckduckgo/community-platform/pull/322.diff","patch_url":"https://github.com/duckduckgo/community-platform/pull/322.patch","issue_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/322","number":322,"state":"open","locked":false,"title":"IA Pages - Commit page","user":{"login":"MariagraziaAlastra","id":3652195,"avatar_url":"https://avatars.githubusercontent.com/u/3652195?v=3","gravatar_id":"","url":"https://api.github.com/users/MariagraziaAlastra","html_url":"https://github.com/MariagraziaAlastra","followers_url":"https://api.github.com/users/MariagraziaAlastra/followers","following_url":"https://api.github.com/users/MariagraziaAlastra/following{/other_user}","gists_url":"https://api.github.com/users/MariagraziaAlastra/gists{/gist_id}","starred_url":"https://api.github.com/users/MariagraziaAlastra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MariagraziaAlastra/subscriptions","organizations_url":"https://api.github.com/users/MariagraziaAlastra/orgs","repos_url":"https://api.github.com/users/MariagraziaAlastra/repos","events_url":"https://api.github.com/users/MariagraziaAlastra/events{/privacy}","received_events_url":"https://api.github.com/users/MariagraziaAlastra/received_events","type":"User","site_admin":false},"body":"I have the endpoint and some initial basic layout for the page, but there's a lot more work to do, so I'll mark this as WIP and won't tag anyone just yet.","created_at":"2014-11-19T20:11:01Z","updated_at":"2014-12-01T13:07:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5089d3c7e1fcfe871de6d801d638d6e74d078a8c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/duckduckgo/community-platform/pulls/322/commits","review_comments_url":"https://api.github.com/repos/duckduckgo/community-platform/pulls/322/comments","review_comment_url":"https://api.github.com/repos/duckduckgo/community-platform/pulls/comments/{number}","comments_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/322/comments","statuses_url":"https://api.github.com/repos/duckduckgo/community-platform/statuses/9daa352a5f4b50e8a4b74acf419efe0387948e9f","head":{"label":"duckduckgo:commit_ui","ref":"commit_ui","sha":"9daa352a5f4b50e8a4b74acf419efe0387948e9f","user":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":1751775,"name":"community-platform","full_name":"duckduckgo/community-platform","owner":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/community-platform","description":"DuckDuckGo Community Platform","fork":false,"url":"https://api.github.com/repos/duckduckgo/community-platform","forks_url":"https://api.github.com/repos/duckduckgo/community-platform/forks","keys_url":"https://api.github.com/repos/duckduckgo/community-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/community-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/community-platform/teams","hooks_url":"https://api.github.com/repos/duckduckgo/community-platform/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/community-platform/events","assignees_url":"https://api.github.com/repos/duckduckgo/community-platform/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/community-platform/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/community-platform/tags","blobs_url":"https://api.github.com/repos/duckduckgo/community-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/community-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/community-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/community-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/community-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/community-platform/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/community-platform/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/community-platform/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/community-platform/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/community-platform/subscription","commits_url":"https://api.github.com/repos/duckduckgo/community-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/community-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/community-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/comments/{number}","contents_url":"https://api.github.com/repos/duckduckgo/community-platform/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/community-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/community-platform/merges","archive_url":"https://api.github.com/repos/duckduckgo/community-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/community-platform/downloads","issues_url":"https://api.github.com/repos/duckduckgo/community-platform/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/community-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/community-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/community-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/community-platform/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/community-platform/releases{/id}","created_at":"2011-05-15T17:35:41Z","updated_at":"2014-12-01T05:38:16Z","pushed_at":"2014-12-01T12:46:38Z","git_url":"git://github.com/duckduckgo/community-platform.git","ssh_url":"git@github.com:duckduckgo/community-platform.git","clone_url":"https://github.com/duckduckgo/community-platform.git","svn_url":"https://github.com/duckduckgo/community-platform","homepage":"https://duck.co/","size":32023,"stargazers_count":275,"watchers_count":275,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":75,"mirror_url":null,"open_issues_count":76,"forks":75,"open_issues":76,"watchers":275,"default_branch":"dev"}},"base":{"label":"duckduckgo:dev","ref":"dev","sha":"ddc061d8a44e973172c3c5f73e4e993769c1fd85","user":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"repo":{"id":1751775,"name":"community-platform","full_name":"duckduckgo/community-platform","owner":{"login":"duckduckgo","id":342708,"avatar_url":"https://avatars.githubusercontent.com/u/342708?v=3","gravatar_id":"","url":"https://api.github.com/users/duckduckgo","html_url":"https://github.com/duckduckgo","followers_url":"https://api.github.com/users/duckduckgo/followers","following_url":"https://api.github.com/users/duckduckgo/following{/other_user}","gists_url":"https://api.github.com/users/duckduckgo/gists{/gist_id}","starred_url":"https://api.github.com/users/duckduckgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckduckgo/subscriptions","organizations_url":"https://api.github.com/users/duckduckgo/orgs","repos_url":"https://api.github.com/users/duckduckgo/repos","events_url":"https://api.github.com/users/duckduckgo/events{/privacy}","received_events_url":"https://api.github.com/users/duckduckgo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/duckduckgo/community-platform","description":"DuckDuckGo Community Platform","fork":false,"url":"https://api.github.com/repos/duckduckgo/community-platform","forks_url":"https://api.github.com/repos/duckduckgo/community-platform/forks","keys_url":"https://api.github.com/repos/duckduckgo/community-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckduckgo/community-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckduckgo/community-platform/teams","hooks_url":"https://api.github.com/repos/duckduckgo/community-platform/hooks","issue_events_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/events{/number}","events_url":"https://api.github.com/repos/duckduckgo/community-platform/events","assignees_url":"https://api.github.com/repos/duckduckgo/community-platform/assignees{/user}","branches_url":"https://api.github.com/repos/duckduckgo/community-platform/branches{/branch}","tags_url":"https://api.github.com/repos/duckduckgo/community-platform/tags","blobs_url":"https://api.github.com/repos/duckduckgo/community-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckduckgo/community-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckduckgo/community-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckduckgo/community-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckduckgo/community-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/duckduckgo/community-platform/languages","stargazers_url":"https://api.github.com/repos/duckduckgo/community-platform/stargazers","contributors_url":"https://api.github.com/repos/duckduckgo/community-platform/contributors","subscribers_url":"https://api.github.com/repos/duckduckgo/community-platform/subscribers","subscription_url":"https://api.github.com/repos/duckduckgo/community-platform/subscription","commits_url":"https://api.github.com/repos/duckduckgo/community-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckduckgo/community-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckduckgo/community-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/comments/{number}","contents_url":"https://api.github.com/repos/duckduckgo/community-platform/contents/{+path}","compare_url":"https://api.github.com/repos/duckduckgo/community-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckduckgo/community-platform/merges","archive_url":"https://api.github.com/repos/duckduckgo/community-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckduckgo/community-platform/downloads","issues_url":"https://api.github.com/repos/duckduckgo/community-platform/issues{/number}","pulls_url":"https://api.github.com/repos/duckduckgo/community-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/duckduckgo/community-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/duckduckgo/community-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckduckgo/community-platform/labels{/name}","releases_url":"https://api.github.com/repos/duckduckgo/community-platform/releases{/id}","created_at":"2011-05-15T17:35:41Z","updated_at":"2014-12-01T05:38:16Z","pushed_at":"2014-12-01T12:46:38Z","git_url":"git://github.com/duckduckgo/community-platform.git","ssh_url":"git@github.com:duckduckgo/community-platform.git","clone_url":"https://github.com/duckduckgo/community-platform.git","svn_url":"https://github.com/duckduckgo/community-platform","homepage":"https://duck.co/","size":32023,"stargazers_count":275,"watchers_count":275,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":75,"mirror_url":null,"open_issues_count":76,"forks":75,"open_issues":76,"watchers":275,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/duckduckgo/community-platform/pulls/322"},"html":{"href":"https://github.com/duckduckgo/community-platform/pull/322"},"issue":{"href":"https://api.github.com/repos/duckduckgo/community-platform/issues/322"},"comments":{"href":"https://api.github.com/repos/duckduckgo/community-platform/issues/322/comments"},"review_comments":{"href":"https://api.github.com/repos/duckduckgo/community-platform/pulls/322/comments"},"review_comment":{"href":"https://api.github.com/repos/duckduckgo/community-platform/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/duckduckgo/community-platform/pulls/322/commits"},"statuses":{"href":"https://api.github.com/repos/duckduckgo/community-platform/statuses/9daa352a5f4b50e8a4b74acf419efe0387948e9f"}}}}