{"action":"created","comment":{"url":"https://api.github.com/repos/austin94/MyFields/pulls/comments/59394610","id":59394610,"diff_hunk":"@@ -0,0 +1,96 @@\n+/**\n+ * Created by gannonhuiting on 2/2/16.\n+ */\n+\n+inspectorApplication.controller('adminListCtrl', function($scope, $http) {\n+\n+    var ctrl = this;\n+    ctrl.users = [];\n+    ctrl.types = [];\n+    ctrl.type = \"\";\n+\n+    ctrl.List = List;\n+    ctrl.selectUser = selectUser;\n+    ctrl.remove = remove;\n+    ctrl.add = add;\n+\n+\n+    ctrl.showEdit = false;\n+    ctrl.currentUser = \"\";\n+    ctrl.fieldName = \"\";\n+\n+\n+\n+    init();\n+    function init() {\n+        getInfo();\n+    }\n+\n+    function remove(type)\n+    {\n+        $http.post('/admin/'+ctrl.currentUser.id+'/remove', {\n+            title: type.title\n+        }).success(function(success) {\n+            window.location.href = \"/admin/list\";\n+        }).error(function(error) {\n+            console.log(error);\n+        });\n+    }\n+\n+    function add(type)\n+    {\n+        var url = \"/admin/\"+ctrl.currentUser.id+\"/add\";\n+        $http.post(url,{\n+                title: type\n+        }).success(function(success) {\n+            window.location.href = \"/admin/list\";\n+        }).error(function(error) {\n+            console.log(error);\n+        });\n+        ctrl.reload = false;\n+\n+\n+    }\n+\n+\n+    function selectUser(user)\n+    {\n+        ctrl.currentUser = user;\n+\n+        ctrl.showEdit = true;\n+\n+    }\n+\n+\n+\n+    function getInfo() {\n+\n+\n+        $http({\n+            method: 'GET',\n+            url: '/admin/types'\n+        }).then(function successCallback(response) {\n+\n+            ctrl.types = response.data;\n+\n+        });\n+\n+        $http({\n+            method: 'GET',\n+            url: '/admin/users'\n+        }).then(function successCallback(response) {\n+            ctrl.users = response.data;\n+            console.log(\"Data: \"+ JSON.stringify(response.data));","path":"MyFields-Inspector-Web/public/javascripts/Controllers/adminListCtrl.js","position":83,"original_position":83,"commit_id":"ae8b0f7f338f8f369e44d426d6edb9e183ee16cd","original_commit_id":"ae8b0f7f338f8f369e44d426d6edb9e183ee16cd","user":{"login":"austin94","id":4030377,"avatar_url":"https://avatars.githubusercontent.com/u/4030377?v=3","gravatar_id":"","url":"https://api.github.com/users/austin94","html_url":"https://github.com/austin94","followers_url":"https://api.github.com/users/austin94/followers","following_url":"https://api.github.com/users/austin94/following{/other_user}","gists_url":"https://api.github.com/users/austin94/gists{/gist_id}","starred_url":"https://api.github.com/users/austin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austin94/subscriptions","organizations_url":"https://api.github.com/users/austin94/orgs","repos_url":"https://api.github.com/users/austin94/repos","events_url":"https://api.github.com/users/austin94/events{/privacy}","received_events_url":"https://api.github.com/users/austin94/received_events","type":"User","site_admin":false},"body":"remove log","created_at":"2016-04-12T15:16:34Z","updated_at":"2016-04-12T15:16:34Z","html_url":"https://github.com/austin94/MyFields/pull/25#discussion_r59394610","pull_request_url":"https://api.github.com/repos/austin94/MyFields/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/austin94/MyFields/pulls/comments/59394610"},"html":{"href":"https://github.com/austin94/MyFields/pull/25#discussion_r59394610"},"pull_request":{"href":"https://api.github.com/repos/austin94/MyFields/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/austin94/MyFields/pulls/25","id":63740805,"html_url":"https://github.com/austin94/MyFields/pull/25","diff_url":"https://github.com/austin94/MyFields/pull/25.diff","patch_url":"https://github.com/austin94/MyFields/pull/25.patch","issue_url":"https://api.github.com/repos/austin94/MyFields/issues/25","number":25,"state":"open","locked":false,"title":"Feature/admin managment","user":{"login":"Doopdon","id":9811290,"avatar_url":"https://avatars.githubusercontent.com/u/9811290?v=3","gravatar_id":"","url":"https://api.github.com/users/Doopdon","html_url":"https://github.com/Doopdon","followers_url":"https://api.github.com/users/Doopdon/followers","following_url":"https://api.github.com/users/Doopdon/following{/other_user}","gists_url":"https://api.github.com/users/Doopdon/gists{/gist_id}","starred_url":"https://api.github.com/users/Doopdon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Doopdon/subscriptions","organizations_url":"https://api.github.com/users/Doopdon/orgs","repos_url":"https://api.github.com/users/Doopdon/repos","events_url":"https://api.github.com/users/Doopdon/events{/privacy}","received_events_url":"https://api.github.com/users/Doopdon/received_events","type":"User","site_admin":false},"body":"This should allow you to change permissions for users.","created_at":"2016-03-22T15:36:53Z","updated_at":"2016-04-12T15:16:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"232e7a5afb628212b7a9864f28745b2272c1d884","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/austin94/MyFields/pulls/25/commits","review_comments_url":"https://api.github.com/repos/austin94/MyFields/pulls/25/comments","review_comment_url":"https://api.github.com/repos/austin94/MyFields/pulls/comments{/number}","comments_url":"https://api.github.com/repos/austin94/MyFields/issues/25/comments","statuses_url":"https://api.github.com/repos/austin94/MyFields/statuses/ae8b0f7f338f8f369e44d426d6edb9e183ee16cd","head":{"label":"austin94:feature/Admin-Managment","ref":"feature/Admin-Managment","sha":"ae8b0f7f338f8f369e44d426d6edb9e183ee16cd","user":{"login":"austin94","id":4030377,"avatar_url":"https://avatars.githubusercontent.com/u/4030377?v=3","gravatar_id":"","url":"https://api.github.com/users/austin94","html_url":"https://github.com/austin94","followers_url":"https://api.github.com/users/austin94/followers","following_url":"https://api.github.com/users/austin94/following{/other_user}","gists_url":"https://api.github.com/users/austin94/gists{/gist_id}","starred_url":"https://api.github.com/users/austin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austin94/subscriptions","organizations_url":"https://api.github.com/users/austin94/orgs","repos_url":"https://api.github.com/users/austin94/repos","events_url":"https://api.github.com/users/austin94/events{/privacy}","received_events_url":"https://api.github.com/users/austin94/received_events","type":"User","site_admin":false},"repo":{"id":41810082,"name":"MyFields","full_name":"austin94/MyFields","owner":{"login":"austin94","id":4030377,"avatar_url":"https://avatars.githubusercontent.com/u/4030377?v=3","gravatar_id":"","url":"https://api.github.com/users/austin94","html_url":"https://github.com/austin94","followers_url":"https://api.github.com/users/austin94/followers","following_url":"https://api.github.com/users/austin94/following{/other_user}","gists_url":"https://api.github.com/users/austin94/gists{/gist_id}","starred_url":"https://api.github.com/users/austin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austin94/subscriptions","organizations_url":"https://api.github.com/users/austin94/orgs","repos_url":"https://api.github.com/users/austin94/repos","events_url":"https://api.github.com/users/austin94/events{/privacy}","received_events_url":"https://api.github.com/users/austin94/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/austin94/MyFields","description":"MyFields","fork":false,"url":"https://api.github.com/repos/austin94/MyFields","forks_url":"https://api.github.com/repos/austin94/MyFields/forks","keys_url":"https://api.github.com/repos/austin94/MyFields/keys{/key_id}","collaborators_url":"https://api.github.com/repos/austin94/MyFields/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/austin94/MyFields/teams","hooks_url":"https://api.github.com/repos/austin94/MyFields/hooks","issue_events_url":"https://api.github.com/repos/austin94/MyFields/issues/events{/number}","events_url":"https://api.github.com/repos/austin94/MyFields/events","assignees_url":"https://api.github.com/repos/austin94/MyFields/assignees{/user}","branches_url":"https://api.github.com/repos/austin94/MyFields/branches{/branch}","tags_url":"https://api.github.com/repos/austin94/MyFields/tags","blobs_url":"https://api.github.com/repos/austin94/MyFields/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/austin94/MyFields/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/austin94/MyFields/git/refs{/sha}","trees_url":"https://api.github.com/repos/austin94/MyFields/git/trees{/sha}","statuses_url":"https://api.github.com/repos/austin94/MyFields/statuses/{sha}","languages_url":"https://api.github.com/repos/austin94/MyFields/languages","stargazers_url":"https://api.github.com/repos/austin94/MyFields/stargazers","contributors_url":"https://api.github.com/repos/austin94/MyFields/contributors","subscribers_url":"https://api.github.com/repos/austin94/MyFields/subscribers","subscription_url":"https://api.github.com/repos/austin94/MyFields/subscription","commits_url":"https://api.github.com/repos/austin94/MyFields/commits{/sha}","git_commits_url":"https://api.github.com/repos/austin94/MyFields/git/commits{/sha}","comments_url":"https://api.github.com/repos/austin94/MyFields/comments{/number}","issue_comment_url":"https://api.github.com/repos/austin94/MyFields/issues/comments{/number}","contents_url":"https://api.github.com/repos/austin94/MyFields/contents/{+path}","compare_url":"https://api.github.com/repos/austin94/MyFields/compare/{base}...{head}","merges_url":"https://api.github.com/repos/austin94/MyFields/merges","archive_url":"https://api.github.com/repos/austin94/MyFields/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/austin94/MyFields/downloads","issues_url":"https://api.github.com/repos/austin94/MyFields/issues{/number}","pulls_url":"https://api.github.com/repos/austin94/MyFields/pulls{/number}","milestones_url":"https://api.github.com/repos/austin94/MyFields/milestones{/number}","notifications_url":"https://api.github.com/repos/austin94/MyFields/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/austin94/MyFields/labels{/name}","releases_url":"https://api.github.com/repos/austin94/MyFields/releases{/id}","deployments_url":"https://api.github.com/repos/austin94/MyFields/deployments","created_at":"2015-09-02T15:39:42Z","updated_at":"2016-02-09T03:03:34Z","pushed_at":"2016-04-12T15:09:40Z","git_url":"git://github.com/austin94/MyFields.git","ssh_url":"git@github.com:austin94/MyFields.git","clone_url":"https://github.com/austin94/MyFields.git","svn_url":"https://github.com/austin94/MyFields","homepage":"","size":4133,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"austin94:development","ref":"development","sha":"480fdb0e8de28b965b0c555a16726f66ce6b0852","user":{"login":"austin94","id":4030377,"avatar_url":"https://avatars.githubusercontent.com/u/4030377?v=3","gravatar_id":"","url":"https://api.github.com/users/austin94","html_url":"https://github.com/austin94","followers_url":"https://api.github.com/users/austin94/followers","following_url":"https://api.github.com/users/austin94/following{/other_user}","gists_url":"https://api.github.com/users/austin94/gists{/gist_id}","starred_url":"https://api.github.com/users/austin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austin94/subscriptions","organizations_url":"https://api.github.com/users/austin94/orgs","repos_url":"https://api.github.com/users/austin94/repos","events_url":"https://api.github.com/users/austin94/events{/privacy}","received_events_url":"https://api.github.com/users/austin94/received_events","type":"User","site_admin":false},"repo":{"id":41810082,"name":"MyFields","full_name":"austin94/MyFields","owner":{"login":"austin94","id":4030377,"avatar_url":"https://avatars.githubusercontent.com/u/4030377?v=3","gravatar_id":"","url":"https://api.github.com/users/austin94","html_url":"https://github.com/austin94","followers_url":"https://api.github.com/users/austin94/followers","following_url":"https://api.github.com/users/austin94/following{/other_user}","gists_url":"https://api.github.com/users/austin94/gists{/gist_id}","starred_url":"https://api.github.com/users/austin94/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austin94/subscriptions","organizations_url":"https://api.github.com/users/austin94/orgs","repos_url":"https://api.github.com/users/austin94/repos","events_url":"https://api.github.com/users/austin94/events{/privacy}","received_events_url":"https://api.github.com/users/austin94/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/austin94/MyFields","description":"MyFields","fork":false,"url":"https://api.github.com/repos/austin94/MyFields","forks_url":"https://api.github.com/repos/austin94/MyFields/forks","keys_url":"https://api.github.com/repos/austin94/MyFields/keys{/key_id}","collaborators_url":"https://api.github.com/repos/austin94/MyFields/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/austin94/MyFields/teams","hooks_url":"https://api.github.com/repos/austin94/MyFields/hooks","issue_events_url":"https://api.github.com/repos/austin94/MyFields/issues/events{/number}","events_url":"https://api.github.com/repos/austin94/MyFields/events","assignees_url":"https://api.github.com/repos/austin94/MyFields/assignees{/user}","branches_url":"https://api.github.com/repos/austin94/MyFields/branches{/branch}","tags_url":"https://api.github.com/repos/austin94/MyFields/tags","blobs_url":"https://api.github.com/repos/austin94/MyFields/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/austin94/MyFields/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/austin94/MyFields/git/refs{/sha}","trees_url":"https://api.github.com/repos/austin94/MyFields/git/trees{/sha}","statuses_url":"https://api.github.com/repos/austin94/MyFields/statuses/{sha}","languages_url":"https://api.github.com/repos/austin94/MyFields/languages","stargazers_url":"https://api.github.com/repos/austin94/MyFields/stargazers","contributors_url":"https://api.github.com/repos/austin94/MyFields/contributors","subscribers_url":"https://api.github.com/repos/austin94/MyFields/subscribers","subscription_url":"https://api.github.com/repos/austin94/MyFields/subscription","commits_url":"https://api.github.com/repos/austin94/MyFields/commits{/sha}","git_commits_url":"https://api.github.com/repos/austin94/MyFields/git/commits{/sha}","comments_url":"https://api.github.com/repos/austin94/MyFields/comments{/number}","issue_comment_url":"https://api.github.com/repos/austin94/MyFields/issues/comments{/number}","contents_url":"https://api.github.com/repos/austin94/MyFields/contents/{+path}","compare_url":"https://api.github.com/repos/austin94/MyFields/compare/{base}...{head}","merges_url":"https://api.github.com/repos/austin94/MyFields/merges","archive_url":"https://api.github.com/repos/austin94/MyFields/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/austin94/MyFields/downloads","issues_url":"https://api.github.com/repos/austin94/MyFields/issues{/number}","pulls_url":"https://api.github.com/repos/austin94/MyFields/pulls{/number}","milestones_url":"https://api.github.com/repos/austin94/MyFields/milestones{/number}","notifications_url":"https://api.github.com/repos/austin94/MyFields/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/austin94/MyFields/labels{/name}","releases_url":"https://api.github.com/repos/austin94/MyFields/releases{/id}","deployments_url":"https://api.github.com/repos/austin94/MyFields/deployments","created_at":"2015-09-02T15:39:42Z","updated_at":"2016-02-09T03:03:34Z","pushed_at":"2016-04-12T15:09:40Z","git_url":"git://github.com/austin94/MyFields.git","ssh_url":"git@github.com:austin94/MyFields.git","clone_url":"https://github.com/austin94/MyFields.git","svn_url":"https://github.com/austin94/MyFields","homepage":"","size":4133,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/austin94/MyFields/pulls/25"},"html":{"href":"https://github.com/austin94/MyFields/pull/25"},"issue":{"href":"https://api.github.com/repos/austin94/MyFields/issues/25"},"comments":{"href":"https://api.github.com/repos/austin94/MyFields/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/austin94/MyFields/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/austin94/MyFields/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/austin94/MyFields/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/austin94/MyFields/statuses/ae8b0f7f338f8f369e44d426d6edb9e183ee16cd"}}}}