Fixed #26872 -- Fixed text overflow in ModelAdmin.list_filter.

This commit is contained in:
Kenneth 2016-07-07 18:58:11 -07:00 committed by Tim Graham
parent dab83e5ba1
commit 2f587737d7
3 changed files with 12 additions and 4 deletions

View File

@ -166,6 +166,8 @@
#changelist-filter a { #changelist-filter a {
display: block; display: block;
color: #999; color: #999;
text-overflow: ellipsis;
overflow-x: hidden;
} }
#changelist-filter li.selected { #changelist-filter li.selected {

View File

@ -3,6 +3,6 @@
<ul> <ul>
{% for choice in choices %} {% for choice in choices %}
<li{% if choice.selected %} class="selected"{% endif %}> <li{% if choice.selected %} class="selected"{% endif %}>
<a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a></li> <a href="{{ choice.query_string|iriencode }}" title="{{ choice.display }}">{{ choice.display }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>

View File

@ -592,7 +592,7 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
for value in params['values']: for value in params['values']:
query_string = urlencode({filter_path: value}) query_string = urlencode({filter_path: value})
# ensure filter link exists # ensure filter link exists
self.assertContains(response, '<a href="?%s">' % query_string) self.assertContains(response, '<a href="?%s"' % query_string)
# ensure link works # ensure link works
filtered_response = self.client.get('%s?%s' % (changelist_url, query_string)) filtered_response = self.client.get('%s?%s' % (changelist_url, query_string))
self.assertEqual(filtered_response.status_code, 200) self.assertEqual(filtered_response.status_code, 200)
@ -664,8 +664,14 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
"field 'choices' option named group." "field 'choices' option named group."
) )
self.assertContains(response, '<div id="changelist-filter">') self.assertContains(response, '<div id="changelist-filter">')
self.assertContains(response, '<a href="?surface__exact=x">Horizontal</a>', msg_prefix=fail_msg, html=True) self.assertContains(
self.assertContains(response, '<a href="?surface__exact=y">Vertical</a>', msg_prefix=fail_msg, html=True) response, '<a href="?surface__exact=x" title="Horizontal">Horizontal</a>',
msg_prefix=fail_msg, html=True
)
self.assertContains(
response, '<a href="?surface__exact=y" title="Vertical">Vertical</a>',
msg_prefix=fail_msg, html=True
)
def test_change_list_null_boolean_display(self): def test_change_list_null_boolean_display(self):
Post.objects.create(public=None) Post.objects.create(public=None)