{"action":"created","issue":{"url":"https://api.github.com/repos/zulip/zulip/issues/699","repository_url":"https://api.github.com/repos/zulip/zulip","labels_url":"https://api.github.com/repos/zulip/zulip/issues/699/labels{/name}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/699/comments","events_url":"https://api.github.com/repos/zulip/zulip/issues/699/events","html_url":"https://github.com/zulip/zulip/pull/699","id":150593936,"number":699,"title":"Use Jinja2 templates.","user":{"login":"umairwaheed","id":641763,"avatar_url":"https://avatars.githubusercontent.com/u/641763?v=3","gravatar_id":"","url":"https://api.github.com/users/umairwaheed","html_url":"https://github.com/umairwaheed","followers_url":"https://api.github.com/users/umairwaheed/followers","following_url":"https://api.github.com/users/umairwaheed/following{/other_user}","gists_url":"https://api.github.com/users/umairwaheed/gists{/gist_id}","starred_url":"https://api.github.com/users/umairwaheed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairwaheed/subscriptions","organizations_url":"https://api.github.com/users/umairwaheed/orgs","repos_url":"https://api.github.com/users/umairwaheed/repos","events_url":"https://api.github.com/users/umairwaheed/events{/privacy}","received_events_url":"https://api.github.com/users/umairwaheed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2016-04-23T20:28:19Z","updated_at":"2016-05-03T19:23:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/699","html_url":"https://github.com/zulip/zulip/pull/699","diff_url":"https://github.com/zulip/zulip/pull/699.diff","patch_url":"https://github.com/zulip/zulip/pull/699.patch"},"body":"@timabbott please review. There is only one commit, even though this is a big commit but I think the changes are trivial.\r\n\r\nChanges in templates:\r\n- Change `block.super` to `super()`.\r\n- Remove `load` tag because Jinja2 doesn't support it.\r\n- Use `minified_js()` instead of `{% minified_js %}`. The `safe` filter is\r\n  explicitly applied as well.\r\n- Use `compressed_css()` instead of `{% compressed_css %}`. The `safe` filter\r\n  is explicitly applied as well.\r\n- `forloop.first` -> `loop.first`.\r\n- Use `{{ csrf_input }}` instead of `{% csrf_tokesn %}`.\r\n- Use `{# ... #}` instead of `{% comment %}`.\r\n- Create `css.jinja` template for Django Pipeline.\r\n- Use `url()` instead of `{% url %}`.\r\n- Use `_()` instead of `{% trans %}` because in Jinja `trans` is a block tag.\r\n- Use `{% trans %}` instead of `{% blocktrans %}`.\r\n- Add check to `user_profile` for `undefined` in templates/zerver/base.html.\r\n\r\nChanges in tools:\r\n- Check for `trans` block in `check-templates` instead of `blocktrans`\r\n\r\nChanges in backend:\r\n- Create custom `render_to_response` function which takes `request` objects\r\n  instead of `RequestContext` object. There are two reasons:\r\n    1. `RequestContext` is not compatible with Jinja2\r\n    2. `RequestContext` in `render_to_response` is deprecated\r\n- Add Jinja2 related support files in zproject/jinja2 directory. It\r\n  includes a custom backend and a template renderer, compressors for js\r\n  and css and Jinja2 environment handler.\r\n- Enable `slugify` and `pluralize` filters in Jinja2 environment.\r\n- Add Django 1.8 compatible `TEMPLATES` setting and remove `TEMPLATE_*`\r\n  settings."},"comment":{"url":"https://api.github.com/repos/zulip/zulip/issues/comments/216637882","html_url":"https://github.com/zulip/zulip/pull/699#issuecomment-216637882","issue_url":"https://api.github.com/repos/zulip/zulip/issues/699","id":216637882,"user":{"login":"umairwaheed","id":641763,"avatar_url":"https://avatars.githubusercontent.com/u/641763?v=3","gravatar_id":"","url":"https://api.github.com/users/umairwaheed","html_url":"https://github.com/umairwaheed","followers_url":"https://api.github.com/users/umairwaheed/followers","following_url":"https://api.github.com/users/umairwaheed/following{/other_user}","gists_url":"https://api.github.com/users/umairwaheed/gists{/gist_id}","starred_url":"https://api.github.com/users/umairwaheed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairwaheed/subscriptions","organizations_url":"https://api.github.com/users/umairwaheed/orgs","repos_url":"https://api.github.com/users/umairwaheed/repos","events_url":"https://api.github.com/users/umairwaheed/events{/privacy}","received_events_url":"https://api.github.com/users/umairwaheed/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T19:23:47Z","updated_at":"2016-05-03T19:23:47Z","body":"I have also changed the version of Jinja2 to 2.7.2 and of Markupsafe to 0.18 to reflect the production environment."}}