{"action":"created","comment":{"url":"https://api.github.com/repos/mknudsen01/conscious/pulls/comments/25563203","id":25563203,"diff_hunk":"@@ -56,9 +60,85 @@ CreateGroup = React.createClass({\n })\n \n Group = React.createClass({\n+  getInitialState: function() {\n+    return {\n+      showCreate: false,\n+      showAddTransactionText: true }\n+  },\n+\n+  toggleCreate: function() {\n+    this.setState({\n+      showCreate: !this.state.showCreate,\n+      showAddTransactionText: !this.state.showAddTransactionText\n+    })\n+  },\n+\n+  render: function() {\n+    var transactionElements = this.props.transactions.map(function(transactionData){\n+      return <Transaction key={transactionData.id} {...transactionData} />\n+    })\n+\n+    var maybeCreateTransaction = this.state.showCreate ? <CreateTransaction groupName={this.props.name}/> : void 0\n+\n+\n+    return (\n+      <section>\n+        <div>{this.props.name}</div>\n+        {maybeCreateTransaction}\n+        <button className=\"options-button\" onClick={this.toggleCreate}>{this.state.showAddTransactionText ? \"Add transaction\" : \"Cancel\"}</button>\n+        <div className=\"transactions\">\n+          {transactionElements}\n+        </div>\n+      </section>\n+    )\n+  }\n+})\n+\n+Transaction = React.createClass({\n   render: function() {\n     return (\n-      <div>{this.props.name}</div>\n+      <div>\n+        <div>{this.props.amount}</div>\n+        <div>{this.props.notes}</div>\n+      </div>\n+    )\n+  }\n+})\n+\n+CreateTransaction = React.createClass({\n+  createTransaction: function(transactionData) {\n+    AppAction.createTransaction(transactionData);\n+  },\n+\n+  clearForm: function() {\n+    this.refs.amount.getDOMNode().value = \"\";\n+    this.refs.notes.getDOMNode().value = \"\";\n+  },\n+\n+  prepareForm: function() {\n+    var transactionData = {};\n+    transactionData['group'] = this.props.groupName;\n+    transactionData['date'] = Date.now();\n+    transactionData['amount'] = Number(this.refs.amount.getDOMNode().value.trim());\n+    transactionData['notes'] = this.refs.notes.getDOMNode().value.trim();\n+    return transactionData;\n+  },\n+\n+  handleSubmit: function(e) {\n+    e.preventDefault();\n+    var transactionData = {};","path":"app/javascripts/components.jsx","position":91,"original_position":91,"commit_id":"99672277bb8e70a899f489b603b33d6f3ce628df","original_commit_id":"99672277bb8e70a899f489b603b33d6f3ce628df","user":{"login":"raorao","id":296116,"avatar_url":"https://avatars.githubusercontent.com/u/296116?v=3","gravatar_id":"","url":"https://api.github.com/users/raorao","html_url":"https://github.com/raorao","followers_url":"https://api.github.com/users/raorao/followers","following_url":"https://api.github.com/users/raorao/following{/other_user}","gists_url":"https://api.github.com/users/raorao/gists{/gist_id}","starred_url":"https://api.github.com/users/raorao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raorao/subscriptions","organizations_url":"https://api.github.com/users/raorao/orgs","repos_url":"https://api.github.com/users/raorao/repos","events_url":"https://api.github.com/users/raorao/events{/privacy}","received_events_url":"https://api.github.com/users/raorao/received_events","type":"User","site_admin":false},"body":"?","created_at":"2015-03-01T01:51:37Z","updated_at":"2015-03-01T01:51:37Z","html_url":"https://github.com/mknudsen01/conscious/pull/5#discussion_r25563203","pull_request_url":"https://api.github.com/repos/mknudsen01/conscious/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/mknudsen01/conscious/pulls/comments/25563203"},"html":{"href":"https://github.com/mknudsen01/conscious/pull/5#discussion_r25563203"},"pull_request":{"href":"https://api.github.com/repos/mknudsen01/conscious/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/mknudsen01/conscious/pulls/5","id":30232693,"html_url":"https://github.com/mknudsen01/conscious/pull/5","diff_url":"https://github.com/mknudsen01/conscious/pull/5.diff","patch_url":"https://github.com/mknudsen01/conscious/pull/5.patch","issue_url":"https://api.github.com/repos/mknudsen01/conscious/issues/5","number":5,"state":"open","locked":false,"title":"Transactions","user":{"login":"mknudsen01","id":5413085,"avatar_url":"https://avatars.githubusercontent.com/u/5413085?v=3","gravatar_id":"","url":"https://api.github.com/users/mknudsen01","html_url":"https://github.com/mknudsen01","followers_url":"https://api.github.com/users/mknudsen01/followers","following_url":"https://api.github.com/users/mknudsen01/following{/other_user}","gists_url":"https://api.github.com/users/mknudsen01/gists{/gist_id}","starred_url":"https://api.github.com/users/mknudsen01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mknudsen01/subscriptions","organizations_url":"https://api.github.com/users/mknudsen01/orgs","repos_url":"https://api.github.com/users/mknudsen01/repos","events_url":"https://api.github.com/users/mknudsen01/events{/privacy}","received_events_url":"https://api.github.com/users/mknudsen01/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-28T22:54:49Z","updated_at":"2015-03-01T01:51:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3b84c25c2bac8057a737fbc9464bb4bbdce22d0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mknudsen01/conscious/pulls/5/commits","review_comments_url":"https://api.github.com/repos/mknudsen01/conscious/pulls/5/comments","review_comment_url":"https://api.github.com/repos/mknudsen01/conscious/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mknudsen01/conscious/issues/5/comments","statuses_url":"https://api.github.com/repos/mknudsen01/conscious/statuses/99672277bb8e70a899f489b603b33d6f3ce628df","head":{"label":"mknudsen01:transactions","ref":"transactions","sha":"99672277bb8e70a899f489b603b33d6f3ce628df","user":{"login":"mknudsen01","id":5413085,"avatar_url":"https://avatars.githubusercontent.com/u/5413085?v=3","gravatar_id":"","url":"https://api.github.com/users/mknudsen01","html_url":"https://github.com/mknudsen01","followers_url":"https://api.github.com/users/mknudsen01/followers","following_url":"https://api.github.com/users/mknudsen01/following{/other_user}","gists_url":"https://api.github.com/users/mknudsen01/gists{/gist_id}","starred_url":"https://api.github.com/users/mknudsen01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mknudsen01/subscriptions","organizations_url":"https://api.github.com/users/mknudsen01/orgs","repos_url":"https://api.github.com/users/mknudsen01/repos","events_url":"https://api.github.com/users/mknudsen01/events{/privacy}","received_events_url":"https://api.github.com/users/mknudsen01/received_events","type":"User","site_admin":false},"repo":{"id":30568187,"name":"conscious","full_name":"mknudsen01/conscious","owner":{"login":"mknudsen01","id":5413085,"avatar_url":"https://avatars.githubusercontent.com/u/5413085?v=3","gravatar_id":"","url":"https://api.github.com/users/mknudsen01","html_url":"https://github.com/mknudsen01","followers_url":"https://api.github.com/users/mknudsen01/followers","following_url":"https://api.github.com/users/mknudsen01/following{/other_user}","gists_url":"https://api.github.com/users/mknudsen01/gists{/gist_id}","starred_url":"https://api.github.com/users/mknudsen01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mknudsen01/subscriptions","organizations_url":"https://api.github.com/users/mknudsen01/orgs","repos_url":"https://api.github.com/users/mknudsen01/repos","events_url":"https://api.github.com/users/mknudsen01/events{/privacy}","received_events_url":"https://api.github.com/users/mknudsen01/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mknudsen01/conscious","description":"Spend money more consciously","fork":false,"url":"https://api.github.com/repos/mknudsen01/conscious","forks_url":"https://api.github.com/repos/mknudsen01/conscious/forks","keys_url":"https://api.github.com/repos/mknudsen01/conscious/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mknudsen01/conscious/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mknudsen01/conscious/teams","hooks_url":"https://api.github.com/repos/mknudsen01/conscious/hooks","issue_events_url":"https://api.github.com/repos/mknudsen01/conscious/issues/events{/number}","events_url":"https://api.github.com/repos/mknudsen01/conscious/events","assignees_url":"https://api.github.com/repos/mknudsen01/conscious/assignees{/user}","branches_url":"https://api.github.com/repos/mknudsen01/conscious/branches{/branch}","tags_url":"https://api.github.com/repos/mknudsen01/conscious/tags","blobs_url":"https://api.github.com/repos/mknudsen01/conscious/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mknudsen01/conscious/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mknudsen01/conscious/git/refs{/sha}","trees_url":"https://api.github.com/repos/mknudsen01/conscious/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mknudsen01/conscious/statuses/{sha}","languages_url":"https://api.github.com/repos/mknudsen01/conscious/languages","stargazers_url":"https://api.github.com/repos/mknudsen01/conscious/stargazers","contributors_url":"https://api.github.com/repos/mknudsen01/conscious/contributors","subscribers_url":"https://api.github.com/repos/mknudsen01/conscious/subscribers","subscription_url":"https://api.github.com/repos/mknudsen01/conscious/subscription","commits_url":"https://api.github.com/repos/mknudsen01/conscious/commits{/sha}","git_commits_url":"https://api.github.com/repos/mknudsen01/conscious/git/commits{/sha}","comments_url":"https://api.github.com/repos/mknudsen01/conscious/comments{/number}","issue_comment_url":"https://api.github.com/repos/mknudsen01/conscious/issues/comments{/number}","contents_url":"https://api.github.com/repos/mknudsen01/conscious/contents/{+path}","compare_url":"https://api.github.com/repos/mknudsen01/conscious/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mknudsen01/conscious/merges","archive_url":"https://api.github.com/repos/mknudsen01/conscious/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mknudsen01/conscious/downloads","issues_url":"https://api.github.com/repos/mknudsen01/conscious/issues{/number}","pulls_url":"https://api.github.com/repos/mknudsen01/conscious/pulls{/number}","milestones_url":"https://api.github.com/repos/mknudsen01/conscious/milestones{/number}","notifications_url":"https://api.github.com/repos/mknudsen01/conscious/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mknudsen01/conscious/labels{/name}","releases_url":"https://api.github.com/repos/mknudsen01/conscious/releases{/id}","created_at":"2015-02-10T01:18:03Z","updated_at":"2015-02-25T18:10:29Z","pushed_at":"2015-02-28T22:54:31Z","git_url":"git://github.com/mknudsen01/conscious.git","ssh_url":"git@github.com:mknudsen01/conscious.git","clone_url":"https://github.com/mknudsen01/conscious.git","svn_url":"https://github.com/mknudsen01/conscious","homepage":null,"size":188,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"mknudsen01:master","ref":"master","sha":"63f1991ebe261624fb303dc9188d554b6589f92b","user":{"login":"mknudsen01","id":5413085,"avatar_url":"https://avatars.githubusercontent.com/u/5413085?v=3","gravatar_id":"","url":"https://api.github.com/users/mknudsen01","html_url":"https://github.com/mknudsen01","followers_url":"https://api.github.com/users/mknudsen01/followers","following_url":"https://api.github.com/users/mknudsen01/following{/other_user}","gists_url":"https://api.github.com/users/mknudsen01/gists{/gist_id}","starred_url":"https://api.github.com/users/mknudsen01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mknudsen01/subscriptions","organizations_url":"https://api.github.com/users/mknudsen01/orgs","repos_url":"https://api.github.com/users/mknudsen01/repos","events_url":"https://api.github.com/users/mknudsen01/events{/privacy}","received_events_url":"https://api.github.com/users/mknudsen01/received_events","type":"User","site_admin":false},"repo":{"id":30568187,"name":"conscious","full_name":"mknudsen01/conscious","owner":{"login":"mknudsen01","id":5413085,"avatar_url":"https://avatars.githubusercontent.com/u/5413085?v=3","gravatar_id":"","url":"https://api.github.com/users/mknudsen01","html_url":"https://github.com/mknudsen01","followers_url":"https://api.github.com/users/mknudsen01/followers","following_url":"https://api.github.com/users/mknudsen01/following{/other_user}","gists_url":"https://api.github.com/users/mknudsen01/gists{/gist_id}","starred_url":"https://api.github.com/users/mknudsen01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mknudsen01/subscriptions","organizations_url":"https://api.github.com/users/mknudsen01/orgs","repos_url":"https://api.github.com/users/mknudsen01/repos","events_url":"https://api.github.com/users/mknudsen01/events{/privacy}","received_events_url":"https://api.github.com/users/mknudsen01/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mknudsen01/conscious","description":"Spend money more consciously","fork":false,"url":"https://api.github.com/repos/mknudsen01/conscious","forks_url":"https://api.github.com/repos/mknudsen01/conscious/forks","keys_url":"https://api.github.com/repos/mknudsen01/conscious/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mknudsen01/conscious/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mknudsen01/conscious/teams","hooks_url":"https://api.github.com/repos/mknudsen01/conscious/hooks","issue_events_url":"https://api.github.com/repos/mknudsen01/conscious/issues/events{/number}","events_url":"https://api.github.com/repos/mknudsen01/conscious/events","assignees_url":"https://api.github.com/repos/mknudsen01/conscious/assignees{/user}","branches_url":"https://api.github.com/repos/mknudsen01/conscious/branches{/branch}","tags_url":"https://api.github.com/repos/mknudsen01/conscious/tags","blobs_url":"https://api.github.com/repos/mknudsen01/conscious/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mknudsen01/conscious/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mknudsen01/conscious/git/refs{/sha}","trees_url":"https://api.github.com/repos/mknudsen01/conscious/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mknudsen01/conscious/statuses/{sha}","languages_url":"https://api.github.com/repos/mknudsen01/conscious/languages","stargazers_url":"https://api.github.com/repos/mknudsen01/conscious/stargazers","contributors_url":"https://api.github.com/repos/mknudsen01/conscious/contributors","subscribers_url":"https://api.github.com/repos/mknudsen01/conscious/subscribers","subscription_url":"https://api.github.com/repos/mknudsen01/conscious/subscription","commits_url":"https://api.github.com/repos/mknudsen01/conscious/commits{/sha}","git_commits_url":"https://api.github.com/repos/mknudsen01/conscious/git/commits{/sha}","comments_url":"https://api.github.com/repos/mknudsen01/conscious/comments{/number}","issue_comment_url":"https://api.github.com/repos/mknudsen01/conscious/issues/comments{/number}","contents_url":"https://api.github.com/repos/mknudsen01/conscious/contents/{+path}","compare_url":"https://api.github.com/repos/mknudsen01/conscious/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mknudsen01/conscious/merges","archive_url":"https://api.github.com/repos/mknudsen01/conscious/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mknudsen01/conscious/downloads","issues_url":"https://api.github.com/repos/mknudsen01/conscious/issues{/number}","pulls_url":"https://api.github.com/repos/mknudsen01/conscious/pulls{/number}","milestones_url":"https://api.github.com/repos/mknudsen01/conscious/milestones{/number}","notifications_url":"https://api.github.com/repos/mknudsen01/conscious/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mknudsen01/conscious/labels{/name}","releases_url":"https://api.github.com/repos/mknudsen01/conscious/releases{/id}","created_at":"2015-02-10T01:18:03Z","updated_at":"2015-02-25T18:10:29Z","pushed_at":"2015-02-28T22:54:31Z","git_url":"git://github.com/mknudsen01/conscious.git","ssh_url":"git@github.com:mknudsen01/conscious.git","clone_url":"https://github.com/mknudsen01/conscious.git","svn_url":"https://github.com/mknudsen01/conscious","homepage":null,"size":188,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mknudsen01/conscious/pulls/5"},"html":{"href":"https://github.com/mknudsen01/conscious/pull/5"},"issue":{"href":"https://api.github.com/repos/mknudsen01/conscious/issues/5"},"comments":{"href":"https://api.github.com/repos/mknudsen01/conscious/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/mknudsen01/conscious/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/mknudsen01/conscious/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mknudsen01/conscious/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/mknudsen01/conscious/statuses/99672277bb8e70a899f489b603b33d6f3ce628df"}}}}