From 2f587737d7acffbd67cb8f427c5fbc5c42ae60c8 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Thu, 7 Jul 2016 18:58:11 -0700 Subject: [PATCH] Fixed #26872 -- Fixed text overflow in ModelAdmin.list_filter. --- .../contrib/admin/static/admin/css/changelists.css | 2 ++ django/contrib/admin/templates/admin/filter.html | 2 +- tests/admin_views/tests.py | 12 +++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/django/contrib/admin/static/admin/css/changelists.css b/django/contrib/admin/static/admin/css/changelists.css index 4eab7604d09..17690a3478d 100644 --- a/django/contrib/admin/static/admin/css/changelists.css +++ b/django/contrib/admin/static/admin/css/changelists.css @@ -166,6 +166,8 @@ #changelist-filter a { display: block; color: #999; + text-overflow: ellipsis; + overflow-x: hidden; } #changelist-filter li.selected { diff --git a/django/contrib/admin/templates/admin/filter.html b/django/contrib/admin/templates/admin/filter.html index d4a61a1513a..cd88652a621 100644 --- a/django/contrib/admin/templates/admin/filter.html +++ b/django/contrib/admin/templates/admin/filter.html @@ -3,6 +3,6 @@ diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index f7427f7da06..2886c94bd5e 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -592,7 +592,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase): for value in params['values']: query_string = urlencode({filter_path: value}) # ensure filter link exists - self.assertContains(response, '' % query_string) + self.assertContains(response, '') - self.assertContains(response, 'Horizontal', msg_prefix=fail_msg, html=True) - self.assertContains(response, 'Vertical', msg_prefix=fail_msg, html=True) + self.assertContains( + response, 'Horizontal', + msg_prefix=fail_msg, html=True + ) + self.assertContains( + response, 'Vertical', + msg_prefix=fail_msg, html=True + ) def test_change_list_null_boolean_display(self): Post.objects.create(public=None)