mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
This results in a substantial performance improvement for all of
Zulip's backend templates.
Changes in templates:
- Change `block.super` to `super()`.
- Remove `load` tag because Jinja2 doesn't support it.
- Use `minified_js()|safe` instead of `{% minified_js %}`.
- Use `compressed_css()|safe` instead of `{% compressed_css %}`.
- `forloop.first` -> `loop.first`.
- Use `{{ csrf_input }}` instead of `{% csrf_token %}`.
- Use `{# ... #}` instead of `{% comment %}`.
- Use `url()` instead of `{% url %}`.
- Use `_()` instead of `{% trans %}` because in Jinja `trans` is a block tag.
- Use `{% trans %}` instead of `{% blocktrans %}`.
- Use `{% raw %}` instead of `{% verbatim %}`.
Changes in tools:
- Check for `trans` block in `check-templates` instead of `blocktrans`
Changes in backend:
- Create custom `render_to_response` function which takes `request` objects
instead of `RequestContext` object. There are two reasons to do this:
1. `RequestContext` is not compatible with Jinja2
2. `RequestContext` in `render_to_response` is deprecated.
- Add Jinja2 related support files in zproject/jinja2 directory. It
includes a custom backend and a template renderer, compressors for js
and css and Jinja2 environment handler.
- Enable `slugify` and `pluralize` filters in Jinja2 environment.
Fixes #620.
25 lines
1023 B
HTML
25 lines
1023 B
HTML
{% extends "zerver/portico.html" %}
|
|
|
|
{% block for_you %} isn't feeling too good. {% endblock %}
|
|
|
|
{% block customhead %}
|
|
{{ super() }}
|
|
<meta http-equiv="refresh" content="60;URL='/'">
|
|
{% endblock %}
|
|
|
|
{% block portico_content %}
|
|
|
|
<br/>
|
|
<p class="lead">500: Internal server error.</p>
|
|
|
|
<p>Well oops. This one's probably our fault. Sorry about that! Updates on
|
|
service availability are posted to
|
|
<a class="twitter-timeline" href="https://twitter.com/ZulipStatus"
|
|
data-widget-id="443457763394334720"
|
|
data-screen-name="ZulipStatus"
|
|
>@ZulipStatus on Twitter</a>.</p>
|
|
|
|
<p>If you'd like, you can <a href="mailto:{{ zulip_admin }}?Subject=500%20error%20on%20%7Bwhich%20URL%3F%7D&Body=Hi%20there%21%0A%0AI%20was%20trying%20to%20do%20%7Bwhat%20were%20you%20trying%20to%20do%3F%7D%20at%20around%20%7Bwhen%20was%20this%3F%7D%20when%20I%20got%20a%20500%20error%20while%20accessing%20%7Bwhich%20URL%3F%7D.%0A%0AThanks!%0A%0ASincerely%2C%20%0A%0A%7BYour%20name%7D">drop us a line</a> to let us know what happened.</p>
|
|
|
|
{% endblock %}
|