diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7978a3ba9..4dabe0de8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,11 @@ repos: hooks: - id: django-upgrade args: [--target-version, "4.2"] +- repo: https://github.com/adamchainz/djade-pre-commit + rev: "1.3.2" + hooks: + - id: djade + args: [--target-version, "4.2"] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index b5c225ac8..607863104 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -2,10 +2,10 @@ {% block css %} -{% endblock %} +{% endblock css %} {% block js %} -{% endblock %} +{% endblock js %}
-
+
DJDT
diff --git a/debug_toolbar/templates/debug_toolbar/includes/panel_button.html b/debug_toolbar/templates/debug_toolbar/includes/panel_button.html index 344331d8d..bc6f03ad9 100644 --- a/debug_toolbar/templates/debug_toolbar/includes/panel_button.html +++ b/debug_toolbar/templates/debug_toolbar/includes/panel_button.html @@ -1,7 +1,7 @@ {% load i18n %}
  • - + {% if panel.has_content and panel.enabled %} {% else %} @@ -9,7 +9,7 @@ {% endif %} {{ panel.nav_title }} {% if panel.enabled %} - {% with panel.nav_subtitle as subtitle %} + {% with subtitle=panel.nav_subtitle %} {% if subtitle %}
    {{ subtitle }}{% endif %} {% endwith %} {% endif %} diff --git a/debug_toolbar/templates/debug_toolbar/panels/alerts.html b/debug_toolbar/templates/debug_toolbar/panels/alerts.html index df208836d..6665033fb 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/alerts.html +++ b/debug_toolbar/templates/debug_toolbar/panels/alerts.html @@ -1,12 +1,12 @@ {% load i18n %} {% if alerts %} -

    {% trans "Alerts found" %}

    +

    {% translate "Alerts found" %}

    {% for alert in alerts %}
    • {{ alert.alert }}
    {% endfor %} {% else %} -

    {% trans "No alerts found" %}

    +

    {% translate "No alerts found" %}

    {% endif %} diff --git a/debug_toolbar/templates/debug_toolbar/panels/cache.html b/debug_toolbar/templates/debug_toolbar/panels/cache.html index 0e1ec2a4c..fe882750b 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/cache.html +++ b/debug_toolbar/templates/debug_toolbar/panels/cache.html @@ -1,12 +1,12 @@ {% load i18n %} -

    {% trans "Summary" %}

    +

    {% translate "Summary" %}

    - - - - + + + + @@ -18,7 +18,7 @@

    {% trans "Summary" %}

    {% trans "Total calls" %}{% trans "Total time" %}{% trans "Cache hits" %}{% trans "Cache misses" %}{% translate "Total calls" %}{% translate "Total time" %}{% translate "Cache hits" %}{% translate "Cache misses" %}
    -

    {% trans "Commands" %}

    +

    {% translate "Commands" %}

    @@ -36,15 +36,15 @@

    {% trans "Commands" %}

    {% if calls %} -

    {% trans "Calls" %}

    +

    {% translate "Calls" %}

    - - - - - + + + + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/headers.html b/debug_toolbar/templates/debug_toolbar/panels/headers.html index f4146e8dd..db33f1b59 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/headers.html +++ b/debug_toolbar/templates/debug_toolbar/panels/headers.html @@ -1,12 +1,12 @@ {% load i18n %} -

    {% trans "Request headers" %}

    +

    {% translate "Request headers" %}

    {% trans "Time (ms)" %}{% trans "Type" %}{% trans "Arguments" %}{% trans "Keyword arguments" %}{% trans "Backend" %}{% translate "Time (ms)" %}{% translate "Type" %}{% translate "Arguments" %}{% translate "Keyword arguments" %}{% translate "Backend" %}
    - - + + @@ -19,13 +19,13 @@

    {% trans "Request headers" %}

    {% trans "Key" %}{% trans "Value" %}{% translate "Key" %}{% translate "Value" %}
    -

    {% trans "Response headers" %}

    +

    {% translate "Response headers" %}

    - - + + @@ -38,15 +38,15 @@

    {% trans "Response headers" %}

    {% trans "Key" %}{% trans "Value" %}{% translate "Key" %}{% translate "Value" %}
    -

    {% trans "WSGI environ" %}

    +

    {% translate "WSGI environ" %}

    -

    {% trans "Since the WSGI environ inherits the environment of the server, only a significant subset is shown below." %}

    +

    {% translate "Since the WSGI environ inherits the environment of the server, only a significant subset is shown below." %}

    - - + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/history.html b/debug_toolbar/templates/debug_toolbar/panels/history.html index 840f6c9f4..ba7823d22 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/history.html +++ b/debug_toolbar/templates/debug_toolbar/panels/history.html @@ -1,4 +1,4 @@ -{% load i18n %}{% load static %} +{% load i18n static %} {{ refresh_form.as_div }} @@ -6,12 +6,12 @@
    {% trans "Key" %}{% trans "Value" %}{% translate "Key" %}{% translate "Value" %}
    - - - - - - + + + + + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/history_tr.html b/debug_toolbar/templates/debug_toolbar/panels/history_tr.html index eff544f1a..1642b4a47 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/history_tr.html +++ b/debug_toolbar/templates/debug_toolbar/panels/history_tr.html @@ -19,8 +19,8 @@ - - + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/profiling.html b/debug_toolbar/templates/debug_toolbar/panels/profiling.html index 4c1c3acd3..0c2206a13 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/profiling.html +++ b/debug_toolbar/templates/debug_toolbar/panels/profiling.html @@ -2,12 +2,12 @@
    {% trans "Time" %}{% trans "Method" %}{% trans "Path" %}{% trans "Request Variables" %}{% trans "Status" %}{% trans "Action" %}{% translate "Time" %}{% translate "Method" %}{% translate "Path" %}{% translate "Request Variables" %}{% translate "Status" %}{% translate "Action" %}
    {% trans "Variable" %}{% trans "Value" %}{% translate "Variable" %}{% translate "Value" %}
    - - - - - - + + + + + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/request.html b/debug_toolbar/templates/debug_toolbar/panels/request.html index 076d5f74f..4a16468b5 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/request.html +++ b/debug_toolbar/templates/debug_toolbar/panels/request.html @@ -1,13 +1,13 @@ {% load i18n %} -

    {% trans "View information" %}

    +

    {% translate "View information" %}

    {% trans "Call" %}{% trans "CumTime" %}{% trans "Per" %}{% trans "TotTime" %}{% trans "Per" %}{% trans "Count" %}{% translate "Call" %}{% translate "CumTime" %}{% translate "Per" %}{% translate "TotTime" %}{% translate "Per" %}{% translate "Count" %}
    - - - - + + + + @@ -21,29 +21,29 @@

    {% trans "View information" %}

    {% trans "View function" %}{% trans "Arguments" %}{% trans "Keyword arguments" %}{% trans "URL name" %}{% translate "View function" %}{% translate "Arguments" %}{% translate "Keyword arguments" %}{% translate "URL name" %}
    {% if cookies.list or cookies.raw %} -

    {% trans "Cookies" %}

    +

    {% translate "Cookies" %}

    {% include 'debug_toolbar/panels/request_variables.html' with variables=cookies %} {% else %} -

    {% trans "No cookies" %}

    +

    {% translate "No cookies" %}

    {% endif %} {% if session.list or session.raw %} -

    {% trans "Session data" %}

    +

    {% translate "Session data" %}

    {% include 'debug_toolbar/panels/request_variables.html' with variables=session %} {% else %} -

    {% trans "No session data" %}

    +

    {% translate "No session data" %}

    {% endif %} {% if get.list or get.raw %} -

    {% trans "GET data" %}

    +

    {% translate "GET data" %}

    {% include 'debug_toolbar/panels/request_variables.html' with variables=get %} {% else %} -

    {% trans "No GET data" %}

    +

    {% translate "No GET data" %}

    {% endif %} {% if post.list or post.raw %} -

    {% trans "POST data" %}

    +

    {% translate "POST data" %}

    {% include 'debug_toolbar/panels/request_variables.html' with variables=post %} {% else %} -

    {% trans "No POST data" %}

    +

    {% translate "No POST data" %}

    {% endif %} diff --git a/debug_toolbar/templates/debug_toolbar/panels/request_variables.html b/debug_toolbar/templates/debug_toolbar/panels/request_variables.html index 92200f867..26b487ab0 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/request_variables.html +++ b/debug_toolbar/templates/debug_toolbar/panels/request_variables.html @@ -8,8 +8,8 @@ - {% trans "Variable" %} - {% trans "Value" %} + {% translate "Variable" %} + {% translate "Value" %} diff --git a/debug_toolbar/templates/debug_toolbar/panels/settings.html b/debug_toolbar/templates/debug_toolbar/panels/settings.html index 14763e4e6..5214c1b42 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/settings.html +++ b/debug_toolbar/templates/debug_toolbar/panels/settings.html @@ -2,8 +2,8 @@ - - + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/signals.html b/debug_toolbar/templates/debug_toolbar/panels/signals.html index cd9f42c4a..abd648924 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/signals.html +++ b/debug_toolbar/templates/debug_toolbar/panels/signals.html @@ -2,8 +2,8 @@
    {% trans "Setting" %}{% trans "Value" %}{% translate "Setting" %}{% translate "Value" %}
    - - + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html index e5bf0b7f6..63cf293c1 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html @@ -3,15 +3,15 @@ {% for alias, info in databases %}
  • {{ alias }} - {{ info.time_spent|floatformat:"2" }} ms ({% blocktrans count info.num_queries as num %}{{ num }} query{% plural %}{{ num }} queries{% endblocktrans %} + {{ info.time_spent|floatformat:"2" }} ms ({% blocktranslate count num=info.num_queries %}{{ num }} query{% plural %}{{ num }} queries{% endblocktranslate %} {% if info.similar_count %} - {% blocktrans with count=info.similar_count trimmed %} + {% blocktranslate with count=info.similar_count trimmed %} including {{ count }} similar - {% endblocktrans %} + {% endblocktranslate %} {% if info.duplicate_count %} - {% blocktrans with dupes=info.duplicate_count trimmed %} + {% blocktranslate with dupes=info.duplicate_count trimmed %} and {{ dupes }} duplicates - {% endblocktrans %} + {% endblocktranslate %} {% endif %} {% endif %})
  • @@ -31,16 +31,16 @@ - - - - + + + + {% for query in queries %} - + @@ -49,13 +49,13 @@ {% if query.similar_count %} - {% blocktrans with count=query.similar_count %}{{ count }} similar queries.{% endblocktrans %} + {% blocktranslate with count=query.similar_count %}{{ count }} similar queries.{% endblocktranslate %} {% endif %} {% if query.duplicate_count %} - {% blocktrans with dupes=query.duplicate_count %}Duplicated {{ dupes }} times.{% endblocktrans %} + {% blocktranslate with dupes=query.duplicate_count %}Duplicated {{ dupes }} times.{% endblocktranslate %} {% endif %} @@ -92,12 +92,12 @@
    {% trans "Signal" %}{% trans "Receivers" %}{% translate "Signal" %}{% translate "Receivers" %}
    {% trans "Query" %}{% trans "Timeline" %}{% trans "Time (ms)" %}{% trans "Action" %}{% translate "Query" %}{% translate "Timeline" %}{% translate "Time (ms)" %}{% translate "Action" %}
    -

    {% trans "Connection:" %} {{ query.alias }}

    +

    {% translate "Connection:" %} {{ query.alias }}

    {% if query.iso_level %} -

    {% trans "Isolation level:" %} {{ query.iso_level }}

    +

    {% translate "Isolation level:" %} {{ query.iso_level }}

    {% endif %} {% if query.trans_status %} -

    {% trans "Transaction status:" %} {{ query.trans_status }}

    +

    {% translate "Transaction status:" %} {{ query.trans_status }}

    {% endif %} {% if query.stacktrace %}
    {{ query.stacktrace }}
    @@ -120,5 +120,5 @@
    {% else %} -

    {% trans "No SQL queries were recorded during this request." %}

    +

    {% translate "No SQL queries were recorded during this request." %}

    {% endif %} diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html b/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html index 61dadbda6..f169c838f 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql_explain.html @@ -1,16 +1,16 @@ {% load i18n %}
    -

    {% trans "SQL explained" %}

    +

    {% translate "SQL explained" %}

    -
    {% trans "Executed SQL" %}
    +
    {% translate "Executed SQL" %}
    {{ sql|safe }}
    -
    {% trans "Time" %}
    +
    {% translate "Time" %}
    {{ duration }} ms
    -
    {% trans "Database" %}
    +
    {% translate "Database" %}
    {{ alias }}
    diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html index 57f20b619..6c07640e0 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql_profile.html @@ -1,17 +1,17 @@ {% load i18n %}
    -

    {% trans "SQL profiled" %}

    +

    {% translate "SQL profiled" %}

    {% if result %}
    -
    {% trans "Executed SQL" %}
    +
    {% translate "Executed SQL" %}
    {{ sql|safe }}
    -
    {% trans "Time" %}
    +
    {% translate "Time" %}
    {{ duration }} ms
    -
    {% trans "Database" %}
    +
    {% translate "Database" %}
    {{ alias }}
    @@ -34,7 +34,7 @@

    {% trans "SQL profiled" %}

    {% else %}
    -
    {% trans "Error" %}
    +
    {% translate "Error" %}
    {{ result_error }}
    {% endif %} diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql_select.html b/debug_toolbar/templates/debug_toolbar/panels/sql_select.html index 699c18d87..3667f8199 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/sql_select.html +++ b/debug_toolbar/templates/debug_toolbar/panels/sql_select.html @@ -1,16 +1,16 @@ {% load i18n %}
    -

    {% trans "SQL selected" %}

    +

    {% translate "SQL selected" %}

    -
    {% trans "Executed SQL" %}
    +
    {% translate "Executed SQL" %}
    {{ sql|safe }}
    -
    {% trans "Time" %}
    +
    {% translate "Time" %}
    {{ duration }} ms
    -
    {% trans "Database" %}
    +
    {% translate "Database" %}
    {{ alias }}
    {% if result %} @@ -33,7 +33,7 @@

    {% trans "SQL selected" %}

    {% else %} -

    {% trans "Empty set" %}

    +

    {% translate "Empty set" %}

    {% endif %}
    diff --git a/debug_toolbar/templates/debug_toolbar/panels/staticfiles.html b/debug_toolbar/templates/debug_toolbar/panels/staticfiles.html index 9aa519f67..aaa7c78ab 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/staticfiles.html +++ b/debug_toolbar/templates/debug_toolbar/panels/staticfiles.html @@ -1,17 +1,17 @@ {% load i18n %} -

    {% blocktrans count staticfiles_dirs|length as dirs_count %}Static file path{% plural %}Static file paths{% endblocktrans %}

    +

    {% blocktranslate count dirs_count=staticfiles_dirs|length %}Static file path{% plural %}Static file paths{% endblocktranslate %}

    {% if staticfiles_dirs %}
      {% for prefix, staticfiles_dir in staticfiles_dirs %} -
    1. {{ staticfiles_dir }}{% if prefix %} {% blocktrans %}(prefix {{ prefix }}){% endblocktrans %}{% endif %}
    2. +
    3. {{ staticfiles_dir }}{% if prefix %} {% blocktranslate %}(prefix {{ prefix }}){% endblocktranslate %}{% endif %}
    4. {% endfor %}
    {% else %} -

    {% trans "None" %}

    +

    {% translate "None" %}

    {% endif %} -

    {% blocktrans count staticfiles_apps|length as apps_count %}Static file app{% plural %}Static file apps{% endblocktrans %}

    +

    {% blocktranslate count apps_count=staticfiles_apps|length %}Static file app{% plural %}Static file apps{% endblocktranslate %}

    {% if staticfiles_apps %}
      {% for static_app in staticfiles_apps %} @@ -19,10 +19,10 @@

      {% blocktrans count staticfiles_apps|length as apps_count %}Static file app{ {% endfor %}

    {% else %} -

    {% trans "None" %}

    +

    {% translate "None" %}

    {% endif %} -

    {% blocktrans count staticfiles|length as staticfiles_count %}Static file{% plural %}Static files{% endblocktrans %}

    +

    {% blocktranslate count staticfiles_count=staticfiles|length %}Static file{% plural %}Static files{% endblocktranslate %}

    {% if staticfiles %}
    {% for staticfile in staticfiles %} @@ -31,17 +31,17 @@

    {% blocktrans count staticfiles|length as staticfiles_count %}Static file{% {% endfor %}

    {% else %} -

    {% trans "None" %}

    +

    {% translate "None" %}

    {% endif %} {% for finder, payload in staticfiles_finders.items %} -

    {{ finder }} ({% blocktrans count payload|length as payload_count %}{{ payload_count }} file{% plural %}{{ payload_count }} files{% endblocktrans %})

    +

    {{ finder }} ({% blocktranslate count payload_count=payload|length %}{{ payload_count }} file{% plural %}{{ payload_count }} files{% endblocktranslate %})

    - - + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/template_source.html b/debug_toolbar/templates/debug_toolbar/panels/template_source.html index 397c44b24..6e52a6ab8 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/template_source.html +++ b/debug_toolbar/templates/debug_toolbar/panels/template_source.html @@ -1,7 +1,7 @@ {% load i18n %}
    -

    {% trans "Template source:" %} {{ template_name }}

    +

    {% translate "Template source:" %} {{ template_name }}

    diff --git a/debug_toolbar/templates/debug_toolbar/panels/templates.html b/debug_toolbar/templates/debug_toolbar/panels/templates.html index 121c086a8..4ceae12e7 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/templates.html +++ b/debug_toolbar/templates/debug_toolbar/panels/templates.html @@ -1,5 +1,5 @@ {% load i18n %} -

    {% blocktrans count template_dirs|length as template_count %}Template path{% plural %}Template paths{% endblocktrans %}

    +

    {% blocktranslate count template_count=template_dirs|length %}Template path{% plural %}Template paths{% endblocktranslate %}

    {% if template_dirs %}
      {% for template in template_dirs %} @@ -7,10 +7,10 @@

      {% blocktrans count template_dirs|length as template_count %}Template path{% {% endfor %}

    {% else %} -

    {% trans "None" %}

    +

    {% translate "None" %}

    {% endif %} -

    {% blocktrans count templates|length as template_count %}Template{% plural %}Templates{% endblocktrans %}

    +

    {% blocktranslate count template_count=templates|length %}Template{% plural %}Templates{% endblocktranslate %}

    {% if templates %}
    {% for template in templates %} @@ -19,7 +19,7 @@

    {% blocktrans count templates|length as template_count %}Template{% plural % {% if template.context %}
    - {% trans "Toggle context" %} + {% translate "Toggle context" %} {{ template.context }}
    @@ -27,22 +27,22 @@

    {% blocktrans count templates|length as template_count %}Template{% plural % {% endfor %}

    {% else %} -

    {% trans "None" %}

    +

    {% translate "None" %}

    {% endif %} -

    {% blocktrans count context_processors|length as context_processors_count %}Context processor{% plural %}Context processors{% endblocktrans %}

    +

    {% blocktranslate count context_processors_count=context_processors|length %}Context processor{% plural %}Context processors{% endblocktranslate %}

    {% if context_processors %}
    {% for key, value in context_processors.items %}
    {{ key|escape }}
    - {% trans "Toggle context" %} + {% translate "Toggle context" %} {{ value|escape }}
    {% endfor %}
    {% else %} -

    {% trans "None" %}

    +

    {% translate "None" %}

    {% endif %} diff --git a/debug_toolbar/templates/debug_toolbar/panels/timer.html b/debug_toolbar/templates/debug_toolbar/panels/timer.html index 11483c107..b85720483 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/timer.html +++ b/debug_toolbar/templates/debug_toolbar/panels/timer.html @@ -1,5 +1,5 @@ {% load i18n %} -

    {% trans "Resource usage" %}

    +

    {% translate "Resource usage" %}

    {% trans 'Path' %}{% trans 'Location' %}{% translate 'Path' %}{% translate 'Location' %}
    @@ -7,8 +7,8 @@

    {% trans "Resource usage" %}

    - - + + @@ -23,7 +23,7 @@

    {% trans "Resource usage" %}

    -

    {% trans "Browser timing" %}

    +

    {% translate "Browser timing" %}

    {% trans "Resource" %}{% trans "Value" %}{% translate "Resource" %}{% translate "Value" %}
    @@ -32,9 +32,9 @@

    {% trans "Browser timing" %}

    - - - + + + diff --git a/debug_toolbar/templates/debug_toolbar/panels/versions.html b/debug_toolbar/templates/debug_toolbar/panels/versions.html index d0ade6cfb..3428c0561 100644 --- a/debug_toolbar/templates/debug_toolbar/panels/versions.html +++ b/debug_toolbar/templates/debug_toolbar/panels/versions.html @@ -7,9 +7,9 @@ - - - + + + diff --git a/debug_toolbar/templates/debug_toolbar/redirect.html b/debug_toolbar/templates/debug_toolbar/redirect.html index 9d8966ed7..46897846d 100644 --- a/debug_toolbar/templates/debug_toolbar/redirect.html +++ b/debug_toolbar/templates/debug_toolbar/redirect.html @@ -7,9 +7,9 @@

    {{ status_line }}

    -

    {% trans "Location:" %} {{ redirect_to }}

    +

    {% translate "Location:" %} {{ redirect_to }}

    - {% trans "The Django Debug Toolbar has intercepted a redirect to the above URL for debug viewing purposes. You can click the above link to continue with the redirect as normal." %} + {% translate "The Django Debug Toolbar has intercepted a redirect to the above URL for debug viewing purposes. You can click the above link to continue with the redirect as normal." %}

    diff --git a/docs/changes.rst b/docs/changes.rst index 92cce4fe6..9c9195623 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -13,6 +13,8 @@ Pending * Added support for using django-template-partials with the template panel's source view functionality. The same change possibly adds support for other template loaders. +* Introduced `djade `__ to format Django + templates. 5.1.0 (2025-03-20) ------------------ diff --git a/example/templates/htmx/boost.html b/example/templates/htmx/boost.html index 782303b4e..7153a79ee 100644 --- a/example/templates/htmx/boost.html +++ b/example/templates/htmx/boost.html @@ -7,7 +7,7 @@ -

    Index of Tests (htmx) - Page {{page_num|default:"1"}}

    +

    Index of Tests (htmx) - Page {{ page_num|default:"1" }}

    For the debug panel to remain through page navigation, add the setting: diff --git a/example/templates/turbo/index.html b/example/templates/turbo/index.html index 143054e37..16ca9f2c6 100644 --- a/example/templates/turbo/index.html +++ b/example/templates/turbo/index.html @@ -7,7 +7,7 @@ -

    Turbo Index - Page {{page_num|default:"1"}}

    +

    Turbo Index - Page {{ page_num|default:"1" }}

    For the debug panel to remain through page navigation, add the setting: diff --git a/tests/panels/test_sql.py b/tests/panels/test_sql.py index 8e105657b..a411abb5d 100644 --- a/tests/panels/test_sql.py +++ b/tests/panels/test_sql.py @@ -655,8 +655,8 @@ def test_flat_template_information(self): template_info = query["template_info"] template_name = os.path.basename(template_info["name"]) self.assertEqual(template_name, "flat.html") - self.assertEqual(template_info["context"][2]["content"].strip(), "{{ users }}") - self.assertEqual(template_info["context"][2]["highlight"], True) + self.assertEqual(template_info["context"][3]["content"].strip(), "{{ users }}") + self.assertEqual(template_info["context"][3]["highlight"], True) @override_settings( DEBUG=True, diff --git a/tests/templates/ajax/ajax.html b/tests/templates/ajax/ajax.html index c9de3acb6..7955456de 100644 --- a/tests/templates/ajax/ajax.html +++ b/tests/templates/ajax/ajax.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% block content %}

    click for ajax
    @@ -18,4 +19,4 @@ } document.addEventListener("click", (event) => {send_ajax()}); -{% endblock %} +{% endblock content %} diff --git a/tests/templates/basic.html b/tests/templates/basic.html index 46f88e4da..02f87200a 100644 --- a/tests/templates/basic.html +++ b/tests/templates/basic.html @@ -1,2 +1,3 @@ {% extends "base.html" %} + {% block content %}Test for {{ title }}{% endblock %} diff --git a/tests/templates/jinja2/basic.jinja b/tests/templates/jinja2/basic.jinja index e531eee64..1ebced724 100644 --- a/tests/templates/jinja2/basic.jinja +++ b/tests/templates/jinja2/basic.jinja @@ -1,5 +1,6 @@ {% extends 'base.html' %} + {% block content %} Test for {{ title }} (Jinja) {% for i in range(10) %}{{ i }}{% endfor %} {# Jinja2 supports range(), Django templates do not #} -{% endblock %} +{% endblock content %} diff --git a/tests/templates/sql/flat.html b/tests/templates/sql/flat.html index 058dbe043..ee5386c55 100644 --- a/tests/templates/sql/flat.html +++ b/tests/templates/sql/flat.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% block content %} {{ users }} -{% endblock %} +{% endblock content %} diff --git a/tests/templates/sql/nested.html b/tests/templates/sql/nested.html index 8558e2d45..e23a53af1 100644 --- a/tests/templates/sql/nested.html +++ b/tests/templates/sql/nested.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% block content %} {% include "sql/included.html" %} -{% endblock %} +{% endblock content %} diff --git a/tests/templates/staticfiles/async_static.html b/tests/templates/staticfiles/async_static.html index fc0c9b885..80f636cce 100644 --- a/tests/templates/staticfiles/async_static.html +++ b/tests/templates/staticfiles/async_static.html @@ -3,4 +3,4 @@ {% block head %} -{% endblock %} +{% endblock head %}
    {% trans "Timing attribute" %}{% trans "Timeline" %}{% trans "Milliseconds since navigation start (+length)" %}{% translate "Timing attribute" %}{% translate "Timeline" %}{% translate "Milliseconds since navigation start (+length)" %}
    {% trans "Package" %}{% trans "Name" %}{% trans "Version" %}{% translate "Package" %}{% translate "Name" %}{% translate "Version" %}