{"action":"created","comment":{"url":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/comments/35186306","id":35186306,"diff_hunk":"@@ -5,7 +5,36 @@ if Meteor.isClient\n   Template.organizationDetail.helpers\n     organization: ->\n       Organizations.findOne(@organizationId)\n+    userIsMember: ->\n+      UserProfiles.findOne({\n+        userId: Meteor.userId(),\n+        memberOfOrgs: @organizationId\n+      })\n+    memberCount: ->\n+      Organizations.findOne(@organizationId)?.getMemberProfiles().fetch().length\n+    members: ->\n+      Organizations.findOne(@organizationId)?.getMemberProfiles()\n+\n+  Template.organizationDetail.events\n+    'click .join-organization' : (event, instance) ->\n+      orgId = instance.data.organizationId\n+      Meteor.call 'joinOrganization', orgId, (error, response) ->\n+        if error\n+          toastr.error(\"Error\")\n+        else\n+          toastr.success(\"Success\")\n \n if Meteor.isServer\n-  Meteor.publish 'organizationDetail', (id) ->\n-    Organizations.find(id)\n+\n+  Meteor.publish('organizationDetail', (id) ->\n+    [\n+      Organizations.find(id)\n+      UserProfiles.find({\n+        memberOfOrgs: id\n+      })","path":"packages/controllers/organization_detail.coffee","position":32,"original_position":32,"commit_id":"0f763e7dcb63bc4311ea34dfcaceb87700903b08","original_commit_id":"6c607f56c6dc411f8ac2e7d33ddcd3b03be99147","user":{"login":"nathanathan","id":710024,"avatar_url":"https://avatars.githubusercontent.com/u/710024?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanathan","html_url":"https://github.com/nathanathan","followers_url":"https://api.github.com/users/nathanathan/followers","following_url":"https://api.github.com/users/nathanathan/following{/other_user}","gists_url":"https://api.github.com/users/nathanathan/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanathan/subscriptions","organizations_url":"https://api.github.com/users/nathanathan/orgs","repos_url":"https://api.github.com/users/nathanathan/repos","events_url":"https://api.github.com/users/nathanathan/events{/privacy}","received_events_url":"https://api.github.com/users/nathanathan/received_events","type":"User","site_admin":false},"body":"Sounds good to me.","created_at":"2015-07-22T07:03:42Z","updated_at":"2015-07-22T07:03:42Z","html_url":"https://github.com/ecohealthalliance/mantle/pull/69#discussion_r35186306","pull_request_url":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/comments/35186306"},"html":{"href":"https://github.com/ecohealthalliance/mantle/pull/69#discussion_r35186306"},"pull_request":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/69","id":40452236,"html_url":"https://github.com/ecohealthalliance/mantle/pull/69","diff_url":"https://github.com/ecohealthalliance/mantle/pull/69.diff","patch_url":"https://github.com/ecohealthalliance/mantle/pull/69.patch","issue_url":"https://api.github.com/repos/ecohealthalliance/mantle/issues/69","number":69,"state":"open","locked":false,"title":"Users can join an organization","user":{"login":"nathanathan","id":710024,"avatar_url":"https://avatars.githubusercontent.com/u/710024?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanathan","html_url":"https://github.com/nathanathan","followers_url":"https://api.github.com/users/nathanathan/followers","following_url":"https://api.github.com/users/nathanathan/following{/other_user}","gists_url":"https://api.github.com/users/nathanathan/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanathan/subscriptions","organizations_url":"https://api.github.com/users/nathanathan/orgs","repos_url":"https://api.github.com/users/nathanathan/repos","events_url":"https://api.github.com/users/nathanathan/events{/privacy}","received_events_url":"https://api.github.com/users/nathanathan/received_events","type":"User","site_admin":false},"body":"Notes:\r\n * Org membership is tracked in the user profile to simplify user profile the subscription.\r\n * The roles package is not used because it cannot make use of an index to find the users that belong to an arbitrary org, so viewing an org page would require scanning all the user profiles.\r\n * This won't work with old user accounts because the memberOfOrgs property has to be an array.","created_at":"2015-07-21T12:38:46Z","updated_at":"2015-07-22T07:03:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"632a8f20db9090783ccdcb17e89b3b62177e4491","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/69/commits","review_comments_url":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/69/comments","review_comment_url":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ecohealthalliance/mantle/issues/69/comments","statuses_url":"https://api.github.com/repos/ecohealthalliance/mantle/statuses/0f763e7dcb63bc4311ea34dfcaceb87700903b08","head":{"label":"ecohealthalliance:join-org","ref":"join-org","sha":"0f763e7dcb63bc4311ea34dfcaceb87700903b08","user":{"login":"ecohealthalliance","id":1501231,"avatar_url":"https://avatars.githubusercontent.com/u/1501231?v=3","gravatar_id":"","url":"https://api.github.com/users/ecohealthalliance","html_url":"https://github.com/ecohealthalliance","followers_url":"https://api.github.com/users/ecohealthalliance/followers","following_url":"https://api.github.com/users/ecohealthalliance/following{/other_user}","gists_url":"https://api.github.com/users/ecohealthalliance/gists{/gist_id}","starred_url":"https://api.github.com/users/ecohealthalliance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecohealthalliance/subscriptions","organizations_url":"https://api.github.com/users/ecohealthalliance/orgs","repos_url":"https://api.github.com/users/ecohealthalliance/repos","events_url":"https://api.github.com/users/ecohealthalliance/events{/privacy}","received_events_url":"https://api.github.com/users/ecohealthalliance/received_events","type":"Organization","site_admin":false},"repo":{"id":30246826,"name":"mantle","full_name":"ecohealthalliance/mantle","owner":{"login":"ecohealthalliance","id":1501231,"avatar_url":"https://avatars.githubusercontent.com/u/1501231?v=3","gravatar_id":"","url":"https://api.github.com/users/ecohealthalliance","html_url":"https://github.com/ecohealthalliance","followers_url":"https://api.github.com/users/ecohealthalliance/followers","following_url":"https://api.github.com/users/ecohealthalliance/following{/other_user}","gists_url":"https://api.github.com/users/ecohealthalliance/gists{/gist_id}","starred_url":"https://api.github.com/users/ecohealthalliance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecohealthalliance/subscriptions","organizations_url":"https://api.github.com/users/ecohealthalliance/orgs","repos_url":"https://api.github.com/users/ecohealthalliance/repos","events_url":"https://api.github.com/users/ecohealthalliance/events{/privacy}","received_events_url":"https://api.github.com/users/ecohealthalliance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ecohealthalliance/mantle","description":"An open-source web platform to power the next decade of One Health biosurveillance","fork":false,"url":"https://api.github.com/repos/ecohealthalliance/mantle","forks_url":"https://api.github.com/repos/ecohealthalliance/mantle/forks","keys_url":"https://api.github.com/repos/ecohealthalliance/mantle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecohealthalliance/mantle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecohealthalliance/mantle/teams","hooks_url":"https://api.github.com/repos/ecohealthalliance/mantle/hooks","issue_events_url":"https://api.github.com/repos/ecohealthalliance/mantle/issues/events{/number}","events_url":"https://api.github.com/repos/ecohealthalliance/mantle/events","assignees_url":"https://api.github.com/repos/ecohealthalliance/mantle/assignees{/user}","branches_url":"https://api.github.com/repos/ecohealthalliance/mantle/branches{/branch}","tags_url":"https://api.github.com/repos/ecohealthalliance/mantle/tags","blobs_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecohealthalliance/mantle/statuses/{sha}","languages_url":"https://api.github.com/repos/ecohealthalliance/mantle/languages","stargazers_url":"https://api.github.com/repos/ecohealthalliance/mantle/stargazers","contributors_url":"https://api.github.com/repos/ecohealthalliance/mantle/contributors","subscribers_url":"https://api.github.com/repos/ecohealthalliance/mantle/subscribers","subscription_url":"https://api.github.com/repos/ecohealthalliance/mantle/subscription","commits_url":"https://api.github.com/repos/ecohealthalliance/mantle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecohealthalliance/mantle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecohealthalliance/mantle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecohealthalliance/mantle/contents/{+path}","compare_url":"https://api.github.com/repos/ecohealthalliance/mantle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecohealthalliance/mantle/merges","archive_url":"https://api.github.com/repos/ecohealthalliance/mantle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecohealthalliance/mantle/downloads","issues_url":"https://api.github.com/repos/ecohealthalliance/mantle/issues{/number}","pulls_url":"https://api.github.com/repos/ecohealthalliance/mantle/pulls{/number}","milestones_url":"https://api.github.com/repos/ecohealthalliance/mantle/milestones{/number}","notifications_url":"https://api.github.com/repos/ecohealthalliance/mantle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecohealthalliance/mantle/labels{/name}","releases_url":"https://api.github.com/repos/ecohealthalliance/mantle/releases{/id}","created_at":"2015-02-03T14:32:36Z","updated_at":"2015-06-10T18:00:18Z","pushed_at":"2015-07-22T06:58:37Z","git_url":"git://github.com/ecohealthalliance/mantle.git","ssh_url":"git@github.com:ecohealthalliance/mantle.git","clone_url":"https://github.com/ecohealthalliance/mantle.git","svn_url":"https://github.com/ecohealthalliance/mantle","homepage":"http://mantle.io","size":1303,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":40,"forks":0,"open_issues":40,"watchers":2,"default_branch":"master"}},"base":{"label":"ecohealthalliance:master","ref":"master","sha":"010777cc97ac299f96ccfdd68a5da07897a36490","user":{"login":"ecohealthalliance","id":1501231,"avatar_url":"https://avatars.githubusercontent.com/u/1501231?v=3","gravatar_id":"","url":"https://api.github.com/users/ecohealthalliance","html_url":"https://github.com/ecohealthalliance","followers_url":"https://api.github.com/users/ecohealthalliance/followers","following_url":"https://api.github.com/users/ecohealthalliance/following{/other_user}","gists_url":"https://api.github.com/users/ecohealthalliance/gists{/gist_id}","starred_url":"https://api.github.com/users/ecohealthalliance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecohealthalliance/subscriptions","organizations_url":"https://api.github.com/users/ecohealthalliance/orgs","repos_url":"https://api.github.com/users/ecohealthalliance/repos","events_url":"https://api.github.com/users/ecohealthalliance/events{/privacy}","received_events_url":"https://api.github.com/users/ecohealthalliance/received_events","type":"Organization","site_admin":false},"repo":{"id":30246826,"name":"mantle","full_name":"ecohealthalliance/mantle","owner":{"login":"ecohealthalliance","id":1501231,"avatar_url":"https://avatars.githubusercontent.com/u/1501231?v=3","gravatar_id":"","url":"https://api.github.com/users/ecohealthalliance","html_url":"https://github.com/ecohealthalliance","followers_url":"https://api.github.com/users/ecohealthalliance/followers","following_url":"https://api.github.com/users/ecohealthalliance/following{/other_user}","gists_url":"https://api.github.com/users/ecohealthalliance/gists{/gist_id}","starred_url":"https://api.github.com/users/ecohealthalliance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecohealthalliance/subscriptions","organizations_url":"https://api.github.com/users/ecohealthalliance/orgs","repos_url":"https://api.github.com/users/ecohealthalliance/repos","events_url":"https://api.github.com/users/ecohealthalliance/events{/privacy}","received_events_url":"https://api.github.com/users/ecohealthalliance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ecohealthalliance/mantle","description":"An open-source web platform to power the next decade of One Health biosurveillance","fork":false,"url":"https://api.github.com/repos/ecohealthalliance/mantle","forks_url":"https://api.github.com/repos/ecohealthalliance/mantle/forks","keys_url":"https://api.github.com/repos/ecohealthalliance/mantle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecohealthalliance/mantle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecohealthalliance/mantle/teams","hooks_url":"https://api.github.com/repos/ecohealthalliance/mantle/hooks","issue_events_url":"https://api.github.com/repos/ecohealthalliance/mantle/issues/events{/number}","events_url":"https://api.github.com/repos/ecohealthalliance/mantle/events","assignees_url":"https://api.github.com/repos/ecohealthalliance/mantle/assignees{/user}","branches_url":"https://api.github.com/repos/ecohealthalliance/mantle/branches{/branch}","tags_url":"https://api.github.com/repos/ecohealthalliance/mantle/tags","blobs_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecohealthalliance/mantle/statuses/{sha}","languages_url":"https://api.github.com/repos/ecohealthalliance/mantle/languages","stargazers_url":"https://api.github.com/repos/ecohealthalliance/mantle/stargazers","contributors_url":"https://api.github.com/repos/ecohealthalliance/mantle/contributors","subscribers_url":"https://api.github.com/repos/ecohealthalliance/mantle/subscribers","subscription_url":"https://api.github.com/repos/ecohealthalliance/mantle/subscription","commits_url":"https://api.github.com/repos/ecohealthalliance/mantle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecohealthalliance/mantle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecohealthalliance/mantle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecohealthalliance/mantle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecohealthalliance/mantle/contents/{+path}","compare_url":"https://api.github.com/repos/ecohealthalliance/mantle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecohealthalliance/mantle/merges","archive_url":"https://api.github.com/repos/ecohealthalliance/mantle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecohealthalliance/mantle/downloads","issues_url":"https://api.github.com/repos/ecohealthalliance/mantle/issues{/number}","pulls_url":"https://api.github.com/repos/ecohealthalliance/mantle/pulls{/number}","milestones_url":"https://api.github.com/repos/ecohealthalliance/mantle/milestones{/number}","notifications_url":"https://api.github.com/repos/ecohealthalliance/mantle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecohealthalliance/mantle/labels{/name}","releases_url":"https://api.github.com/repos/ecohealthalliance/mantle/releases{/id}","created_at":"2015-02-03T14:32:36Z","updated_at":"2015-06-10T18:00:18Z","pushed_at":"2015-07-22T06:58:37Z","git_url":"git://github.com/ecohealthalliance/mantle.git","ssh_url":"git@github.com:ecohealthalliance/mantle.git","clone_url":"https://github.com/ecohealthalliance/mantle.git","svn_url":"https://github.com/ecohealthalliance/mantle","homepage":"http://mantle.io","size":1303,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":40,"forks":0,"open_issues":40,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/69"},"html":{"href":"https://github.com/ecohealthalliance/mantle/pull/69"},"issue":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/issues/69"},"comments":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/ecohealthalliance/mantle/statuses/0f763e7dcb63bc4311ea34dfcaceb87700903b08"}}}}