{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/qiita/pulls/comments/115872850","pull_request_review_id":37444492,"id":115872850,"diff_hunk":"@@ -0,0 +1,175 @@\n+{% from qiita_core.qiita_settings import qiita_config %}\n+{% from future.utils import viewitems %}\n+{% extends sitebase.html %}\n+\n+{%block head%}\n+<link rel=\"stylesheet\" href=\"{% raw qiita_config.portal_dir %}/static/vendor/css/select2.min.css\" type=\"text/css\">\n+<script type=\"text/javascript\" src=\"{% raw qiita_config.portal_dir %}/static/vendor/js/select2.min.js\"></script>\n+<script type=\"text/javascript\" src=\"{% raw qiita_config.portal_dir %}/static/js/sharing.js\"></script>\n+<script type=\"text/javascript\">\n+  $(document).ready(function() {\n+    moi.init(null, window.location.host + '{% raw qiita_config.portal_dir %}/study/list/socket/', function(){}, error, error);\n+    moi.add_callback('sel', show_alert);\n+    $(\"#redbiom-table\").dataTable({\n+      \"dom\": 'lfrt<\"footer\">ip',\n+      'footerCallback': function ( row, data, start, end, display ) {\n+        var api = this.api(), data;\n+        var total_samples = api\n+          .column(4)\n+          .data()\n+          .reduce( function (a, b) { return a + b.samples.length; }, 0);\n+\n+        $('.footer').addClass(\"col-md-12 text-right\");\n+        if (total_samples == 0) {\n+          text = ''\n+        } else {\n+          if ($(\"#search_on\").val() == 'categories'){\n+            text = 'Found ' + total_samples + ' categories.';\n+          } else {\n+            text = 'Found ' + total_samples + ' samples.';\n+          }\n+        }\n+        $('.footer').html(text)\n+      },\n+      \"columns\": [\n+        { \"data\": null, \"orderable\": false, \"width\": \"10%\" },\n+        { \"data\": null, \"width\": \"40%\"  },\n+        { \"data\": \"aname\", \"width\": \"20%\"  },\n+        { \"data\": null, \"width\": \"20%\"  },\n+        { \"data\": null, \"width\": \"10%\" }\n+      ],\n+      columnDefs: [\n+        {type:'natural', targets:[1,2,3,4]},\n+        // render Add to Analysis button\n+        {\"render\": function ( data, type, row, meta ) {\n+          {% if current_user is not None %}\n+            var text = '<input type=\"button\" class=\"btn btn-sm\" value=\"Add to analysis\" onclick=\"redbiom_send_to_moi(' +\n+                       row.artifact_id + ', ' + meta.row + ')\">';\n+          {% else %}\n+            var text = ''\n+          {% end %}\n+          return text;\n+        }, targets: [0]},\n+        // render Study title\n+        {\"render\": function ( data, type, row, meta ) {\n+          {% if current_user is not None %}\n+            var text = '<a target=\"_blank\" href=\"{% raw qiita_config.portal_dir %}/study/description/' +\n+                       row.study_id + '\" role=\"button\">' + row.study_title + ' (ID: ' + row.study_id + ')</a>';\n+          {% else %}\n+            var text = row.study_title + ' (ID: ' + row.study_id + ')';\n+          {% end %}\n+          return text;\n+        }, targets: [1]},\n+        // render Artifact Processing\n+        {\"render\": function ( data, type, row, meta ) {\n+            var text = '';\n+            if (!(!row.command)) {\n+              text += row.command;\n+            }\n+            if (!(!row.software)) {\n+              text += ' ' + row.software;\n+            }\n+            if (!(!row.version)) {\n+              text += ' v' + row.version;\n+            }\n+          return text;\n+        }, targets: [3]},\n+        // render Artifact Processing\n+        {\"render\": function ( data, type, row, meta ) {\n+          return row.samples.length;\n+        }, targets: [4]}\n+      ],\n+      \"language\": {\n+          \"search\": \"Filter results by column data (Study Name, Artifact Name, Software, etc):\",\n+          \"loadingRecords\": \"Please wait - loading information ...\",\n+          \"zeroRecords\": \"  \"\n+      },\n+  });\n+\n+    $(\"#submitForm\").submit(function(event){\n+      event.preventDefault();\n+\n+      show_loading(\"redbiom-info\")\n+\n+      var search = $(\"#search\").val();\n+      var search_on = $(\"#search_on\").val();\n+\n+      $.post(\"{% raw qiita_config.portal_dir %}/redbiom/\", {'search': search, 'search_on': search_on})\n+        .done(function ( data ){\n+          var redbiom_table = $('#redbiom-table').DataTable();\n+          var redbiom_info = $('#redbiom-info');\n+          redbiom_table.clear().draw();\n+          if(data.status == \"error\") {\n+            bootstrapAlert(data.message.replace(\"\\n\", \"<br/>\"), \"danger\");\n+          } else {\n+            if(data.message != ''){\n+              redbiom_info.html(\n+                `<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">\n+                <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\n+                <strong>Warning!</strong> ` + data.message + `</div><br/>`)\n+            } else if(data.data){\n+              $('#redbiom-table tr:eq(0) th:eq(1)').text(\"Study Title\");\n+              if (search_on != 'categories') {\n+                {% if current_user is not None %}\n+                  $('#redbiom-table tr:eq(0) th:eq(0)').text(\"Add to Analysis\");\n+                {% end %}\n+                $('#redbiom-table tr:eq(0) th:eq(2)').text(\"Artifact Name\");\n+                $('#redbiom-table tr:eq(0) th:eq(3)').text(\"Artifact Processing\");\n+                $('#redbiom-table tr:eq(0) th:eq(4)').text(\"# of Samples Found\");\n+              } else {\n+                $('#redbiom-table tr:eq(0) th:eq(3)').text(\"Metadata Categories\");\n+                $('#redbiom-table tr:eq(0) th:eq(4)').text(\"# of Categories Found\");\n+              }\n+              redbiom_table.rows.add(data.data).draw();\n+              redbiom_info.html('');\n+            }\n+          }\n+        });\n+    });\n+  });\n+</script>\n+\n+{%end%}\n+\n+{%block content%}\n+  <small>Some general instructions!</small>\n+  <br/><br/>\n+  <form data-toggle=\"validator\" role=\"form\" id=\"submitForm\">\n+    <div class=\"form-group row\">\n+      <div class=\"col-xs-9\">\n+        <input type=\"text\" class=\"form-control\" name=\"search\" id=\"search\" placeholder=\"Search\" required>\n+      </div>\n+\n+      <div class=\"col-xs-2\">\n+        <select class=\"selectpicker form-control col-xs-2\" name=\"search_on\" id=\"search_on\">\n+          <option value=\"metadata\">Metadata</option>\n+          <option checked value=\"observations\">Observation</option>\n+          <option checked value=\"categories\">Metadata Categories</option>\n+        </select>\n+      </div>\n+      <div class=\"col-xs-1\">\n+          <button class=\"btn btn-default\" type=\"submit\">GO!</button>","path":"qiita_pet/templates/redbiom.html","position":151,"original_position":151,"commit_id":"d46392e23d1c8769593b48164a519486c90d9e07","original_commit_id":"d46392e23d1c8769593b48164a519486c90d9e07","user":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars1.githubusercontent.com/u/2501478?v=3","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"body":"`GO!` -> `Search`","created_at":"2017-05-10T23:02:28Z","updated_at":"2017-05-10T23:07:33Z","html_url":"https://github.com/biocore/qiita/pull/2118#discussion_r115872850","pull_request_url":"https://api.github.com/repos/biocore/qiita/pulls/2118","_links":{"self":{"href":"https://api.github.com/repos/biocore/qiita/pulls/comments/115872850"},"html":{"href":"https://github.com/biocore/qiita/pull/2118#discussion_r115872850"},"pull_request":{"href":"https://api.github.com/repos/biocore/qiita/pulls/2118"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/qiita/pulls/2118","id":117741113,"html_url":"https://github.com/biocore/qiita/pull/2118","diff_url":"https://github.com/biocore/qiita/pull/2118.diff","patch_url":"https://github.com/biocore/qiita/pull/2118.patch","issue_url":"https://api.github.com/repos/biocore/qiita/issues/2118","number":2118,"state":"open","locked":false,"title":"Let's get redbiom-ing","user":{"login":"antgonza","id":2014559,"avatar_url":"https://avatars1.githubusercontent.com/u/2014559?v=3","gravatar_id":"","url":"https://api.github.com/users/antgonza","html_url":"https://github.com/antgonza","followers_url":"https://api.github.com/users/antgonza/followers","following_url":"https://api.github.com/users/antgonza/following{/other_user}","gists_url":"https://api.github.com/users/antgonza/gists{/gist_id}","starred_url":"https://api.github.com/users/antgonza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antgonza/subscriptions","organizations_url":"https://api.github.com/users/antgonza/orgs","repos_url":"https://api.github.com/users/antgonza/repos","events_url":"https://api.github.com/users/antgonza/events{/privacy}","received_events_url":"https://api.github.com/users/antgonza/received_events","type":"User","site_admin":false},"body":"Just installing redbiom, once the test pass I'll add a handler","created_at":"2017-04-26T15:19:15Z","updated_at":"2017-05-10T23:07:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69d5fa1b92aea75d38bba8de21076c928c643d98","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/biocore/qiita/pulls/2118/commits","review_comments_url":"https://api.github.com/repos/biocore/qiita/pulls/2118/comments","review_comment_url":"https://api.github.com/repos/biocore/qiita/pulls/comments{/number}","comments_url":"https://api.github.com/repos/biocore/qiita/issues/2118/comments","statuses_url":"https://api.github.com/repos/biocore/qiita/statuses/d46392e23d1c8769593b48164a519486c90d9e07","head":{"label":"antgonza:redbiom-ing","ref":"redbiom-ing","sha":"d46392e23d1c8769593b48164a519486c90d9e07","user":{"login":"antgonza","id":2014559,"avatar_url":"https://avatars1.githubusercontent.com/u/2014559?v=3","gravatar_id":"","url":"https://api.github.com/users/antgonza","html_url":"https://github.com/antgonza","followers_url":"https://api.github.com/users/antgonza/followers","following_url":"https://api.github.com/users/antgonza/following{/other_user}","gists_url":"https://api.github.com/users/antgonza/gists{/gist_id}","starred_url":"https://api.github.com/users/antgonza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antgonza/subscriptions","organizations_url":"https://api.github.com/users/antgonza/orgs","repos_url":"https://api.github.com/users/antgonza/repos","events_url":"https://api.github.com/users/antgonza/events{/privacy}","received_events_url":"https://api.github.com/users/antgonza/received_events","type":"User","site_admin":false},"repo":{"id":16964638,"name":"qiita","full_name":"antgonza/qiita","owner":{"login":"antgonza","id":2014559,"avatar_url":"https://avatars1.githubusercontent.com/u/2014559?v=3","gravatar_id":"","url":"https://api.github.com/users/antgonza","html_url":"https://github.com/antgonza","followers_url":"https://api.github.com/users/antgonza/followers","following_url":"https://api.github.com/users/antgonza/following{/other_user}","gists_url":"https://api.github.com/users/antgonza/gists{/gist_id}","starred_url":"https://api.github.com/users/antgonza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antgonza/subscriptions","organizations_url":"https://api.github.com/users/antgonza/orgs","repos_url":"https://api.github.com/users/antgonza/repos","events_url":"https://api.github.com/users/antgonza/events{/privacy}","received_events_url":"https://api.github.com/users/antgonza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/antgonza/qiita","description":"Qiita - A QIIME databasing effort","fork":true,"url":"https://api.github.com/repos/antgonza/qiita","forks_url":"https://api.github.com/repos/antgonza/qiita/forks","keys_url":"https://api.github.com/repos/antgonza/qiita/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antgonza/qiita/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antgonza/qiita/teams","hooks_url":"https://api.github.com/repos/antgonza/qiita/hooks","issue_events_url":"https://api.github.com/repos/antgonza/qiita/issues/events{/number}","events_url":"https://api.github.com/repos/antgonza/qiita/events","assignees_url":"https://api.github.com/repos/antgonza/qiita/assignees{/user}","branches_url":"https://api.github.com/repos/antgonza/qiita/branches{/branch}","tags_url":"https://api.github.com/repos/antgonza/qiita/tags","blobs_url":"https://api.github.com/repos/antgonza/qiita/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antgonza/qiita/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antgonza/qiita/git/refs{/sha}","trees_url":"https://api.github.com/repos/antgonza/qiita/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antgonza/qiita/statuses/{sha}","languages_url":"https://api.github.com/repos/antgonza/qiita/languages","stargazers_url":"https://api.github.com/repos/antgonza/qiita/stargazers","contributors_url":"https://api.github.com/repos/antgonza/qiita/contributors","subscribers_url":"https://api.github.com/repos/antgonza/qiita/subscribers","subscription_url":"https://api.github.com/repos/antgonza/qiita/subscription","commits_url":"https://api.github.com/repos/antgonza/qiita/commits{/sha}","git_commits_url":"https://api.github.com/repos/antgonza/qiita/git/commits{/sha}","comments_url":"https://api.github.com/repos/antgonza/qiita/comments{/number}","issue_comment_url":"https://api.github.com/repos/antgonza/qiita/issues/comments{/number}","contents_url":"https://api.github.com/repos/antgonza/qiita/contents/{+path}","compare_url":"https://api.github.com/repos/antgonza/qiita/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antgonza/qiita/merges","archive_url":"https://api.github.com/repos/antgonza/qiita/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antgonza/qiita/downloads","issues_url":"https://api.github.com/repos/antgonza/qiita/issues{/number}","pulls_url":"https://api.github.com/repos/antgonza/qiita/pulls{/number}","milestones_url":"https://api.github.com/repos/antgonza/qiita/milestones{/number}","notifications_url":"https://api.github.com/repos/antgonza/qiita/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antgonza/qiita/labels{/name}","releases_url":"https://api.github.com/repos/antgonza/qiita/releases{/id}","deployments_url":"https://api.github.com/repos/antgonza/qiita/deployments","created_at":"2014-02-18T21:38:48Z","updated_at":"2015-05-04T02:58:47Z","pushed_at":"2017-05-10T14:37:06Z","git_url":"git://github.com/antgonza/qiita.git","ssh_url":"git@github.com:antgonza/qiita.git","clone_url":"https://github.com/antgonza/qiita.git","svn_url":"https://github.com/antgonza/qiita","homepage":"","size":132675,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"biocore:redbiom","ref":"redbiom","sha":"eb8863b1e2b66861b9bd67f3bea20fa7bb6dd52c","user":{"login":"biocore","id":6241857,"avatar_url":"https://avatars0.githubusercontent.com/u/6241857?v=3","gravatar_id":"","url":"https://api.github.com/users/biocore","html_url":"https://github.com/biocore","followers_url":"https://api.github.com/users/biocore/followers","following_url":"https://api.github.com/users/biocore/following{/other_user}","gists_url":"https://api.github.com/users/biocore/gists{/gist_id}","starred_url":"https://api.github.com/users/biocore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biocore/subscriptions","organizations_url":"https://api.github.com/users/biocore/orgs","repos_url":"https://api.github.com/users/biocore/repos","events_url":"https://api.github.com/users/biocore/events{/privacy}","received_events_url":"https://api.github.com/users/biocore/received_events","type":"Organization","site_admin":false},"repo":{"id":13131245,"name":"qiita","full_name":"biocore/qiita","owner":{"login":"biocore","id":6241857,"avatar_url":"https://avatars0.githubusercontent.com/u/6241857?v=3","gravatar_id":"","url":"https://api.github.com/users/biocore","html_url":"https://github.com/biocore","followers_url":"https://api.github.com/users/biocore/followers","following_url":"https://api.github.com/users/biocore/following{/other_user}","gists_url":"https://api.github.com/users/biocore/gists{/gist_id}","starred_url":"https://api.github.com/users/biocore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biocore/subscriptions","organizations_url":"https://api.github.com/users/biocore/orgs","repos_url":"https://api.github.com/users/biocore/repos","events_url":"https://api.github.com/users/biocore/events{/privacy}","received_events_url":"https://api.github.com/users/biocore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/biocore/qiita","description":"Qiita - A multi-omics databasing effort","fork":false,"url":"https://api.github.com/repos/biocore/qiita","forks_url":"https://api.github.com/repos/biocore/qiita/forks","keys_url":"https://api.github.com/repos/biocore/qiita/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biocore/qiita/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biocore/qiita/teams","hooks_url":"https://api.github.com/repos/biocore/qiita/hooks","issue_events_url":"https://api.github.com/repos/biocore/qiita/issues/events{/number}","events_url":"https://api.github.com/repos/biocore/qiita/events","assignees_url":"https://api.github.com/repos/biocore/qiita/assignees{/user}","branches_url":"https://api.github.com/repos/biocore/qiita/branches{/branch}","tags_url":"https://api.github.com/repos/biocore/qiita/tags","blobs_url":"https://api.github.com/repos/biocore/qiita/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biocore/qiita/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biocore/qiita/git/refs{/sha}","trees_url":"https://api.github.com/repos/biocore/qiita/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biocore/qiita/statuses/{sha}","languages_url":"https://api.github.com/repos/biocore/qiita/languages","stargazers_url":"https://api.github.com/repos/biocore/qiita/stargazers","contributors_url":"https://api.github.com/repos/biocore/qiita/contributors","subscribers_url":"https://api.github.com/repos/biocore/qiita/subscribers","subscription_url":"https://api.github.com/repos/biocore/qiita/subscription","commits_url":"https://api.github.com/repos/biocore/qiita/commits{/sha}","git_commits_url":"https://api.github.com/repos/biocore/qiita/git/commits{/sha}","comments_url":"https://api.github.com/repos/biocore/qiita/comments{/number}","issue_comment_url":"https://api.github.com/repos/biocore/qiita/issues/comments{/number}","contents_url":"https://api.github.com/repos/biocore/qiita/contents/{+path}","compare_url":"https://api.github.com/repos/biocore/qiita/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biocore/qiita/merges","archive_url":"https://api.github.com/repos/biocore/qiita/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biocore/qiita/downloads","issues_url":"https://api.github.com/repos/biocore/qiita/issues{/number}","pulls_url":"https://api.github.com/repos/biocore/qiita/pulls{/number}","milestones_url":"https://api.github.com/repos/biocore/qiita/milestones{/number}","notifications_url":"https://api.github.com/repos/biocore/qiita/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biocore/qiita/labels{/name}","releases_url":"https://api.github.com/repos/biocore/qiita/releases{/id}","deployments_url":"https://api.github.com/repos/biocore/qiita/deployments","created_at":"2013-09-26T18:50:43Z","updated_at":"2017-02-17T20:25:19Z","pushed_at":"2017-05-10T14:37:08Z","git_url":"git://github.com/biocore/qiita.git","ssh_url":"git@github.com:biocore/qiita.git","clone_url":"https://github.com/biocore/qiita.git","svn_url":"https://github.com/biocore/qiita","homepage":"http://qiita.microbio.me","size":26725,"stargazers_count":35,"watchers_count":35,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":236,"forks":41,"open_issues":236,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/qiita/pulls/2118"},"html":{"href":"https://github.com/biocore/qiita/pull/2118"},"issue":{"href":"https://api.github.com/repos/biocore/qiita/issues/2118"},"comments":{"href":"https://api.github.com/repos/biocore/qiita/issues/2118/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/qiita/pulls/2118/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/qiita/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/biocore/qiita/pulls/2118/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/qiita/statuses/d46392e23d1c8769593b48164a519486c90d9e07"}}}}
{"actor":{"display_login":"josenavas"}}