{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/81097611","pull_request_review_id":2101946,"id":81097611,"diff_hunk":"@@ -0,0 +1,17 @@\n+\"\"\"\n+Utils for DiscussionXBlock","path":"openedx/core/lib/xblock_builtin/xblock_discussion/utils.py","position":2,"original_position":2,"commit_id":"2877d907fb27b77f749d20866a9a4f05c65f6389","original_commit_id":"7e400622e387c351c27b115151a298dda2f88cba","user":{"login":"itsjeyd","id":961441,"avatar_url":"https://avatars.githubusercontent.com/u/961441?v=3","gravatar_id":"","url":"https://api.github.com/users/itsjeyd","html_url":"https://github.com/itsjeyd","followers_url":"https://api.github.com/users/itsjeyd/followers","following_url":"https://api.github.com/users/itsjeyd/following{/other_user}","gists_url":"https://api.github.com/users/itsjeyd/gists{/gist_id}","starred_url":"https://api.github.com/users/itsjeyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itsjeyd/subscriptions","organizations_url":"https://api.github.com/users/itsjeyd/orgs","repos_url":"https://api.github.com/users/itsjeyd/repos","events_url":"https://api.github.com/users/itsjeyd/events{/privacy}","received_events_url":"https://api.github.com/users/itsjeyd/received_events","type":"User","site_admin":false},"body":"@andy-armstrong I forgot to ask last night: What would be a good place to move this to in your opinion? It seems like it could probably live somewhere in `common`, since it could be useful to both Studio and LMS code. However, none of the top-level directories under `common` seem like a good fit. I thought about moving the file to `common/djangoapps/pipeline_js`; but now that the file also defines a function for obtaining CSS dependencies (via https://github.com/edx/edx-platform/pull/13483/commits/2877d907fb27b77f749d20866a9a4f05c65f6389), I'm not sure if `common/djangoapps/pipeline_js` is the best fit.","created_at":"2016-09-29T09:30:02Z","updated_at":"2016-09-29T09:30:02Z","html_url":"https://github.com/edx/edx-platform/pull/13483#discussion_r81097611","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/13483","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/81097611"},"html":{"href":"https://github.com/edx/edx-platform/pull/13483#discussion_r81097611"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/13483"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/13483","id":85430333,"html_url":"https://github.com/edx/edx-platform/pull/13483","diff_url":"https://github.com/edx/edx-platform/pull/13483.diff","patch_url":"https://github.com/edx/edx-platform/pull/13483.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/13483","number":13483,"state":"open","locked":false,"title":"Have DiscussionXBlock take care of loading assets it depends on","user":{"login":"itsjeyd","id":961441,"avatar_url":"https://avatars.githubusercontent.com/u/961441?v=3","gravatar_id":"","url":"https://api.github.com/users/itsjeyd","html_url":"https://github.com/itsjeyd","followers_url":"https://api.github.com/users/itsjeyd/followers","following_url":"https://api.github.com/users/itsjeyd/following{/other_user}","gists_url":"https://api.github.com/users/itsjeyd/gists{/gist_id}","starred_url":"https://api.github.com/users/itsjeyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/itsjeyd/subscriptions","organizations_url":"https://api.github.com/users/itsjeyd/orgs","repos_url":"https://api.github.com/users/itsjeyd/repos","events_url":"https://api.github.com/users/itsjeyd/events{/privacy}","received_events_url":"https://api.github.com/users/itsjeyd/received_events","type":"User","site_admin":false},"body":"`DiscussionXBlock` currently relies on courseware to load JS and CSS assets that it depends on. This PR transfers responsibility for loading these assets to the XBlock itself.\r\n\r\ncf. [YONK-382](https://openedx.atlassian.net/browse/YONK-382)\r\n\r\n**Related PRs**\r\n\r\n- https://github.com/edx-solutions/edx-platform/pull/744\r\n\r\n**Screenshots**\r\n\r\n- Adding a post: ![add-a-post](https://cloud.githubusercontent.com/assets/961441/18810662/83090878-829c-11e6-9f1a-469a22785fed.png)\r\n\r\n- Expanded discussion: ![post-mathjax-expanded](https://cloud.githubusercontent.com/assets/961441/18810685/b89f427c-829c-11e6-890b-5f5da57cf9f0.png)\r\n\r\n- Responses: ![response-comment-mathjax](https://cloud.githubusercontent.com/assets/961441/18810693/e67e05b6-829c-11e6-96eb-71fce703ddc2.png)\r\n\r\n- Error message: ![post-with-error](https://cloud.githubusercontent.com/assets/961441/18810879/77f6cc2c-82a1-11e6-858a-e64b2fa8f5e8.png)\r\n\r\n**Sandbox**\r\n\r\n- LMS: http://pr13483.sandbox.opencraft.hosting/\r\n- Studio: http://studio-pr13483.sandbox.opencraft.hosting/\r\n\r\nLatest commit: https://github.com/edx/edx-platform/pull/13483/commits/7e400622e387c351c27b115151a298dda2f88cba\r\n\r\n<!--\r\nhttps://github.com/edx/edx-platform/pull/13483/commits/41be062be4c22c4e4a78e18865842a1cb20861be\r\n-->\r\n\r\n**Test instructions**\r\n\r\n1. Remove static assets via `git clean -fx`.\r\n\r\n2. Checkout this branch and rebuild assets via `paver update_assets` *or* `paver devstack studio`, `paver devstack lms`.\r\n\r\n3. Add `DiscussionXBlock` to a unit via the main \"Discussion\" component button.\r\n\r\n4. Navigate to the unit in the LMS and smoke test discussion functionality.\r\n\r\n    For example, make sure that you can perform the following actions as `staff` user:\r\n\r\n    * Create a Post, Reply, Comment.\r\n    * Edit a Post, Reply, Comment.\r\n    * Test [MathJax](http://docs.mathjax.org/en/latest/start.html) functionality in Post, Reply, Comment (and Preview), with e.g.\r\n      ```\r\nThere are two solutions to \\(ax^2 + bx + c = 0\\) and they are\r\n$$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.$$\r\n\r\nWhen $a \\ne 0$\r\n      ```\r\n    * Delete a Post, Reply, Comment.\r\n    * Follow/unfollow a thread/post.\r\n    * In the \"Instructor\" panel, add the `staff` user to the `Discussion Admin` or `Discussion Moderator` group. Then you should be able to: \r\n        * Open/close a thread/post.\r\n        * Pin/unpin a thread/post.\r\n    * Try to create a post without a title. This should cause an error message to be displayed above the controls you used to create the post.\r\n\r\n5. Login as a regular student.  You should be able to do the above actions, plus:\r\n\r\n    * Report/unreport a post created by the `staff` user.\r\n    * Vote/unvote a thread/post created by the `staff` user.\r\n\r\n6. Enable the \"Teams\" feature:\r\n\r\n    * In Studio, replace the contents of \"Advanced Settings\" > \"Teams Configuration\" with:\r\n\r\n      ```json\r\n{\r\n    \"topics\": [\r\n        {\r\n            \"name\": \"Sustainability in Corporations\",\r\n            \"description\": \"Description for Sustainability in Corporations\",\r\n            \"id\": \"Sustain_Corporations\"\r\n        },\r\n        {\r\n            \"name\": \"Water Conservation Projects\",\r\n            \"description\": \"Description for Water Conservation\",\r\n            \"id\": \"Water_Conservation\"\r\n        },\r\n        {\r\n            \"name\": \"Sustainability Standards and Reporting\",\r\n            \"description\": \"Description for Sustainability Standards\",\r\n            \"id\": \"Standards_Reporting\"\r\n        }\r\n    ],\r\n    \"max_team_size\": 5\r\n}\r\n      ```\r\n    * In the LMS, navigate to the \"Teams\" tab, select one of the topics and add a team to it via \"create a new team in this topic\".\r\n    * Sanity-check discussion CSS by adding a post, response, and comment.\r\n\r\n**Author notes**\r\n\r\n* User profile page CSS looks broken, but is actually identical to what I get on `master`, so this is not a regression:\r\n\r\n    * User profile page on `master`: ![user-profile-before](https://cloud.githubusercontent.com/assets/961441/18830693/205382c0-83e2-11e6-9e80-5491037f1e75.png)\r\n\r\n    * User profile page on `itsjeyd/inline-discussion-assets`: ![user-profile-after](https://cloud.githubusercontent.com/assets/961441/18830700/29dadb4a-83e2-11e6-9321-eb1a69e26749.png)\r\n\r\n<!--\r\n* If you see an error such as \"Uncaught ReferenceError: XBlock is not defined\" from `runtime.v1.js` in the JS console, that means you have some stale assets lying around. Remove the following folders to get rid of the error:\r\n\r\n    * `/static/coffee/src/xblock/`\r\n    * `/static/coffee/src/discussion/`\r\n-->\r\n\r\n**Reviewers**\r\n\r\n- [x] OpenCraft: @pomegranited \r\n- [ ] edX: @douglashall \r\n- [ ] edX: @andy-armstrong ","created_at":"2016-09-15T15:50:16Z","updated_at":"2016-09-29T09:30:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ccd37ccb4d9e9e34ae40b8677aa8124d01b36e5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/13483/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/13483/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/13483/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/2877d907fb27b77f749d20866a9a4f05c65f6389","head":{"label":"open-craft:itsjeyd/inline-discussion-assets","ref":"itsjeyd/inline-discussion-assets","sha":"2877d907fb27b77f749d20866a9a4f05c65f6389","user":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":19940883,"name":"edx-platform","full_name":"open-craft/edx-platform","owner":{"login":"open-craft","id":7414786,"avatar_url":"https://avatars.githubusercontent.com/u/7414786?v=3","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/edx-platform","description":"the edX learning management system (LMS) and course authoring tool, Studio","fork":true,"url":"https://api.github.com/repos/open-craft/edx-platform","forks_url":"https://api.github.com/repos/open-craft/edx-platform/forks","keys_url":"https://api.github.com/repos/open-craft/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/edx-platform/teams","hooks_url":"https://api.github.com/repos/open-craft/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/open-craft/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/edx-platform/events","assignees_url":"https://api.github.com/repos/open-craft/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/edx-platform/tags","blobs_url":"https://api.github.com/repos/open-craft/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/edx-platform/languages","stargazers_url":"https://api.github.com/repos/open-craft/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/open-craft/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/open-craft/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/open-craft/edx-platform/subscription","commits_url":"https://api.github.com/repos/open-craft/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-craft/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/edx-platform/merges","archive_url":"https://api.github.com/repos/open-craft/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/edx-platform/downloads","issues_url":"https://api.github.com/repos/open-craft/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/open-craft/edx-platform/deployments","created_at":"2014-05-19T12:28:25Z","updated_at":"2016-02-04T22:30:58Z","pushed_at":"2016-09-29T09:06:21Z","git_url":"git://github.com/open-craft/edx-platform.git","ssh_url":"git@github.com:open-craft/edx-platform.git","clone_url":"https://github.com/open-craft/edx-platform.git","svn_url":"https://github.com/open-craft/edx-platform","homepage":"http://code.edx.org/","size":698638,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"2b80c61980556d9ffac297a4c2679c75eaf2f204","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","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":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","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/edx-platform","description":"The Open edX platform, the software that powers edX!","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-platform/deployments","created_at":"2013-05-30T20:20:38Z","updated_at":"2016-09-28T05:26:33Z","pushed_at":"2016-09-29T09:21:35Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://open.edx.org/","size":832409,"stargazers_count":2792,"watchers_count":2792,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1676,"mirror_url":null,"open_issues_count":153,"forks":1676,"open_issues":153,"watchers":2792,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/13483"},"html":{"href":"https://github.com/edx/edx-platform/pull/13483"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/13483"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/13483/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/13483/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/13483/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/2877d907fb27b77f749d20866a9a4f05c65f6389"}}}}
{"actor":{"display_login":"itsjeyd"}}