diff --git a/django/contrib/admin/templates/admin/actions.html b/django/contrib/admin/templates/admin/actions.html index cbb25bfbd2..ca1327c6d5 100644 --- a/django/contrib/admin/templates/admin/actions.html +++ b/django/contrib/admin/templates/admin/actions.html @@ -2,7 +2,7 @@
{% block actions %} {% block actions-form %} - {% for field in action_form %}{% if field.label %}{% endif %}{% endfor %} + {% for field in action_form %}{% if field.label %}{% else %}{{ field }}{% endif %}{% endfor %} {% endblock %} {% block actions-submit %} diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html index ac02e811ea..29fc7e4709 100644 --- a/django/contrib/admin/templates/admin/auth/user/change_password.html +++ b/django/contrib/admin/templates/admin/auth/user/change_password.html @@ -22,7 +22,7 @@ {% if is_popup %}{% endif %} {% if form.errors %}

- {% if form.errors.items|length == 1 %}{% translate "Please correct the error below." %}{% else %}{% translate "Please correct the errors below." %}{% endif %} + {% blocktranslate count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}

{% endif %} diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index 33343846bf..20cc4a392c 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -25,13 +25,13 @@ {% block content %}
{% block object-tools %} -{% if change %}{% if not is_popup %} +{% if change and not is_popup %} -{% endif %}{% endif %} +{% endif %} {% endblock %}
{% csrf_token %}{% block form_top %}{% endblock %}
@@ -40,7 +40,7 @@ {% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %} {% if errors %}

- {% if errors|length == 1 %}{% translate "Please correct the error below." %}{% else %}{% translate "Please correct the errors below." %}{% endif %} + {% blocktranslate count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}

{{ adminform.form.non_field_errors }} {% endif %} diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html index 29747c317e..a0ecde1991 100644 --- a/django/contrib/admin/templates/admin/change_list.html +++ b/django/contrib/admin/templates/admin/change_list.html @@ -49,7 +49,7 @@ {% endblock %} {% if cl.formset and cl.formset.errors %}

- {% if cl.formset.total_error_count == 1 %}{% translate "Please correct the error below." %}{% else %}{% translate "Please correct the errors below." %}{% endif %} + {% blocktranslate count counter=cl.formset.total_error_count %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}

