Opened 15 years ago

Closed 12 years ago

#13735 closed Bug (duplicate)

Broken table layout if content is too large

Reported by: Artem Skoretskiy Owned by: nobody
Component: contrib.admin Version: 1.2
Severity: Normal Keywords:
Cc: Artem Skoretskiy, <tonn81@…> Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes
Pull Requests:How to create a pull request

Description

In ADmin - if content has too much width it doesn't fit into container and filter overlays it.

Please, look at screenshot and complete HTML attached

Change History (11)

by Artem Skoretskiy, 15 years ago

Attachment: admin_filter.png added

Screenshot of broken filter block

by Artem Skoretskiy, 15 years ago

Attachment: admin_filter.zip added

Complete code for error

comment:1 by Chris Beaven, 14 years ago

milestone: 1.3
Triage Stage: UnreviewedAccepted

comment:2 by Artem Skoretskiy, 14 years ago

Cc: Artem Skoretskiy <tonn81@…> added

comment:3 by Julien Phalip, 14 years ago

I can't seem to be able to reproduce this. Could you provide some source code that we can test?

comment:4 by Julien Phalip, 14 years ago

Severity: Normal
Type: Bug

comment:5 by Julien Phalip, 14 years ago

Easy pickings: unset
UI/UX: unset

See a related issue in #9181.

comment:6 by Julien Phalip, 14 years ago

UI/UX: set

comment:7 by Julien Phalip, 14 years ago

Has patch: set
Summary: Broken filter blockBroken table layout if content is too large

Here's a test case:

# models.py:
from datetime import datetime
from django.db import models

class MyModel(models.Model):
    a = models.CharField(choices=(('draft', 'Draft'), ('published', 'Published')), default='draft', max_length=50)
    b = models.DateTimeField(default=datetime.now)
    c = models.DateTimeField(default=datetime.now)
    d = models.DateTimeField(default=datetime.now)
    e = models.DateTimeField(default=datetime.now)
    f = models.DateTimeField(default=datetime.now)
    g = models.DateTimeField(default=datetime.now)
    h = models.DateTimeField(default=datetime.now)
    i = models.DateTimeField(default=datetime.now)
    j = models.DateTimeField(default=datetime.now)

# admin.py:

from django.contrib import admin

from .models import MyModel

class MyModelAdmin(admin.ModelAdmin):
    list_display = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
    list_filter = ['a']

admin.site.register(MyModel, MyModelAdmin)

Note that this is not a problem with the filter but with the results' table itself -- that is, the problem is present whether or not there is a filter. More specifically, the problem comes from the fact that certain types of data (time, date and FK) get a nowrap class, preventing the content of the cell to wrap and adapt to the available width space. See #11447, for example, to see the necessity for that non-wrapping.

I've attached one possible fix making a horizontal bar appear if the table's content can't fit in the page.

by Julien Phalip, 14 years ago

comment:8 by loic84, 12 years ago

Resolution: duplicate
Status: newclosed

Closing in favor of patch in #19972.

Note: See TracTickets for help on using tickets.
Back to Top