Opened 3 weeks ago

Closed 11 days ago

#37387 closed Bug (fixed)

admindocs: model_index.html table missing full width

Reported by: Jacob Walls Owned by: Vaibhav Pant
Component: contrib.admindocs Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

Noticed during an admindocs review that we're missing full width on the <table>, see screenshot (white gray background does not extend to the edge.)

Interestingly, we have the needed selector in responsive mode, so my suggestion is to just hoist the selector, something like:

  • django/contrib/admin/static/admin/css/base.css

    diff --git a/django/contrib/admin/static/admin/css/base.css b/django/contrib/admin/static/admin/css/base.css
    index 8a526f5c73..0476eb9ed6 100644
    a b a.deletelink:hover {  
    13831383.actions .button:hover {
    13841384    border-color: var(--body-quiet-color);
    13851385}
     1386
     1387/* DOCS */
     1388
     1389.module table.xfull {
     1390    width: 100%;
     1391}
  • django/contrib/admin/static/admin/css/responsive.css

    diff --git a/django/contrib/admin/static/admin/css/responsive.css b/django/contrib/admin/static/admin/css/responsive.css
    index d97601e648..b3bdf38dc5 100644
    a b button {  
    370370
    371371    /* Docs */
    372372
    373     .module table.xfull {
    374         width: 100%;
    375     }
    376 
    377373    pre.literal-block {
    378374        overflow: auto;
    379375    }

Needs verification and also maybe some thought around whether we want some screenshot test cases for contrib.admindocs?

Attachments (1)

insufficient-width.png​ (82.2 KB ) - added by Jacob Walls 3 weeks ago.

Download all attachments as: .zip

Change History (10)

by Jacob Walls, 3 weeks ago

Attachment: insufficient-width.png​ added

comment:1 by Jacob Walls, 3 weeks ago

UI/UX: set

comment:2 by Natalia Bidart, 3 weeks ago

Easy pickings: set
Triage Stage: Unreviewed → Accepted
Type: Cleanup/optimization → Bug

Reproduced on main. At viewport widths of 1024px and below the table spans the full width, but from 1025px up it shrinks to fit its content, just like Jacob says. Moving the rule to base.css as suggested looks right.

comment:3 by Natalia Bidart, 3 weeks ago

Summary: model_index.html table missing full width → admindocs: model_index.html table missing full width

comment:4 by Vaibhav Pant, 3 weeks ago

Owner: changed from Django Sprints to Vaibhav Pant

comment:5 by Vaibhav Pant, 3 weeks ago

Has patch: set

comment:6 by Vaibhav Pant, 3 weeks ago

I have opened a pull request for this ticket: ​https://github.com/django/django/pull/22060 . It moves the .module table.xfull rule from responsive.css to base.css so it applies at all widths.

comment:7 by Jacob Walls, 2 weeks ago

Needs tests: set

comment:8 by Jacob Walls, 11 days ago

Needs tests: unset
Triage Stage: Accepted → Ready for checkin

comment:9 by Jacob Walls <jacobtylerwalls@…>, 11 days ago

Resolution: → fixed
Status: assigned → closed

In 0264b4f:

Fixed #37387 -- Made admindocs model index table full width.

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