mirror of
https://github.com/zulip/zulip.git
synced 2026-07-03 21:10:12 +08: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.
35 lines
1.1 KiB
HTML
35 lines
1.1 KiB
HTML
{% extends "zerver/portico_signup.html" %}
|
|
{% block portico_content %}
|
|
|
|
<div class="pitch">
|
|
<h3>{{ _('Reset your password') }}.</h3>
|
|
</div>
|
|
|
|
<form method="post" class="form-horizontal" action="{{ url('django.contrib.auth.views.password_reset') }}">
|
|
{{ csrf_input }}
|
|
<div class="control-group">
|
|
<label for="id_email" class="control-label">{{ _('Email') }}</label>
|
|
<div class="controls">
|
|
<input id="id_email" class="required" type="text" name="email"
|
|
value="{% if form.email.value() %}{{ form.email.value() }}{% endif %}"
|
|
maxlength="100" />
|
|
{% if form.email.errors %}
|
|
{% for error in form.email.errors %}
|
|
<div class="alert alert-error">{{ error }}</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<div class="controls">
|
|
<input type="submit" class="btn btn-primary" value="Reset password" /><br />
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
autofocus('#id_email');
|
|
</script>
|
|
|
|
{% endblock %}
|