{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/12151","repository_url":"https://api.github.com/repos/edx/edx-platform","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/12151/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/12151/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/12151/events","html_url":"https://github.com/edx/edx-platform/pull/12151","id":148381014,"number":12151,"title":"Fix errors in old Django templates / migrate to Mako","user":{"login":"bjacobel","id":407639,"avatar_url":"https://avatars.githubusercontent.com/u/407639?v=3","gravatar_id":"","url":"https://api.github.com/users/bjacobel","html_url":"https://github.com/bjacobel","followers_url":"https://api.github.com/users/bjacobel/followers","following_url":"https://api.github.com/users/bjacobel/following{/other_user}","gists_url":"https://api.github.com/users/bjacobel/gists{/gist_id}","starred_url":"https://api.github.com/users/bjacobel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjacobel/subscriptions","organizations_url":"https://api.github.com/users/bjacobel/orgs","repos_url":"https://api.github.com/users/bjacobel/repos","events_url":"https://api.github.com/users/bjacobel/events{/privacy}","received_events_url":"https://api.github.com/users/bjacobel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-14T14:33:35Z","updated_at":"2016-04-15T14:28:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/12151","html_url":"https://github.com/edx/edx-platform/pull/12151","diff_url":"https://github.com/edx/edx-platform/pull/12151.diff","patch_url":"https://github.com/edx/edx-platform/pull/12151.patch"},"body":"## [FEDX-150](https://openedx.atlassian.net/browse/FEDX-150)\r\n\r\nAlso refs [FEDX-156](https://openedx.atlassian.net/browse/FEDX-156), [FEDX-157](https://openedx.atlassian.net/browse/FEDX-157), [FEDX-158](https://openedx.atlassian.net/browse/FEDX-158), [FEDX-159](https://openedx.atlassian.net/browse/FEDX-159) and [TNL-4364](https://openedx.atlassian.net/browse/TNL4364)\r\n\r\nFive pages existed on the site which used as a base template [`main_django.html`](https://github.com/edx/edx-platform/blob/master/lms/templates/main_django.html) instead of the standard Mako-ized `main.html`:\r\n\r\n- OAuth client authorization, [`provider/authorize.html`](https://github.com/edx/edx-platform/tree/master/lms/templates/provider/authorize.html)\r\n- Password reset confirmation form, [`registration/password_reset_confirm.html`](https://github.com/edx/edx-platform/tree/master/lms/templates/registration/password_reset_confirm.html)\r\n- Password reset success view, [`registration/password_reset_complete.html`](https://github.com/edx/edx-platform/tree/master/lms/templates/registration/password_reset_complete.html)\r\n- an (I think deprecated?) view for requesting and tracking the status of refunds, [`support/refund.html`](https://github.com/edx/edx-platform/tree/master/lms/templates/support/refund.html)\r\n- Course wikis, [`wiki/base.html`](https://github.com/edx/edx-platform/tree/master/lms/templates/wiki/base.html) and child templates `create.html`, `edit.html`, and `history.html`\r\n\r\nBasing these pages off a base Django template was done in part because some of them relied on Django-based packages or template tags that couldn't be easily migrated into Mako, and in part I think because people forgot a few of these pages existed. Over time, drift separated these two base templates, resulting in the following issues:\r\n\r\n- the pages using the Django base template were excluded from Google Analytics and New Relic ([TNL-4364](https://openedx.atlassian.net/browse/TNL4364))\r\n- these pages developed issues where requirejs could not load an internationalization library ([FEDX-150](https://openedx.atlassian.net/browse/FEDX-150))\r\n- these pages handled CSS pipelining differently, resulting in the regression that caused this revert https://github.com/edx/edx-platform/pull/12089\r\n- some sort of still-mysterious issue with the browser trying to load MomentJS and parse it as HTML\r\n\r\nTo resolve this, we first fixed a few issues with the base Django template, and then began the work of moving as many pages away from inheriting from it (by translating them to Mako) as we could. The first four pages were moved easily off of `main_django.html`, but after encountering difficulty migrating the wikis, we decided to leave that for a future effort. (After that is complete, `main_django.html` should be deleted.)\r\n\r\n### Sandbox\r\n[https://bjacobel.sandbox.edx.org](https://bjacobel.sandbox.edx.org)\r\n\r\nSome of the pages to test are a little tricky to get to.\r\n- [For the wiki](https://bjacobel.sandbox.edx.org/courses/course-v1:edX+DemoX+Demo_Course/wiki/edX.DemoX.Demo_Course/)\r\n- For the password reset/confirm you'll have to sign up as a user on my sandbox with your real email and then go through the password reset process by clicking the link that's emailed to you. The emails from sandbox servers are _highly_ likely to get flagged as spam, so check there if you don't get one.\r\n- For the OAuth page, [use this link](https://django-oauth-toolkit.herokuapp.com/consumer/?authorization_link=https%3A%2F%2Fbjacobel.sandbox.edx.org%2Foauth2%2Fauthorize%3Fresponse_type%3Dcode%26client_id%3Dtest%26state%3Drandom_state_string%26scope%3Demail) and try varying the `scope` parameter in the URL to get different grant scopes, options are `openid, profile, email, course_staff, course_instructor, permissions`\r\n- For the refund page [this link will get you to the request form](https://bjacobel.sandbox.edx.org/support/refund). I don't actually know how to test that it works, though - I'm not familiar enough with the ecom ordering system. **Help appreciated to tag someone from the ECOM team on this PR for their help in testing this**. I've created a superuser on the sandbox with u/p `admin@example.com/edx` in order to create orders and certs.\r\n\r\n### Testing\r\n- [ ] i18n\r\n- [ ] RTL\r\n- [ ] Data is properly encoded in HTML templates to avoid XSS\r\n- [ ] Unit, integration, acceptance tests as appropriate\r\n- [ ] Analytics\r\n- [ ] Performance\r\n- ~~Database migrations are backwards-compatible~~ N/A\r\n\r\n### Reviewers\r\nIf you've been tagged for review, please check your corresponding box once you've given the :+1:.\r\n- [ ] Code review: @andy-armstrong \r\n-  ~~Code Review: @cahrens~~ \r\n- [x] Code Review: @AlasdairSwan \r\n- [ ] Accessibility review: @clrux \r\n\r\nFYI: @awaisdar001 @adampalay @tobz \r\n\r\n### Post-review\r\n- [ ] Squash commits"},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/210483192","html_url":"https://github.com/edx/edx-platform/pull/12151#issuecomment-210483192","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/12151","id":210483192,"user":{"login":"bjacobel","id":407639,"avatar_url":"https://avatars.githubusercontent.com/u/407639?v=3","gravatar_id":"","url":"https://api.github.com/users/bjacobel","html_url":"https://github.com/bjacobel","followers_url":"https://api.github.com/users/bjacobel/followers","following_url":"https://api.github.com/users/bjacobel/following{/other_user}","gists_url":"https://api.github.com/users/bjacobel/gists{/gist_id}","starred_url":"https://api.github.com/users/bjacobel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjacobel/subscriptions","organizations_url":"https://api.github.com/users/bjacobel/orgs","repos_url":"https://api.github.com/users/bjacobel/repos","events_url":"https://api.github.com/users/bjacobel/events{/privacy}","received_events_url":"https://api.github.com/users/bjacobel/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T14:28:44Z","updated_at":"2016-04-15T14:28:44Z","body":"jenkins run python"}}