{{ cl.formset.non_form_errors }} {% endif %} diff --git a/django/contrib/admin/templates/admin/change_list_results.html b/django/contrib/admin/templates/admin/change_list_results.html index 399d1d36fc..d2a9feed20 100644 --- a/django/contrib/admin/templates/admin/change_list_results.html +++ b/django/contrib/admin/templates/admin/change_list_results.html @@ -11,14 +11,12 @@ {% for header in result_headers %} - {% if header.sortable %} - {% if header.sort_priority > 0 %} + {% if header.sortable and header.sort_priority > 0 %}
{% if num_sorted_fields > 1 %}{{ header.sort_priority }}{% endif %} - +
- {% endif %} {% endif %}
{% if header.sortable %}{{ header.text|capfirst }}{% else %}{{ header.text|capfirst }}{% endif %}
diff --git a/django/contrib/admin/templates/admin/date_hierarchy.html b/django/contrib/admin/templates/admin/date_hierarchy.html index 65ae800134..4ff02657a0 100644 --- a/django/contrib/admin/templates/admin/date_hierarchy.html +++ b/django/contrib/admin/templates/admin/date_hierarchy.html @@ -7,7 +7,7 @@ {% endblock %} {% block date-hierarchy-choices %} {% for choice in choices %} -
  • {% if choice.link %}{% endif %}{{ choice.title }}{% if choice.link %}{% endif %}
  • +
  • {% if choice.link %}{{ choice.title }}{% else %}{{ choice.title }}{% endif %}
  • {% endfor %} {% endblock %} {% endblock %} diff --git a/django/contrib/admin/templates/admin/delete_confirmation.html b/django/contrib/admin/templates/admin/delete_confirmation.html index d4c9b295a1..a3894f33b6 100644 --- a/django/contrib/admin/templates/admin/delete_confirmation.html +++ b/django/contrib/admin/templates/admin/delete_confirmation.html @@ -22,18 +22,10 @@ {% block content %} {% if perms_lacking %}

    {% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}

    -
      - {% for obj in perms_lacking %} -
    • {{ obj }}
    • - {% endfor %} -
    +
      {{ perms_lacking|unordered_list }}
    {% elif protected %}

    {% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktranslate %}

    -
      - {% for obj in protected %} -
    • {{ obj }}
    • - {% endfor %} -
    +
      {{ protected|unordered_list }}
    {% else %}

    {% blocktranslate with escaped_object=object %}Are you sure you want to delete the {{ object_name }} "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktranslate %}

    {% include "admin/includes/object_delete_summary.html" %} diff --git a/django/contrib/admin/templates/admin/delete_selected_confirmation.html b/django/contrib/admin/templates/admin/delete_selected_confirmation.html index a49b6adeeb..51b93a5f49 100644 --- a/django/contrib/admin/templates/admin/delete_selected_confirmation.html +++ b/django/contrib/admin/templates/admin/delete_selected_confirmation.html @@ -21,18 +21,10 @@ {% block content %} {% if perms_lacking %}

    {% blocktranslate %}Deleting the selected {{ objects_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}

    -
      - {% for obj in perms_lacking %} -
    • {{ obj }}
    • - {% endfor %} -
    +
      {{ perms_lacking|unordered_list }}
    {% elif protected %}

    {% blocktranslate %}Deleting the selected {{ objects_name }} would require deleting the following protected related objects:{% endblocktranslate %}

    -
      - {% for obj in protected %} -
    • {{ obj }}
    • - {% endfor %} -
    +
      {{ protected|unordered_list }}
    {% else %}

    {% blocktranslate %}Are you sure you want to delete the selected {{ objects_name }}? All of the following objects and their related items will be deleted:{% endblocktranslate %}

    {% include "admin/includes/object_delete_summary.html" %} diff --git a/django/contrib/admin/templates/admin/edit_inline/stacked.html b/django/contrib/admin/templates/admin/edit_inline/stacked.html index 457e84affe..31d917bff0 100644 --- a/django/contrib/admin/templates/admin/edit_inline/stacked.html +++ b/django/contrib/admin/templates/admin/edit_inline/stacked.html @@ -13,7 +13,7 @@ {{ inline_admin_formset.formset.non_form_errors }} {% for inline_admin_form in inline_admin_formset %}
    -

    {{ inline_admin_formset.opts.verbose_name|capfirst }}: {% if inline_admin_form.original %}{{ inline_admin_form.original }}{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %} {% if inline_admin_formset.has_change_permission %}{% translate "Change" %}{% else %}{% translate "View" %}{% endif %}{% endif %} +

    {{ inline_admin_formset.opts.verbose_name|capfirst }}: {% if inline_admin_form.original %}{{ inline_admin_form.original }}{% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %} {% if inline_admin_formset.has_change_permission %}{% translate "Change" %}{% else %}{% translate "View" %}{% endif %}{% endif %} {% else %}#{{ forloop.counter }}{% endif %} {% if inline_admin_form.show_url %}{% translate "View on site" %}{% endif %} {% if inline_admin_formset.formset.can_delete and inline_admin_formset.has_delete_permission and inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}{% endif %} diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html index 6b6bd1b4cf..84c9fe3696 100644 --- a/django/contrib/admin/templates/admin/edit_inline/tabular.html +++ b/django/contrib/admin/templates/admin/edit_inline/tabular.html @@ -33,7 +33,7 @@ {% if inline_admin_form.original or inline_admin_form.show_url %}

    {% if inline_admin_form.original %} {{ inline_admin_form.original }} - {% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}{% if inline_admin_formset.has_change_permission %}{% translate "Change" %}{% else %}{% translate "View" %}{% endif %}{% endif %} + {% if inline_admin_form.model_admin.show_change_link and inline_admin_form.model_admin.has_registered_model %}{% if inline_admin_formset.has_change_permission %}{% translate "Change" %}{% else %}{% translate "View" %}{% endif %}{% endif %} {% endif %} {% if inline_admin_form.show_url %}{% translate "View on site" %}{% endif %}

    {% endif %} diff --git a/django/contrib/admin/templates/admin/login.html b/django/contrib/admin/templates/admin/login.html index aaa21fb450..a14e91c5d7 100644 --- a/django/contrib/admin/templates/admin/login.html +++ b/django/contrib/admin/templates/admin/login.html @@ -20,7 +20,7 @@ {% block content %} {% if form.errors and not form.non_field_errors %}

    -{% if form.errors.items|length == 1 %}{% translate "Please correct the error below." %}{% else %}{% translate "Please correct the errors below." %}{% endif %} +{% blocktranslate count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}

    {% endif %} diff --git a/django/contrib/admin/templates/admin/object_history.html b/django/contrib/admin/templates/admin/object_history.html index 91dad45026..f83984c300 100644 --- a/django/contrib/admin/templates/admin/object_history.html +++ b/django/contrib/admin/templates/admin/object_history.html @@ -46,7 +46,7 @@ {% endif %} {% endfor %} {% endif %} - {{ action_list.paginator.count }} {% if action_list.paginator.count == 1 %}{% translate "entry" %}{% else %}{% translate "entries" %}{% endif %} + {{ action_list.paginator.count }} {% blocktranslate count counter=action_list.paginator.count %}entry{% plural %}entries{% endblocktranslate %}

    {% else %}

    {% translate 'This object doesn’t have a change history. It probably wasn’t added via this admin site.' %}

    diff --git a/django/contrib/admin/templates/admin/widgets/foreign_key_raw_id.html b/django/contrib/admin/templates/admin/widgets/foreign_key_raw_id.html index ca25b52674..be93e0581d 100644 --- a/django/contrib/admin/templates/admin/widgets/foreign_key_raw_id.html +++ b/django/contrib/admin/templates/admin/widgets/foreign_key_raw_id.html @@ -1,2 +1,2 @@ {% include 'django/forms/widgets/input.html' %}{% if related_url %}{% endif %}{% if link_label %} -{% if link_url %}{% endif %}{{ link_label }}{% if link_url %}{% endif %}{% endif %} +{% if link_url %}{{ link_label }}{% else %}{{ link_label }}{% endif %}{% endif %} diff --git a/django/contrib/admin/templates/registration/password_change_form.html b/django/contrib/admin/templates/registration/password_change_form.html index e5fa9d8b99..37e5ddd5a8 100644 --- a/django/contrib/admin/templates/registration/password_change_form.html +++ b/django/contrib/admin/templates/registration/password_change_form.html @@ -21,7 +21,7 @@
    {% if form.errors %}

    - {% if form.errors.items|length == 1 %}{% translate "Please correct the error below." %}{% else %}{% translate "Please correct the errors below." %}{% endif %} + {% blocktranslate count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}

    {% endif %} diff --git a/django/views/templates/technical_500.html b/django/views/templates/technical_500.html index 4031c38655..4483145ec3 100644 --- a/django/views/templates/technical_500.html +++ b/django/views/templates/technical_500.html @@ -224,10 +224,12 @@

    {% endif %}{% endifchanged %}
  • - {% if not frame.tb %} - {% if forloop.first %}None{% else %}Traceback: None{% endif %} - {% else %} + {% if frame.tb %} {{ frame.filename }}, line {{ frame.lineno }}, in {{ frame.function }} + {% elif forloop.first %} + None + {% else %} + Traceback: None {% endif %} {% if frame.context_line %} @@ -325,7 +327,7 @@ The above exception ({{ frame.exc_cause|force_escape }}) was the direct cause of {% else %} During handling of the above exception ({{ frame.exc_cause|force_escape }}), another exception occurred: {% endif %}{% endif %}{% endifchanged %} {% if frame.tb %}File "{{ frame.filename }}"{% if frame.context_line %}, line {{ frame.lineno }}{% endif %}, in {{ frame.function }} -{% if frame.context_line %} {% spaceless %}{{ frame.context_line }}{% endspaceless %}{% endif %}{% else %}{% if forloop.first %}None{% else %}Traceback: None{% endif %}{% endif %}{% endfor %} +{% if frame.context_line %} {% spaceless %}{{ frame.context_line }}{% endspaceless %}{% endif %}{% elif forloop.first %}None{% else %}Traceback: None{% endif %}{% endfor %} Exception Type: {{ exception_type }}{% if request %} at {{ request.path_info }}{% endif %} Exception Value: {{ exception_value|force_escape }} diff --git a/django/views/templates/technical_500.txt b/django/views/templates/technical_500.txt index 0747de5c85..87cf6b5bbc 100644 --- a/django/views/templates/technical_500.txt +++ b/django/views/templates/technical_500.txt @@ -31,7 +31,7 @@ Traceback (most recent call last): {% for frame in frames %}{% ifchanged frame.exc_cause %}{% if frame.exc_cause %} {% if frame.exc_cause_explicit %}The above exception ({{ frame.exc_cause }}) was the direct cause of the following exception:{% else %}During handling of the above exception ({{ frame.exc_cause }}), another exception occurred:{% endif %} {% endif %}{% endifchanged %} {% if frame.tb %}File "{{ frame.filename }}"{% if frame.context_line %}, line {{ frame.lineno }}{% endif %}, in {{ frame.function }} -{% if frame.context_line %} {% spaceless %}{{ frame.context_line }}{% endspaceless %}{% endif %}{% else %}{% if forloop.first %}None{% else %}Traceback: None{% endif %}{% endif %} +{% if frame.context_line %} {% spaceless %}{{ frame.context_line }}{% endspaceless %}{% endif %}{% elif forloop.first %}None{% else %}Traceback: None{% endif %} {% endfor %} {% if exception_type %}Exception Type: {{ exception_type }}{% if request %} at {{ request.path_info }}{% endif %} {% if exception_value %}Exception Value: {{ exception_value }}{% endif %}{% endif %}{% endif %}