{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/66310879","id":66310879,"diff_hunk":"@@ -0,0 +1,42 @@\n+class HocDownloadController < ApplicationController\n+\n+  DOWNLOAD_URL_BASE = '//downloads.code.org/hourofcode/'\n+\n+  def index\n+    @product_name = params[:product]\n+\n+    case @product_name\n+      when Script::MINECRAFT_NAME\n+        @app_name = t('hoc_download.minecraft_name')\n+        @file_prefix = 'MC'\n+        @og_image_url = CDO.code_org_url('/images/mc/mc_social.jpg')\n+      when Script::STARWARS_NAME\n+        @app_name = t('hoc_download.starwars_blocks_name')\n+        @file_prefix = 'StarWarsBlocks'\n+        @og_image_url = CDO.code_org_url('/images/star-wars-announcement.jpg')\n+\n+        # for JavaScript version (Star Wars only)\n+        @app_name_js = t('hoc_download.starwars_javascript_name')\n+        @file_prefix_js = 'StarWarsJS'\n+        @show_js_links = true\n+      else\n+        render_404\n+        return\n+    end\n+\n+    @hoc_url = CDO.code_org_url(\"/#{@product_name}\")\n+\n+    @english_windows_url = DOWNLOAD_URL_BASE + @product_name + '/' + @file_prefix + \"EnglishSetup.exe\"\n+    @english_mac_url = DOWNLOAD_URL_BASE + @product_name + '/' + @file_prefix + \"English.dmg\"\n+    @spanish_windows_url = DOWNLOAD_URL_BASE + @product_name + '/' + @file_prefix + \"SpanishSetup.exe\"\n+    @spanish_mac_url = DOWNLOAD_URL_BASE + @product_name + '/' + @file_prefix + \"Spanish.dmg\"","path":"dashboard/app/controllers/hoc_download_controller.rb","position":32,"original_position":32,"commit_id":"627a87a5f902980f16a446c7fa6a9ec2d7d9e03f","original_commit_id":"627a87a5f902980f16a446c7fa6a9ec2d7d9e03f","user":{"login":"aoby","id":8405316,"avatar_url":"https://avatars.githubusercontent.com/u/8405316?v=3","gravatar_id":"","url":"https://api.github.com/users/aoby","html_url":"https://github.com/aoby","followers_url":"https://api.github.com/users/aoby/followers","following_url":"https://api.github.com/users/aoby/following{/other_user}","gists_url":"https://api.github.com/users/aoby/gists{/gist_id}","starred_url":"https://api.github.com/users/aoby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoby/subscriptions","organizations_url":"https://api.github.com/users/aoby/orgs","repos_url":"https://api.github.com/users/aoby/repos","events_url":"https://api.github.com/users/aoby/events{/privacy}","received_events_url":"https://api.github.com/users/aoby/received_events","type":"User","site_admin":false},"body":"Yeah, instead of hard coding this path, do something along these lines: https://github.com/code-dot-org/code-dot-org/blob/f7e69d0f9f62f94c207235c2c0d79091cc7d215f/dashboard/app/helpers/application_helper.rb#L89-L89\r\n\r\nAnd dig into [CDO.site_url](https://github.com/code-dot-org/code-dot-org/blob/c4c12dcf307196860270955c379b6b4137224f6c/deployment.rb#L182-L182)\r\n\r\nAlso nit, use ruby string interpolation, i.e. `@english_mac_url = \"#{DOWNLOAD_URL_BASE}#{@product_name}/@{file_prefix}English.dmg\"`. Though, you can probably reduce this with the above to something like ` = download_url(@product_name, @file_prefix, 'English.dmg')`\r\n\r\nI agree also with Brendan that this should be in a lookup, instead of a bunch of separate variables. \r\n\r\n","created_at":"2016-06-08T18:22:03Z","updated_at":"2016-06-08T18:22:03Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/8816#discussion_r66310879","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/8816","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/66310879"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/8816#discussion_r66310879"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/8816"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/8816","id":72970659,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/8816","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/8816.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/8816.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/8816","number":8816,"state":"open","locked":false,"title":"Implemented Hour of Code download pages","user":{"login":"jeremydstone","id":19172895,"avatar_url":"https://avatars.githubusercontent.com/u/19172895?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremydstone","html_url":"https://github.com/jeremydstone","followers_url":"https://api.github.com/users/jeremydstone/followers","following_url":"https://api.github.com/users/jeremydstone/following{/other_user}","gists_url":"https://api.github.com/users/jeremydstone/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremydstone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremydstone/subscriptions","organizations_url":"https://api.github.com/users/jeremydstone/orgs","repos_url":"https://api.github.com/users/jeremydstone/repos","events_url":"https://api.github.com/users/jeremydstone/events{/privacy}","received_events_url":"https://api.github.com/users/jeremydstone/received_events","type":"User","site_admin":false},"body":"Implemented two static pages to host links to downloads for the Hour of Code offline tutorials.  We are only offering Star Wars and Minecraft offline. The pages are at /download/starwars and /download/mc . StarWars has two versions of the tutorials (blocks & JavaScript); Minecraft only has blocks. \r\n\r\nRight now we are doing a soft launch where nothing points to these pages, so we can get a few people to try out the tutorials. For the moment we are only providing English and Spanish. We have quick 'n dirty links hard-coded to these.\r\n\r\nLater, we will revise the download page to be better; probably a \"Download!\" button that autodetects your language and platform, and also some way for you to select any other language and platform if you want.\r\n\r\n![starwars_download_page](https://cloud.githubusercontent.com/assets/19172895/15879137/1c8a6806-2cd6-11e6-858e-0b67c3699421.png)\r\n![minecraft_download_page](https://cloud.githubusercontent.com/assets/19172895/15879138/222fdc64-2cd6-11e6-9de0-8bdc76290340.png)\r\n","created_at":"2016-06-08T00:35:02Z","updated_at":"2016-06-08T18:22:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30e53d5a4d41f7c68402c509669118dc4ef310ad","assignee":{"login":"breville","id":2205926,"avatar_url":"https://avatars.githubusercontent.com/u/2205926?v=3","gravatar_id":"","url":"https://api.github.com/users/breville","html_url":"https://github.com/breville","followers_url":"https://api.github.com/users/breville/followers","following_url":"https://api.github.com/users/breville/following{/other_user}","gists_url":"https://api.github.com/users/breville/gists{/gist_id}","starred_url":"https://api.github.com/users/breville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breville/subscriptions","organizations_url":"https://api.github.com/users/breville/orgs","repos_url":"https://api.github.com/users/breville/repos","events_url":"https://api.github.com/users/breville/events{/privacy}","received_events_url":"https://api.github.com/users/breville/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/8816/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/8816/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/8816/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/627a87a5f902980f16a446c7fa6a9ec2d7d9e03f","head":{"label":"code-dot-org:hoc_download_page","ref":"hoc_download_page","sha":"627a87a5f902980f16a446c7fa6a9ec2d7d9e03f","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2016-05-30T09:44:27Z","pushed_at":"2016-06-08T18:18:50Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":4725401,"stargazers_count":119,"watchers_count":119,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":46,"forks":72,"open_issues":46,"watchers":119,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"9c3168c94a3b6ca2443abea9f9bb759f365d76e0","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2016-05-30T09:44:27Z","pushed_at":"2016-06-08T18:18:50Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":4725401,"stargazers_count":119,"watchers_count":119,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":46,"forks":72,"open_issues":46,"watchers":119,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/8816"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/8816"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/8816"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/8816/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/8816/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/8816/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/627a87a5f902980f16a446c7fa6a9ec2d7d9e03f"}}}}
{"actor":{"display_login":"aoby"}}