{"action":"created","comment":{"url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments/55929773","id":55929773,"diff_hunk":"@@ -1,17 +1,139 @@\n <% provide(:title, 'Competitions') %>\n \n <div class=\"container\">\n-  <h1><%= yield(:title) %></h1>\n-\n-  <%= link_to \"New competition\", new_competition_path %>\n-  <table class=\"table\">\n-    <% @competitions.each do |competition| %>\n-      <tr>\n-        <td><%= competition.id %></td>\n-        <td><%= competition.name %></td>\n-        <td><%= link_to \"Edit\", admin_edit_competition_path(competition) %></td>\n-        <td><%= link_to \"Results\", \"/results/competition.php?competitionId=#{competition.id}\" %></td>\n-      </tr>\n+  <h2><%= yield(:title) %></h2>\n+\n+  <div id=\"scroller-anchor\"></div>\n+  <div id=\"comp-query\" class=\"col-md-12\">\n+    <% if params[:display] == \"List\" %>\n+      <ul>\n+        <% if @in_progress_competitions.length > 0 %>\n+          <li><a href=\"#current\">Competitions in progress</a></li>\n+        <% else %>\n+          <li>There are no competitions today.</li>\n+        <% end %>\n+\n+        <% if @upcoming_competitions.length > 0 %>\n+          <li><a href=\"#upcoming\">Upcoming competitions</a></li>\n+        <% else %>\n+          <li>There are no upcoming competitions selected.</li>\n+        <% end %>\n+\n+        <% if @past_competitions.length > 0 %>\n+          <li><a href=\"#past\">Past competitions</a></li>\n+        <% else %>\n+          <li>There are no past competitions selected.</li>\n+        <% end %>\n+      </ul>\n+    <% end %>\n+\n+    <%= form_tag competitions_path, method: :get, class: \"competition-select form-inline\" do %>\n+      <%= render 'index_form' %>\n+    <% end %>\n+  </div>\n+    <% if @competitions.length == 0 %>\n+      <div class=\"alert alert-warning\">No competitions found</div>\n+    <% else %>\n+      <% if params[:display] == \"List\" %>\n+        <div class=\"row competition-list\">\n+          <div class=\"col-md-12\" id=\"current\">\n+            <% if @in_progress_competitions.length > 0 %>\n+              <%= render 'index_table', competitions: @in_progress_competitions, title: \"Competitions in progress\" %>\n+              <% end %>\n+          </div>\n+\n+          <div class=\"col-md-6\" id=\"upcoming\">","path":"WcaOnRails/app/views/competitions/index.html.erb","position":56,"original_position":56,"commit_id":"dc17673e71d96f470ca5a5e7ec18dbb083e71548","original_commit_id":"dc17673e71d96f470ca5a5e7ec18dbb083e71548","user":{"login":"jbcm627","id":964048,"avatar_url":"https://avatars.githubusercontent.com/u/964048?v=3","gravatar_id":"","url":"https://api.github.com/users/jbcm627","html_url":"https://github.com/jbcm627","followers_url":"https://api.github.com/users/jbcm627/followers","following_url":"https://api.github.com/users/jbcm627/following{/other_user}","gists_url":"https://api.github.com/users/jbcm627/gists{/gist_id}","starred_url":"https://api.github.com/users/jbcm627/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbcm627/subscriptions","organizations_url":"https://api.github.com/users/jbcm627/orgs","repos_url":"https://api.github.com/users/jbcm627/repos","events_url":"https://api.github.com/users/jbcm627/events{/privacy}","received_events_url":"https://api.github.com/users/jbcm627/received_events","type":"User","site_admin":false},"body":"Suggestion: hide this column when no upcoming competitions exist, and make the past competitions column wider.\r\n","created_at":"2016-03-12T23:47:06Z","updated_at":"2016-03-12T23:47:06Z","html_url":"https://github.com/cubing/worldcubeassociation.org/pull/319#discussion_r55929773","pull_request_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/319","_links":{"self":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments/55929773"},"html":{"href":"https://github.com/cubing/worldcubeassociation.org/pull/319#discussion_r55929773"},"pull_request":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/319"}}},"pull_request":{"url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/319","id":55790006,"html_url":"https://github.com/cubing/worldcubeassociation.org/pull/319","diff_url":"https://github.com/cubing/worldcubeassociation.org/pull/319.diff","patch_url":"https://github.com/cubing/worldcubeassociation.org/pull/319.patch","issue_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/319","number":319,"state":"open","locked":false,"title":"New competitions index.","user":{"login":"pedrosino","id":1881933,"avatar_url":"https://avatars.githubusercontent.com/u/1881933?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrosino","html_url":"https://github.com/pedrosino","followers_url":"https://api.github.com/users/pedrosino/followers","following_url":"https://api.github.com/users/pedrosino/following{/other_user}","gists_url":"https://api.github.com/users/pedrosino/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrosino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrosino/subscriptions","organizations_url":"https://api.github.com/users/pedrosino/orgs","repos_url":"https://api.github.com/users/pedrosino/repos","events_url":"https://api.github.com/users/pedrosino/events{/privacy}","received_events_url":"https://api.github.com/users/pedrosino/received_events","type":"User","site_admin":false},"body":"Fixes #300.\r\n\r\nRemaining tasks:\r\n\r\n- [x] Nginx redirects from `competitions.php` to your new route.\r\n- [x] Side by side buttons on mobile\r\n- [x] Disable floating header on mobile\r\n- [ ] Hide upcoming/ongoing when they don't make sense (when looking at comps from 2011, for instance)\r\n  - [ ] On the flip side, when it does make sense to show upcoming/ongoing, have a better message than \"No competitions found!\". That makes it sound like we're excited about this fact =( See:\r\n![image](https://cloud.githubusercontent.com/assets/277474/13724638/155a05de-e841-11e5-8b73-79fb1b81fb73.png)\r\n- [ ] Show competition count. Something like:\r\n![image](https://cloud.githubusercontent.com/assets/277474/13724631/eb75ae80-e840-11e5-9171-a9f6f899215d.png)\r\n","created_at":"2016-01-12T17:29:10Z","updated_at":"2016-03-12T23:47:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7429f6d33f4e62313897b00ff6bf0467ca52a563","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/319/commits","review_comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/319/comments","review_comment_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/319/comments","statuses_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/dc17673e71d96f470ca5a5e7ec18dbb083e71548","head":{"label":"pedrosino:master","ref":"master","sha":"dc17673e71d96f470ca5a5e7ec18dbb083e71548","user":{"login":"pedrosino","id":1881933,"avatar_url":"https://avatars.githubusercontent.com/u/1881933?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrosino","html_url":"https://github.com/pedrosino","followers_url":"https://api.github.com/users/pedrosino/followers","following_url":"https://api.github.com/users/pedrosino/following{/other_user}","gists_url":"https://api.github.com/users/pedrosino/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrosino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrosino/subscriptions","organizations_url":"https://api.github.com/users/pedrosino/orgs","repos_url":"https://api.github.com/users/pedrosino/repos","events_url":"https://api.github.com/users/pedrosino/events{/privacy}","received_events_url":"https://api.github.com/users/pedrosino/received_events","type":"User","site_admin":false},"repo":{"id":45578783,"name":"worldcubeassociation.org","full_name":"pedrosino/worldcubeassociation.org","owner":{"login":"pedrosino","id":1881933,"avatar_url":"https://avatars.githubusercontent.com/u/1881933?v=3","gravatar_id":"","url":"https://api.github.com/users/pedrosino","html_url":"https://github.com/pedrosino","followers_url":"https://api.github.com/users/pedrosino/followers","following_url":"https://api.github.com/users/pedrosino/following{/other_user}","gists_url":"https://api.github.com/users/pedrosino/gists{/gist_id}","starred_url":"https://api.github.com/users/pedrosino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedrosino/subscriptions","organizations_url":"https://api.github.com/users/pedrosino/orgs","repos_url":"https://api.github.com/users/pedrosino/repos","events_url":"https://api.github.com/users/pedrosino/events{/privacy}","received_events_url":"https://api.github.com/users/pedrosino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pedrosino/worldcubeassociation.org","description":"[WCA Project] All of the code that runs on worldcubeassociation.org","fork":true,"url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org","forks_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/forks","keys_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/teams","hooks_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/hooks","issue_events_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/issues/events{/number}","events_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/events","assignees_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/assignees{/user}","branches_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/branches{/branch}","tags_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/tags","blobs_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/statuses/{sha}","languages_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/languages","stargazers_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/stargazers","contributors_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/contributors","subscribers_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/subscribers","subscription_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/subscription","commits_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/contents/{+path}","compare_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/merges","archive_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/downloads","issues_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/issues{/number}","pulls_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/pulls{/number}","milestones_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/milestones{/number}","notifications_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/labels{/name}","releases_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/releases{/id}","deployments_url":"https://api.github.com/repos/pedrosino/worldcubeassociation.org/deployments","created_at":"2015-11-05T01:22:31Z","updated_at":"2016-01-11T18:58:19Z","pushed_at":"2016-03-12T21:09:25Z","git_url":"git://github.com/pedrosino/worldcubeassociation.org.git","ssh_url":"git@github.com:pedrosino/worldcubeassociation.org.git","clone_url":"https://github.com/pedrosino/worldcubeassociation.org.git","svn_url":"https://github.com/pedrosino/worldcubeassociation.org","homepage":"https://www.worldcubeassociation.org/","size":50976,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"cubing:master","ref":"master","sha":"2bfd05339fe1e7a6b0a3cf1aa908920665d41c45","user":{"login":"cubing","id":1092267,"avatar_url":"https://avatars.githubusercontent.com/u/1092267?v=3","gravatar_id":"","url":"https://api.github.com/users/cubing","html_url":"https://github.com/cubing","followers_url":"https://api.github.com/users/cubing/followers","following_url":"https://api.github.com/users/cubing/following{/other_user}","gists_url":"https://api.github.com/users/cubing/gists{/gist_id}","starred_url":"https://api.github.com/users/cubing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubing/subscriptions","organizations_url":"https://api.github.com/users/cubing/orgs","repos_url":"https://api.github.com/users/cubing/repos","events_url":"https://api.github.com/users/cubing/events{/privacy}","received_events_url":"https://api.github.com/users/cubing/received_events","type":"Organization","site_admin":false},"repo":{"id":34161579,"name":"worldcubeassociation.org","full_name":"cubing/worldcubeassociation.org","owner":{"login":"cubing","id":1092267,"avatar_url":"https://avatars.githubusercontent.com/u/1092267?v=3","gravatar_id":"","url":"https://api.github.com/users/cubing","html_url":"https://github.com/cubing","followers_url":"https://api.github.com/users/cubing/followers","following_url":"https://api.github.com/users/cubing/following{/other_user}","gists_url":"https://api.github.com/users/cubing/gists{/gist_id}","starred_url":"https://api.github.com/users/cubing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubing/subscriptions","organizations_url":"https://api.github.com/users/cubing/orgs","repos_url":"https://api.github.com/users/cubing/repos","events_url":"https://api.github.com/users/cubing/events{/privacy}","received_events_url":"https://api.github.com/users/cubing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cubing/worldcubeassociation.org","description":"[WCA Project] All of the code that runs on worldcubeassociation.org","fork":false,"url":"https://api.github.com/repos/cubing/worldcubeassociation.org","forks_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/forks","keys_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/teams","hooks_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/hooks","issue_events_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/events{/number}","events_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/events","assignees_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/assignees{/user}","branches_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/branches{/branch}","tags_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/tags","blobs_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/refs{/sha}","trees_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/{sha}","languages_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/languages","stargazers_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/stargazers","contributors_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/contributors","subscribers_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/subscribers","subscription_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/subscription","commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/commits{/sha}","git_commits_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/git/commits{/sha}","comments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/comments{/number}","issue_comment_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/comments{/number}","contents_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/contents/{+path}","compare_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/merges","archive_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/downloads","issues_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues{/number}","pulls_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls{/number}","milestones_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/milestones{/number}","notifications_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/labels{/name}","releases_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/releases{/id}","deployments_url":"https://api.github.com/repos/cubing/worldcubeassociation.org/deployments","created_at":"2015-04-18T10:21:53Z","updated_at":"2016-02-21T14:51:52Z","pushed_at":"2016-03-12T21:09:25Z","git_url":"git://github.com/cubing/worldcubeassociation.org.git","ssh_url":"git@github.com:cubing/worldcubeassociation.org.git","clone_url":"https://github.com/cubing/worldcubeassociation.org.git","svn_url":"https://github.com/cubing/worldcubeassociation.org","homepage":"https://www.worldcubeassociation.org/","size":51018,"stargazers_count":8,"watchers_count":8,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":140,"forks":19,"open_issues":140,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/319"},"html":{"href":"https://github.com/cubing/worldcubeassociation.org/pull/319"},"issue":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/319"},"comments":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/issues/319/comments"},"review_comments":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/319/comments"},"review_comment":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/pulls/319/commits"},"statuses":{"href":"https://api.github.com/repos/cubing/worldcubeassociation.org/statuses/dc17673e71d96f470ca5a5e7ec18dbb083e71548"}}}}