{"action":"created","comment":{"url":"https://api.github.com/repos/catarse/catarse.js/pulls/comments/60297421","id":60297421,"diff_hunk":"@@ -0,0 +1,105 @@\n+/**\n+ * window.c.OwnerMessageContent component\n+ * Render project owner contact form\n+ *\n+ */\n+window.c.OwnerMessageContent = ((m, h, _, models, I18n) => {\n+    return {\n+        controller: (args) => {\n+          let l = m.prop(false),\n+          sendSuccess = m.prop(false),\n+          sendMessage = () => {\n+              let loaderOpts = models.directMessage.postOptions({\n+                from_name: document.getElementById('from_name').value,\n+                from_email: document.getElementById('from_email').value,\n+                user_id: h.getUser()['user_id'],\n+                content: document.getElementById('message_content').value,\n+                project_id: h.getCurrentProject()['project_id'],\n+                to_user_id: h.getCurrentProject()['project_user_id']\n+              });\n+              l = m.postgrest.loaderWithToken(loaderOpts);\n+\n+              l.load().then(sendSuccess(true));\n+          };\n+\n+          return {\n+            sendMessage: sendMessage,\n+            sendSuccess: sendSuccess,\n+            userDetails: args\n+          };\n+        },\n+        view: (ctrl, args) => {\n+          const user = h.getUser(),\n+           successMessage = m(\".modal-dialog-content.u-text-center\",\n+              [\n+                m(\".fa.fa-check-circle.fa-5x.text-success.u-marginbottom-40\"),\n+                m(\"p.fontsize-large\", \n+                  `Sua mensagem foi enviada com sucesso para ${_.first(ctrl.userDetails()).name}. Você vai receber uma cópia no seu email e pode seguir a conversa por lá!`\n+                )\n+              ]\n+            ),\n+            contactForm = [\n+              m('.modal-dialog-content',\n+                  [\n+                    m('.w-form',\n+                      [\n+                        m('form',\n+                          [\n+                            m('.w-row',\n+                              [\n+                                m('.w-col.w-col-6',\n+                                  [\n+                                    m('label.fontsize-smaller',\n+                                    'Seu nome'\n+                                    ),\n+                                    m(`input.w-input.text-field[value='${user ? user['name'] : ''}'][id='from_name'][type='text'][required]`)\n+                                  ]\n+                                ),\n+                                m('.w-col.w-col-6',\n+                                  [\n+                                    m('label.fontsize-smaller',\n+                                    'Seu email'\n+                                    ),\n+                                    m(`input.w-input.text-field[value='${user ? user['email'] : ''}'][id='from_email'][type='text'][required]`)\n+                                  ]\n+                                )\n+                              ]\n+                            ),\n+                            m('label',\n+                            'Mensagem'\n+                            ),\n+                            m('textarea.w-input.text-field.height-small[id=\\'message_content\\'][required]')\n+                          ]\n+                        )\n+                      ]\n+                    ),\n+                    m('.fontsize-smallest.fontcolor-terciary',\n+                    'Você receberá uma cópia desta mensagem em seu email.'\n+                    )\n+                  ]\n+                ),\n+              m('.modal-dialog-nav-bottom',\n+                m('.w-row',\n+                    [\n+                      m('.w-col.w-col-3'),\n+                      m('.w-col.w-col-6',\n+                      m('a.btn.btn-large[href=\\'js:void(0);\\']',{onclick: ctrl.sendMessage },","path":"src/c/owner-message-content.js","position":86,"original_position":86,"commit_id":"8bff4c958ff5c234978afc8ce7f66610137900d0","original_commit_id":"8bff4c958ff5c234978afc8ce7f66610137900d0","user":{"login":"vicnicius","id":1326024,"avatar_url":"https://avatars.githubusercontent.com/u/1326024?v=3","gravatar_id":"","url":"https://api.github.com/users/vicnicius","html_url":"https://github.com/vicnicius","followers_url":"https://api.github.com/users/vicnicius/followers","following_url":"https://api.github.com/users/vicnicius/following{/other_user}","gists_url":"https://api.github.com/users/vicnicius/gists{/gist_id}","starred_url":"https://api.github.com/users/vicnicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicnicius/subscriptions","organizations_url":"https://api.github.com/users/vicnicius/orgs","repos_url":"https://api.github.com/users/vicnicius/repos","events_url":"https://api.github.com/users/vicnicius/events{/privacy}","received_events_url":"https://api.github.com/users/vicnicius/received_events","type":"User","site_admin":false},"body":"The href should be `javascript:void(0)`.","created_at":"2016-04-19T19:42:57Z","updated_at":"2016-04-19T19:42:57Z","html_url":"https://github.com/catarse/catarse.js/pull/178#discussion_r60297421","pull_request_url":"https://api.github.com/repos/catarse/catarse.js/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/catarse/catarse.js/pulls/comments/60297421"},"html":{"href":"https://github.com/catarse/catarse.js/pull/178#discussion_r60297421"},"pull_request":{"href":"https://api.github.com/repos/catarse/catarse.js/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/catarse/catarse.js/pulls/178","id":67073806,"html_url":"https://github.com/catarse/catarse.js/pull/178","diff_url":"https://github.com/catarse/catarse.js/pull/178.diff","patch_url":"https://github.com/catarse/catarse.js/pull/178.patch","issue_url":"https://api.github.com/repos/catarse/catarse.js/issues/178","number":178,"state":"open","locked":false,"title":"add direct message to project page","user":{"login":"adrianob","id":2192093,"avatar_url":"https://avatars.githubusercontent.com/u/2192093?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianob","html_url":"https://github.com/adrianob","followers_url":"https://api.github.com/users/adrianob/followers","following_url":"https://api.github.com/users/adrianob/following{/other_user}","gists_url":"https://api.github.com/users/adrianob/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianob/subscriptions","organizations_url":"https://api.github.com/users/adrianob/orgs","repos_url":"https://api.github.com/users/adrianob/repos","events_url":"https://api.github.com/users/adrianob/events{/privacy}","received_events_url":"https://api.github.com/users/adrianob/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-19T19:17:31Z","updated_at":"2016-04-19T19:42:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5e3df6d54912b5ee9bf7bc94e5747c3097e71a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/catarse/catarse.js/pulls/178/commits","review_comments_url":"https://api.github.com/repos/catarse/catarse.js/pulls/178/comments","review_comment_url":"https://api.github.com/repos/catarse/catarse.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/catarse/catarse.js/issues/178/comments","statuses_url":"https://api.github.com/repos/catarse/catarse.js/statuses/8bff4c958ff5c234978afc8ce7f66610137900d0","head":{"label":"adrianob:direct_message","ref":"direct_message","sha":"8bff4c958ff5c234978afc8ce7f66610137900d0","user":{"login":"adrianob","id":2192093,"avatar_url":"https://avatars.githubusercontent.com/u/2192093?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianob","html_url":"https://github.com/adrianob","followers_url":"https://api.github.com/users/adrianob/followers","following_url":"https://api.github.com/users/adrianob/following{/other_user}","gists_url":"https://api.github.com/users/adrianob/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianob/subscriptions","organizations_url":"https://api.github.com/users/adrianob/orgs","repos_url":"https://api.github.com/users/adrianob/repos","events_url":"https://api.github.com/users/adrianob/events{/privacy}","received_events_url":"https://api.github.com/users/adrianob/received_events","type":"User","site_admin":false},"repo":{"id":41822716,"name":"catarse.js","full_name":"adrianob/catarse.js","owner":{"login":"adrianob","id":2192093,"avatar_url":"https://avatars.githubusercontent.com/u/2192093?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianob","html_url":"https://github.com/adrianob","followers_url":"https://api.github.com/users/adrianob/followers","following_url":"https://api.github.com/users/adrianob/following{/other_user}","gists_url":"https://api.github.com/users/adrianob/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianob/subscriptions","organizations_url":"https://api.github.com/users/adrianob/orgs","repos_url":"https://api.github.com/users/adrianob/repos","events_url":"https://api.github.com/users/adrianob/events{/privacy}","received_events_url":"https://api.github.com/users/adrianob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adrianob/catarse.js","description":"Mithril components for the Catarse world","fork":true,"url":"https://api.github.com/repos/adrianob/catarse.js","forks_url":"https://api.github.com/repos/adrianob/catarse.js/forks","keys_url":"https://api.github.com/repos/adrianob/catarse.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adrianob/catarse.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adrianob/catarse.js/teams","hooks_url":"https://api.github.com/repos/adrianob/catarse.js/hooks","issue_events_url":"https://api.github.com/repos/adrianob/catarse.js/issues/events{/number}","events_url":"https://api.github.com/repos/adrianob/catarse.js/events","assignees_url":"https://api.github.com/repos/adrianob/catarse.js/assignees{/user}","branches_url":"https://api.github.com/repos/adrianob/catarse.js/branches{/branch}","tags_url":"https://api.github.com/repos/adrianob/catarse.js/tags","blobs_url":"https://api.github.com/repos/adrianob/catarse.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adrianob/catarse.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adrianob/catarse.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/adrianob/catarse.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adrianob/catarse.js/statuses/{sha}","languages_url":"https://api.github.com/repos/adrianob/catarse.js/languages","stargazers_url":"https://api.github.com/repos/adrianob/catarse.js/stargazers","contributors_url":"https://api.github.com/repos/adrianob/catarse.js/contributors","subscribers_url":"https://api.github.com/repos/adrianob/catarse.js/subscribers","subscription_url":"https://api.github.com/repos/adrianob/catarse.js/subscription","commits_url":"https://api.github.com/repos/adrianob/catarse.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/adrianob/catarse.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/adrianob/catarse.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/adrianob/catarse.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/adrianob/catarse.js/contents/{+path}","compare_url":"https://api.github.com/repos/adrianob/catarse.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adrianob/catarse.js/merges","archive_url":"https://api.github.com/repos/adrianob/catarse.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adrianob/catarse.js/downloads","issues_url":"https://api.github.com/repos/adrianob/catarse.js/issues{/number}","pulls_url":"https://api.github.com/repos/adrianob/catarse.js/pulls{/number}","milestones_url":"https://api.github.com/repos/adrianob/catarse.js/milestones{/number}","notifications_url":"https://api.github.com/repos/adrianob/catarse.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adrianob/catarse.js/labels{/name}","releases_url":"https://api.github.com/repos/adrianob/catarse.js/releases{/id}","deployments_url":"https://api.github.com/repos/adrianob/catarse.js/deployments","created_at":"2015-09-02T19:19:37Z","updated_at":"2015-09-02T19:19:38Z","pushed_at":"2016-04-19T19:14:48Z","git_url":"git://github.com/adrianob/catarse.js.git","ssh_url":"git@github.com:adrianob/catarse.js.git","clone_url":"https://github.com/adrianob/catarse.js.git","svn_url":"https://github.com/adrianob/catarse.js","homepage":"","size":10361,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"catarse:master","ref":"master","sha":"8c6813670a1f743bb3cd6ecab5175ed59915d10d","user":{"login":"catarse","id":721161,"avatar_url":"https://avatars.githubusercontent.com/u/721161?v=3","gravatar_id":"","url":"https://api.github.com/users/catarse","html_url":"https://github.com/catarse","followers_url":"https://api.github.com/users/catarse/followers","following_url":"https://api.github.com/users/catarse/following{/other_user}","gists_url":"https://api.github.com/users/catarse/gists{/gist_id}","starred_url":"https://api.github.com/users/catarse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catarse/subscriptions","organizations_url":"https://api.github.com/users/catarse/orgs","repos_url":"https://api.github.com/users/catarse/repos","events_url":"https://api.github.com/users/catarse/events{/privacy}","received_events_url":"https://api.github.com/users/catarse/received_events","type":"Organization","site_admin":false},"repo":{"id":37343900,"name":"catarse.js","full_name":"catarse/catarse.js","owner":{"login":"catarse","id":721161,"avatar_url":"https://avatars.githubusercontent.com/u/721161?v=3","gravatar_id":"","url":"https://api.github.com/users/catarse","html_url":"https://github.com/catarse","followers_url":"https://api.github.com/users/catarse/followers","following_url":"https://api.github.com/users/catarse/following{/other_user}","gists_url":"https://api.github.com/users/catarse/gists{/gist_id}","starred_url":"https://api.github.com/users/catarse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catarse/subscriptions","organizations_url":"https://api.github.com/users/catarse/orgs","repos_url":"https://api.github.com/users/catarse/repos","events_url":"https://api.github.com/users/catarse/events{/privacy}","received_events_url":"https://api.github.com/users/catarse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/catarse/catarse.js","description":"Mithril components for the Catarse world","fork":false,"url":"https://api.github.com/repos/catarse/catarse.js","forks_url":"https://api.github.com/repos/catarse/catarse.js/forks","keys_url":"https://api.github.com/repos/catarse/catarse.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/catarse/catarse.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/catarse/catarse.js/teams","hooks_url":"https://api.github.com/repos/catarse/catarse.js/hooks","issue_events_url":"https://api.github.com/repos/catarse/catarse.js/issues/events{/number}","events_url":"https://api.github.com/repos/catarse/catarse.js/events","assignees_url":"https://api.github.com/repos/catarse/catarse.js/assignees{/user}","branches_url":"https://api.github.com/repos/catarse/catarse.js/branches{/branch}","tags_url":"https://api.github.com/repos/catarse/catarse.js/tags","blobs_url":"https://api.github.com/repos/catarse/catarse.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/catarse/catarse.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/catarse/catarse.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/catarse/catarse.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/catarse/catarse.js/statuses/{sha}","languages_url":"https://api.github.com/repos/catarse/catarse.js/languages","stargazers_url":"https://api.github.com/repos/catarse/catarse.js/stargazers","contributors_url":"https://api.github.com/repos/catarse/catarse.js/contributors","subscribers_url":"https://api.github.com/repos/catarse/catarse.js/subscribers","subscription_url":"https://api.github.com/repos/catarse/catarse.js/subscription","commits_url":"https://api.github.com/repos/catarse/catarse.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/catarse/catarse.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/catarse/catarse.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/catarse/catarse.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/catarse/catarse.js/contents/{+path}","compare_url":"https://api.github.com/repos/catarse/catarse.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/catarse/catarse.js/merges","archive_url":"https://api.github.com/repos/catarse/catarse.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/catarse/catarse.js/downloads","issues_url":"https://api.github.com/repos/catarse/catarse.js/issues{/number}","pulls_url":"https://api.github.com/repos/catarse/catarse.js/pulls{/number}","milestones_url":"https://api.github.com/repos/catarse/catarse.js/milestones{/number}","notifications_url":"https://api.github.com/repos/catarse/catarse.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/catarse/catarse.js/labels{/name}","releases_url":"https://api.github.com/repos/catarse/catarse.js/releases{/id}","deployments_url":"https://api.github.com/repos/catarse/catarse.js/deployments","created_at":"2015-06-12T20:49:31Z","updated_at":"2016-03-30T01:06:38Z","pushed_at":"2016-04-19T19:17:32Z","git_url":"git://github.com/catarse/catarse.js.git","ssh_url":"git@github.com:catarse/catarse.js.git","clone_url":"https://github.com/catarse/catarse.js.git","svn_url":"https://github.com/catarse/catarse.js","homepage":"","size":10707,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":2,"forks":10,"open_issues":2,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/catarse/catarse.js/pulls/178"},"html":{"href":"https://github.com/catarse/catarse.js/pull/178"},"issue":{"href":"https://api.github.com/repos/catarse/catarse.js/issues/178"},"comments":{"href":"https://api.github.com/repos/catarse/catarse.js/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/catarse/catarse.js/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/catarse/catarse.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/catarse/catarse.js/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/catarse/catarse.js/statuses/8bff4c958ff5c234978afc8ce7f66610137900d0"}}}}