From a3830f6d663aee9e91871002cbff7c57aee6d989 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 7 Aug 2015 07:18:55 -0400 Subject: [PATCH] Refs #25236 -- Removed ifequal/ifnotequal usage. --- .../contrib/admin/templates/admin/pagination.html | 2 +- .../contrib/admin/templates/admin/search_form.html | 2 +- django/views/debug.py | 14 +++++++------- django/views/static.py | 4 ++-- tests/template_tests/syntax_tests/test_extends.py | 8 ++++---- tests/template_tests/syntax_tests/test_i18n.py | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/django/contrib/admin/templates/admin/pagination.html b/django/contrib/admin/templates/admin/pagination.html index 358813290c..fc1e600805 100644 --- a/django/contrib/admin/templates/admin/pagination.html +++ b/django/contrib/admin/templates/admin/pagination.html @@ -6,7 +6,7 @@ {% paginator_number cl i %} {% endfor %} {% endif %} -{{ cl.result_count }} {% ifequal cl.result_count 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endifequal %} +{{ cl.result_count }} {% if cl.result_count == 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endif %} {% if show_all_url %}  {% trans 'Show all' %}{% endif %} {% if cl.formset and cl.result_count %}{% endif %}

diff --git a/django/contrib/admin/templates/admin/search_form.html b/django/contrib/admin/templates/admin/search_form.html index 4cc24604f7..a9bb014748 100644 --- a/django/contrib/admin/templates/admin/search_form.html +++ b/django/contrib/admin/templates/admin/search_form.html @@ -9,7 +9,7 @@ {% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %} ({% if cl.show_full_result_count %}{% blocktrans with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktrans %}{% else %}{% trans "Show all" %}{% endif %}) {% endif %} {% for pair in cl.params.items %} - {% ifnotequal pair.0 search_var %}{% endifnotequal %} + {% if pair.0 != search_var %}{% endif %} {% endfor %} diff --git a/django/views/debug.py b/django/views/debug.py index e7f2bbd6b2..4f96ac320c 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -747,9 +747,9 @@ TECHNICAL_500_TEMPLATE = ("""

In template {{ template_info.name }}, error at line {{ template_info.line }}

{{ template_info.message }}

+ {% if template_info.bottom != template_info.total %} cut-bottom{% endif %}"> {% for source_line in template_info.source_lines %} - {% ifequal source_line.0 template_info.line %} + {% if source_line.0 == template_info.line %} - {% endifequal %} + {% endif %} {% endfor %}
{{ source_line.0 }} {{ template_info.before }}""" """{{ template_info.during }}""" @@ -758,7 +758,7 @@ TECHNICAL_500_TEMPLATE = (""" {% else %}
{{ source_line.0 }} {{ source_line.1 }}
@@ -872,11 +872,11 @@ Template error: In template {{ template_info.name }}, error at line {{ template_info.line }} {{ template_info.message }}""" "{% for source_line in template_info.source_lines %}" -"{% ifequal source_line.0 template_info.line %}" +"{% if source_line.0 == template_info.line %}" " {{ source_line.0 }} : {{ template_info.before }} {{ template_info.during }} {{ template_info.after }}" "{% else %}" " {{ source_line.0 }} : {{ source_line.1 }}" -"""{% endifequal %}{% endfor %}{% endif %} +"""{% endif %}{% endfor %}{% endif %} Traceback:{% for frame in frames %} {% ifchanged frame.exc_cause %}{% if frame.exc_cause %}{% if frame.exc_cause_explicit %} @@ -1072,11 +1072,11 @@ Template error: In template {{ template_info.name }}, error at line {{ template_info.line }} {{ template_info.message }} {% for source_line in template_info.source_lines %}""" -"{% ifequal source_line.0 template_info.line %}" +"{% if source_line.0 == template_info.line %}" " {{ source_line.0 }} : {{ template_info.before }} {{ template_info.during }} {{ template_info.after }}" "{% else %}" " {{ source_line.0 }} : {{ source_line.1 }}" -"""{% endifequal %}{% endfor %}{% endif %}{% if frames %} +"""{% endif %}{% endfor %}{% endif %}{% if frames %} Traceback:""" "{% for frame in frames %}" diff --git a/django/views/static.py b/django/views/static.py index 9959b96236..6187f6ffd9 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -87,9 +87,9 @@ DEFAULT_DIRECTORY_INDEX_TEMPLATE = """

{% blocktrans %}Index of {{ directory }}{% endblocktrans %}