GitHub PullRequestReviewCommentEvent at 2014-08-07 21:19:44
Repository: kitsune
Actor: dean
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/kitsune/pulls/comments/15964883","id":15964883,"diff_hunk":"@@ -431,6 +431,113 @@\n             e.preventDefault();\n         });\n \n+        /* Banning/Unbanning twitter handles */\n+        var updateBannedList = function() {\n+            var banned_users = $('#banned-users');\n+            $.get(\n+                '/api/1/customercare/banned',\n+                function(data) {\n+                    data.forEach(function(user) {\n+                        addBannedUser(user.username);\n+                    });\n+                }\n+            );\n+        }\n+\n+        var addBannedUser = function(username) {\n+            var li = $(document.createElement('li'))\n+                .attr({\n+                    id: 'banned-user-' + username,\n+                });\n+            var checkbox = $(document.createElement('input'))\n+                .attr({\n+                    type: 'checkbox',\n+                });\n+            checkbox.val(username);\n+            li.append(checkbox)\n+            li.append(' ' + username);\n+            $('#banned-users').append(li);\n+        }\n+\n+        var removeBannedUser = function(username) {\n+            $('#banned-user-' + username).remove();            \n+        }\n+\n+        // Initially fill in the list.\n+        // If the element exists we are on the right page.\n+        if ($('#banned_users')) {\n+            updateBannedList();\n+        }\n+\n+        $('#ban').on('click', function() {\n+            var username = $('#ban-username').val();\n+            var csrf = $('#csrf input[name=csrfmiddlewaretoken]').val();\n+            var msg = $('#ban-message');\n+            // Empty message before we give it more content.\n+            msg.empty();\n+            $.ajax({\n+                beforeSend: function(xhr) {\n+                    xhr.setRequestHeader('X-CSRFToken', csrf);\n+                },\n+                url: '/api/1/customercare/ban',\n+                type: 'POST',\n+                data: JSON.stringify({\n+                    username: username\n+                }),\n+                contentType: 'application/json',\n+                success: function(data) {\n+                    addBannedUser(username);            \n+                    msg.append(gettext('Account banned successfully!'));\n+                },\n+                error: function(resp) {\n+                    if (resp.status === 400) {\n+                        msg.append(gettext('Username not provided.</br>'));","path":"kitsune/sumo/static/js/customercare.js","position":null,"original_position":64,"commit_id":"616c48388cab07a611ef7ce4f605322155850e92","original_commit_id":"7ab2ea7bc4e5f688456b7c333e5f9d0081854e38","user":{"login":"dean","id":1235347,"avatar_url":"https://avatars.githubusercontent.com/u/1235347?v=2","gravatar_id":"421fba99fa5ee4e70881f5c18f5832dd","url":"https://api.github.com/users/dean","html_url":"https://github.com/dean","followers_url":"https://api.github.com/users/dean/followers","following_url":"https://api.github.com/users/dean/following{/other_user}","gists_url":"https://api.github.com/users/dean/gists{/gist_id}","starred_url":"https://api.github.com/users/dean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dean/subscriptions","organizations_url":"https://api.github.com/users/dean/orgs","repos_url":"https://api.github.com/users/dean/repos","events_url":"https://api.github.com/users/dean/events{/privacy}","received_events_url":"https://api.github.com/users/dean/received_events","type":"User","site_admin":false},"body":"Fixed, but still need to fix CSS to apply blocks to all statements.","created_at":"2014-08-07T21:19:44Z","updated_at":"2014-08-07T21:19:44Z","html_url":"https://github.com/mozilla/kitsune/pull/2060#discussion_r15964883","pull_request_url":"https://api.github.com/repos/mozilla/kitsune/pulls/2060","_links":{"self":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/comments/15964883"},"html":{"href":"https://github.com/mozilla/kitsune/pull/2060#discussion_r15964883"},"pull_request":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/2060"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/kitsune/pulls/2060","id":19373558,"html_url":"https://github.com/mozilla/kitsune/pull/2060","diff_url":"https://github.com/mozilla/kitsune/pull/2060.diff","patch_url":"https://github.com/mozilla/kitsune/pull/2060.patch","issue_url":"https://api.github.com/repos/mozilla/kitsune/issues/2060","number":2060,"state":"open","title":"[Bug 1045982] AoA bans for certain twitter handles","user":{"login":"dean","id":1235347,"avatar_url":"https://avatars.githubusercontent.com/u/1235347?v=2","gravatar_id":"421fba99fa5ee4e70881f5c18f5832dd","url":"https://api.github.com/users/dean","html_url":"https://github.com/dean","followers_url":"https://api.github.com/users/dean/followers","following_url":"https://api.github.com/users/dean/following{/other_user}","gists_url":"https://api.github.com/users/dean/gists{/gist_id}","starred_url":"https://api.github.com/users/dean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dean/subscriptions","organizations_url":"https://api.github.com/users/dean/orgs","repos_url":"https://api.github.com/users/dean/repos","events_url":"https://api.github.com/users/dean/events{/privacy}","received_events_url":"https://api.github.com/users/dean/received_events","type":"User","site_admin":false},"body":"This adds a system for banning and unbanning certain twitter handles.\r\nA user with the 'customercare.ban_account' permission may ban or unban twitter usernames from using the AoA tool at /army-of-awesome/moderate.\r\n\r\nr?","created_at":"2014-08-05T22:12:12Z","updated_at":"2014-08-07T21:19:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2e9343a5af49138cfca6b3d1359e1b7ecaa22b8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/kitsune/pulls/2060/commits","review_comments_url":"https://api.github.com/repos/mozilla/kitsune/pulls/2060/comments","review_comment_url":"https://api.github.com/repos/mozilla/kitsune/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla/kitsune/issues/2060/comments","statuses_url":"https://api.github.com/repos/mozilla/kitsune/statuses/616c48388cab07a611ef7ce4f605322155850e92","head":{"label":"dean:aoa-ban-1045982","ref":"aoa-ban-1045982","sha":"616c48388cab07a611ef7ce4f605322155850e92","user":{"login":"dean","id":1235347,"avatar_url":"https://avatars.githubusercontent.com/u/1235347?v=2","gravatar_id":"421fba99fa5ee4e70881f5c18f5832dd","url":"https://api.github.com/users/dean","html_url":"https://github.com/dean","followers_url":"https://api.github.com/users/dean/followers","following_url":"https://api.github.com/users/dean/following{/other_user}","gists_url":"https://api.github.com/users/dean/gists{/gist_id}","starred_url":"https://api.github.com/users/dean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dean/subscriptions","organizations_url":"https://api.github.com/users/dean/orgs","repos_url":"https://api.github.com/users/dean/repos","events_url":"https://api.github.com/users/dean/events{/privacy}","received_events_url":"https://api.github.com/users/dean/received_events","type":"User","site_admin":false},"repo":{"id":20894046,"name":"kitsune","full_name":"dean/kitsune","owner":{"login":"dean","id":1235347,"avatar_url":"https://avatars.githubusercontent.com/u/1235347?v=2","gravatar_id":"421fba99fa5ee4e70881f5c18f5832dd","url":"https://api.github.com/users/dean","html_url":"https://github.com/dean","followers_url":"https://api.github.com/users/dean/followers","following_url":"https://api.github.com/users/dean/following{/other_user}","gists_url":"https://api.github.com/users/dean/gists{/gist_id}","starred_url":"https://api.github.com/users/dean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dean/subscriptions","organizations_url":"https://api.github.com/users/dean/orgs","repos_url":"https://api.github.com/users/dean/repos","events_url":"https://api.github.com/users/dean/events{/privacy}","received_events_url":"https://api.github.com/users/dean/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dean/kitsune","description":"Platform for Mozilla Support","fork":true,"url":"https://api.github.com/repos/dean/kitsune","forks_url":"https://api.github.com/repos/dean/kitsune/forks","keys_url":"https://api.github.com/repos/dean/kitsune/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dean/kitsune/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dean/kitsune/teams","hooks_url":"https://api.github.com/repos/dean/kitsune/hooks","issue_events_url":"https://api.github.com/repos/dean/kitsune/issues/events{/number}","events_url":"https://api.github.com/repos/dean/kitsune/events","assignees_url":"https://api.github.com/repos/dean/kitsune/assignees{/user}","branches_url":"https://api.github.com/repos/dean/kitsune/branches{/branch}","tags_url":"https://api.github.com/repos/dean/kitsune/tags","blobs_url":"https://api.github.com/repos/dean/kitsune/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dean/kitsune/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dean/kitsune/git/refs{/sha}","trees_url":"https://api.github.com/repos/dean/kitsune/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dean/kitsune/statuses/{sha}","languages_url":"https://api.github.com/repos/dean/kitsune/languages","stargazers_url":"https://api.github.com/repos/dean/kitsune/stargazers","contributors_url":"https://api.github.com/repos/dean/kitsune/contributors","subscribers_url":"https://api.github.com/repos/dean/kitsune/subscribers","subscription_url":"https://api.github.com/repos/dean/kitsune/subscription","commits_url":"https://api.github.com/repos/dean/kitsune/commits{/sha}","git_commits_url":"https://api.github.com/repos/dean/kitsune/git/commits{/sha}","comments_url":"https://api.github.com/repos/dean/kitsune/comments{/number}","issue_comment_url":"https://api.github.com/repos/dean/kitsune/issues/comments/{number}","contents_url":"https://api.github.com/repos/dean/kitsune/contents/{+path}","compare_url":"https://api.github.com/repos/dean/kitsune/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dean/kitsune/merges","archive_url":"https://api.github.com/repos/dean/kitsune/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dean/kitsune/downloads","issues_url":"https://api.github.com/repos/dean/kitsune/issues{/number}","pulls_url":"https://api.github.com/repos/dean/kitsune/pulls{/number}","milestones_url":"https://api.github.com/repos/dean/kitsune/milestones{/number}","notifications_url":"https://api.github.com/repos/dean/kitsune/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dean/kitsune/labels{/name}","releases_url":"https://api.github.com/repos/dean/kitsune/releases{/id}","created_at":"2014-06-16T17:39:50Z","updated_at":"2014-07-29T20:38:46Z","pushed_at":"2014-08-07T21:18:54Z","git_url":"git://github.com/dean/kitsune.git","ssh_url":"git@github.com:dean/kitsune.git","clone_url":"https://github.com/dean/kitsune.git","svn_url":"https://github.com/dean/kitsune","homepage":"http://support.mozilla.com/","size":90930,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"5bb4ef89865068c09c04a3ebe14e29defbd67a33","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":489645,"name":"kitsune","full_name":"mozilla/kitsune","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=2","gravatar_id":"9ba739c8f3288e256b13553e4d257b5e","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/kitsune","description":"Platform for Mozilla Support","fork":false,"url":"https://api.github.com/repos/mozilla/kitsune","forks_url":"https://api.github.com/repos/mozilla/kitsune/forks","keys_url":"https://api.github.com/repos/mozilla/kitsune/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/kitsune/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/kitsune/teams","hooks_url":"https://api.github.com/repos/mozilla/kitsune/hooks","issue_events_url":"https://api.github.com/repos/mozilla/kitsune/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/kitsune/events","assignees_url":"https://api.github.com/repos/mozilla/kitsune/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/kitsune/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/kitsune/tags","blobs_url":"https://api.github.com/repos/mozilla/kitsune/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/kitsune/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/kitsune/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/kitsune/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/kitsune/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/kitsune/languages","stargazers_url":"https://api.github.com/repos/mozilla/kitsune/stargazers","contributors_url":"https://api.github.com/repos/mozilla/kitsune/contributors","subscribers_url":"https://api.github.com/repos/mozilla/kitsune/subscribers","subscription_url":"https://api.github.com/repos/mozilla/kitsune/subscription","commits_url":"https://api.github.com/repos/mozilla/kitsune/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/kitsune/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/kitsune/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/kitsune/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla/kitsune/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/kitsune/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/kitsune/merges","archive_url":"https://api.github.com/repos/mozilla/kitsune/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/kitsune/downloads","issues_url":"https://api.github.com/repos/mozilla/kitsune/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/kitsune/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/kitsune/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/kitsune/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/kitsune/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/kitsune/releases{/id}","created_at":"2010-01-26T18:53:57Z","updated_at":"2014-07-27T04:31:31Z","pushed_at":"2014-08-07T20:24:18Z","git_url":"git://github.com/mozilla/kitsune.git","ssh_url":"git@github.com:mozilla/kitsune.git","clone_url":"https://github.com/mozilla/kitsune.git","svn_url":"https://github.com/mozilla/kitsune","homepage":"http://support.mozilla.com/","size":154730,"stargazers_count":241,"watchers_count":241,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"forks_count":213,"mirror_url":null,"open_issues_count":5,"forks":213,"open_issues":5,"watchers":241,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/2060"},"html":{"href":"https://github.com/mozilla/kitsune/pull/2060"},"issue":{"href":"https://api.github.com/repos/mozilla/kitsune/issues/2060"},"comments":{"href":"https://api.github.com/repos/mozilla/kitsune/issues/2060/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/2060/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla/kitsune/pulls/2060/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/kitsune/statuses/616c48388cab07a611ef7ce4f605322155850e92"}}}}