{"action":"created","comment":{"url":"https://api.github.com/repos/edx/course-discovery/pulls/comments/166296118","pull_request_review_id":94341066,"id":166296118,"diff_hunk":"@@ -0,0 +1,30 @@\n+$(document).ready(function() {\n+    var $courseRunForm = $('.js-courserun-form'),\n+        $seatForm = $('.js-seat-form');\n+\n+    // If the rendered form is hidden, remove it from the DOM.\n+    if ($seatForm.hasClass('hidden')) {\n+        $seatForm.detach();\n+        $seatForm.removeClass('hidden');\n+    }\n+\n+    $(document).on('select2:select', '#id_course', function(e) {\n+        var usesEntitlements = e.params.data.uses_entitlements;\n+\n+        $seatForm.detach();\n+        if (!usesEntitlements) {\n+            // Remove any errors that may have been initially loaded with the form.\n+            $seatForm.find('.js-seat-form-errors').remove();\n+\n+            // Reset inputs before re-attaching the form.\n+            $seatForm.find('#id_type').val('');\n+            $seatForm.find('#seatPriceBlock').addClass('hidden');\n+            $seatForm.find('#id_price').val('0.0');\n+            $seatForm.find('#creditPrice').addClass('hidden');\n+            $seatForm.find('#id_credit_price').val('0.0');\n+\n+            // Re-attach the form\n+            $seatForm.insertAfter($courseRunForm);\n+        }\n+    });\n+});","path":"course_discovery/static/js/publisher/show-hide-seat-form.js","position":30,"original_position":30,"commit_id":"ab9bbec43003d4bdfe6d1c9435afab8bc7bbf435","original_commit_id":"ab9bbec43003d4bdfe6d1c9435afab8bc7bbf435","user":{"login":"AlasdairSwan","id":2052185,"avatar_url":"https://avatars1.githubusercontent.com/u/2052185?v=4","gravatar_id":"","url":"https://api.github.com/users/AlasdairSwan","html_url":"https://github.com/AlasdairSwan","followers_url":"https://api.github.com/users/AlasdairSwan/followers","following_url":"https://api.github.com/users/AlasdairSwan/following{/other_user}","gists_url":"https://api.github.com/users/AlasdairSwan/gists{/gist_id}","starred_url":"https://api.github.com/users/AlasdairSwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlasdairSwan/subscriptions","organizations_url":"https://api.github.com/users/AlasdairSwan/orgs","repos_url":"https://api.github.com/users/AlasdairSwan/repos","events_url":"https://api.github.com/users/AlasdairSwan/events{/privacy}","received_events_url":"https://api.github.com/users/AlasdairSwan/received_events","type":"User","site_admin":false},"body":"@amangano-edx it is pretty ugly, but then it's not using any JS Frameworks so you're limited in your approach I guess. Is this up in a test environment? I think I need some more details to consider alternative approaches? If not I can swing by your desk at some point today.","created_at":"2018-02-06T13:27:48Z","updated_at":"2018-02-06T13:27:48Z","html_url":"https://github.com/edx/course-discovery/pull/1304#discussion_r166296118","pull_request_url":"https://api.github.com/repos/edx/course-discovery/pulls/1304","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/comments/166296118"},"html":{"href":"https://github.com/edx/course-discovery/pull/1304#discussion_r166296118"},"pull_request":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/1304"}},"in_reply_to_id":166144057},"pull_request":{"url":"https://api.github.com/repos/edx/course-discovery/pulls/1304","id":167275403,"html_url":"https://github.com/edx/course-discovery/pull/1304","diff_url":"https://github.com/edx/course-discovery/pull/1304.diff","patch_url":"https://github.com/edx/course-discovery/pull/1304.patch","issue_url":"https://api.github.com/repos/edx/course-discovery/issues/1304","number":1304,"state":"open","locked":false,"title":"WIP LEARNER-3878 Create entitlement-aware CourseRuns in Publisher","user":{"login":"amangano-edx","id":24230895,"avatar_url":"https://avatars2.githubusercontent.com/u/24230895?v=4","gravatar_id":"","url":"https://api.github.com/users/amangano-edx","html_url":"https://github.com/amangano-edx","followers_url":"https://api.github.com/users/amangano-edx/followers","following_url":"https://api.github.com/users/amangano-edx/following{/other_user}","gists_url":"https://api.github.com/users/amangano-edx/gists{/gist_id}","starred_url":"https://api.github.com/users/amangano-edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amangano-edx/subscriptions","organizations_url":"https://api.github.com/users/amangano-edx/orgs","repos_url":"https://api.github.com/users/amangano-edx/repos","events_url":"https://api.github.com/users/amangano-edx/events{/privacy}","received_events_url":"https://api.github.com/users/amangano-edx/received_events","type":"User","site_admin":false},"body":"Modifies `CreateCourseRunView`, `CreateRunFromDashboardView`, and related templates/forms to support creating Seats from CourseEntitlements associated with the parent course.\r\n\r\nJIRA: https://openedx.atlassian.net/browse/LEARNER-3878\r\n\r\nNeed to add unit tests and determine what to do about CourseSearchForm. ","created_at":"2018-02-05T22:46:20Z","updated_at":"2018-02-06T13:27:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdb3ed9c253c20d9268db63af22e46463981a019","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/course-discovery/pulls/1304/commits","review_comments_url":"https://api.github.com/repos/edx/course-discovery/pulls/1304/comments","review_comment_url":"https://api.github.com/repos/edx/course-discovery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/course-discovery/issues/1304/comments","statuses_url":"https://api.github.com/repos/edx/course-discovery/statuses/ab9bbec43003d4bdfe6d1c9435afab8bc7bbf435","head":{"label":"edx:LEARNER-3878-publisher-entitlement-aware-courseruns","ref":"LEARNER-3878-publisher-entitlement-aware-courseruns","sha":"ab9bbec43003d4bdfe6d1c9435afab8bc7bbf435","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":45866355,"name":"course-discovery","full_name":"edx/course-discovery","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/course-discovery","description":"Service providing access to consolidated course and program metadata","fork":false,"url":"https://api.github.com/repos/edx/course-discovery","forks_url":"https://api.github.com/repos/edx/course-discovery/forks","keys_url":"https://api.github.com/repos/edx/course-discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/course-discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/course-discovery/teams","hooks_url":"https://api.github.com/repos/edx/course-discovery/hooks","issue_events_url":"https://api.github.com/repos/edx/course-discovery/issues/events{/number}","events_url":"https://api.github.com/repos/edx/course-discovery/events","assignees_url":"https://api.github.com/repos/edx/course-discovery/assignees{/user}","branches_url":"https://api.github.com/repos/edx/course-discovery/branches{/branch}","tags_url":"https://api.github.com/repos/edx/course-discovery/tags","blobs_url":"https://api.github.com/repos/edx/course-discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/course-discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/course-discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/course-discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/course-discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/course-discovery/languages","stargazers_url":"https://api.github.com/repos/edx/course-discovery/stargazers","contributors_url":"https://api.github.com/repos/edx/course-discovery/contributors","subscribers_url":"https://api.github.com/repos/edx/course-discovery/subscribers","subscription_url":"https://api.github.com/repos/edx/course-discovery/subscription","commits_url":"https://api.github.com/repos/edx/course-discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/course-discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/course-discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/course-discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/course-discovery/contents/{+path}","compare_url":"https://api.github.com/repos/edx/course-discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/course-discovery/merges","archive_url":"https://api.github.com/repos/edx/course-discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/course-discovery/downloads","issues_url":"https://api.github.com/repos/edx/course-discovery/issues{/number}","pulls_url":"https://api.github.com/repos/edx/course-discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/course-discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/course-discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/course-discovery/labels{/name}","releases_url":"https://api.github.com/repos/edx/course-discovery/releases{/id}","deployments_url":"https://api.github.com/repos/edx/course-discovery/deployments","created_at":"2015-11-09T20:57:54Z","updated_at":"2017-12-12T20:56:17Z","pushed_at":"2018-02-06T10:33:03Z","git_url":"git://github.com/edx/course-discovery.git","ssh_url":"git@github.com:edx/course-discovery.git","clone_url":"https://github.com/edx/course-discovery.git","svn_url":"https://github.com/edx/course-discovery","homepage":"https://edx-discovery.readthedocs.io/en/latest/","size":15023,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":12,"open_issues":7,"watchers":15,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"831dadc6294f87f2879f9911704005482cd0e4d6","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":45866355,"name":"course-discovery","full_name":"edx/course-discovery","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars3.githubusercontent.com/u/3179841?v=4","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/course-discovery","description":"Service providing access to consolidated course and program metadata","fork":false,"url":"https://api.github.com/repos/edx/course-discovery","forks_url":"https://api.github.com/repos/edx/course-discovery/forks","keys_url":"https://api.github.com/repos/edx/course-discovery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/course-discovery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/course-discovery/teams","hooks_url":"https://api.github.com/repos/edx/course-discovery/hooks","issue_events_url":"https://api.github.com/repos/edx/course-discovery/issues/events{/number}","events_url":"https://api.github.com/repos/edx/course-discovery/events","assignees_url":"https://api.github.com/repos/edx/course-discovery/assignees{/user}","branches_url":"https://api.github.com/repos/edx/course-discovery/branches{/branch}","tags_url":"https://api.github.com/repos/edx/course-discovery/tags","blobs_url":"https://api.github.com/repos/edx/course-discovery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/course-discovery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/course-discovery/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/course-discovery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/course-discovery/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/course-discovery/languages","stargazers_url":"https://api.github.com/repos/edx/course-discovery/stargazers","contributors_url":"https://api.github.com/repos/edx/course-discovery/contributors","subscribers_url":"https://api.github.com/repos/edx/course-discovery/subscribers","subscription_url":"https://api.github.com/repos/edx/course-discovery/subscription","commits_url":"https://api.github.com/repos/edx/course-discovery/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/course-discovery/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/course-discovery/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/course-discovery/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/course-discovery/contents/{+path}","compare_url":"https://api.github.com/repos/edx/course-discovery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/course-discovery/merges","archive_url":"https://api.github.com/repos/edx/course-discovery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/course-discovery/downloads","issues_url":"https://api.github.com/repos/edx/course-discovery/issues{/number}","pulls_url":"https://api.github.com/repos/edx/course-discovery/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/course-discovery/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/course-discovery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/course-discovery/labels{/name}","releases_url":"https://api.github.com/repos/edx/course-discovery/releases{/id}","deployments_url":"https://api.github.com/repos/edx/course-discovery/deployments","created_at":"2015-11-09T20:57:54Z","updated_at":"2017-12-12T20:56:17Z","pushed_at":"2018-02-06T10:33:03Z","git_url":"git://github.com/edx/course-discovery.git","ssh_url":"git@github.com:edx/course-discovery.git","clone_url":"https://github.com/edx/course-discovery.git","svn_url":"https://github.com/edx/course-discovery","homepage":"https://edx-discovery.readthedocs.io/en/latest/","size":15023,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":12,"open_issues":7,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/1304"},"html":{"href":"https://github.com/edx/course-discovery/pull/1304"},"issue":{"href":"https://api.github.com/repos/edx/course-discovery/issues/1304"},"comments":{"href":"https://api.github.com/repos/edx/course-discovery/issues/1304/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/1304/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/course-discovery/pulls/1304/commits"},"statuses":{"href":"https://api.github.com/repos/edx/course-discovery/statuses/ab9bbec43003d4bdfe6d1c9435afab8bc7bbf435"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"AlasdairSwan"}}