1
0
mirror of https://github.com/django/django.git synced 2025-01-03 06:55:47 +00:00

Fixed #34512 -- Restored breadcrumbs on admin app index view.

Thanks Adam (ataylor32) for the report.

Regression in 872b61193b.
This commit is contained in:
Mariusz Felisiak 2023-04-26 08:36:56 +02:00 committed by GitHub
parent 453cfa2815
commit 9440f6ba41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 8 deletions

View File

@ -4,14 +4,16 @@
{% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %} {% block bodyclass %}{{ block.super }} app-{{ app_label }}{% endblock %}
{% if not is_popup %} {% if not is_popup %}
{% block breadcrumbs %} {% block nav-breadcrumbs %}
<div class="breadcrumbs"> <nav aria-label="{% translate 'Breadcrumbs' %}">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a> <div class="breadcrumbs">
&rsaquo; <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
{% for app in app_list %} &rsaquo;
{{ app.name }} {% for app in app_list %}
{% endfor %} {{ app.name }}
</div> {% endfor %}
</div>
</nav>
{% endblock %} {% endblock %}
{% endif %} {% endif %}

View File

@ -44,3 +44,6 @@ Bugfixes
* Fixed a regression in Django 4.2 that caused incorrect ``ClearableFileInput`` * Fixed a regression in Django 4.2 that caused incorrect ``ClearableFileInput``
margins in the admin (:ticket:`34506`). margins in the admin (:ticket:`34506`).
* Fixed a regression in Django 4.2 where breadcrumbs didn't appear on admin
site app index views (:ticket:`34512`).

View File

@ -23,3 +23,7 @@ class AdminBreadcrumbsTests(TestCase):
def test_breadcrumbs_present(self): def test_breadcrumbs_present(self):
response = self.client.get(reverse("admin:auth_user_add")) response = self.client.get(reverse("admin:auth_user_add"))
self.assertContains(response, '<nav aria-label="Breadcrumbs">') self.assertContains(response, '<nav aria-label="Breadcrumbs">')
response = self.client.get(
reverse("admin:app_list", kwargs={"app_label": "auth"})
)
self.assertContains(response, '<nav aria-label="Breadcrumbs">')