Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#16659 closed Cleanup/optimization (fixed)

Change-list toplinks (date drilldown) should not have fixed width

Reported by: Sindre Sorhus Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords: admin, list_filter, default
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

Right now the toplinks are displayed using a fixed width and floated. The problem with this is that they use more space then they should, since every link has the width of the widest. It also doesn't look good. I propose we set them to inline-blocks to give them a variable width. This also fixes a problem of the some of the month names being longer than the fixed width (happens with norwegians dates, might be more, haven't tested, see "bug.png"), and then wrapping over two lines. In my opinion, it looks a lot cleaner using variable widths.

I have included 2 simple patches for this super small change. Also see the before and after screenshots.

Attachments (6)

bug.png (4.9 KB) - added by Sindre Sorhus 5 years ago.
before.png (9.2 KB) - added by Sindre Sorhus 5 years ago.
after.png (9.2 KB) - added by Sindre Sorhus 5 years ago.
changelists.css.patch (300 bytes) - added by Sindre Sorhus 5 years ago.
Patch
ie.css.patch (357 bytes) - added by Sindre Sorhus 5 years ago.
IE support
16659.diff (1.5 KB) - added by Sindre Sorhus 5 years ago.

Download all attachments as: .zip

Change History (15)

Changed 5 years ago by Sindre Sorhus

Attachment: bug.png added

Changed 5 years ago by Sindre Sorhus

Attachment: before.png added

Changed 5 years ago by Sindre Sorhus

Attachment: after.png added

Changed 5 years ago by Sindre Sorhus

Attachment: changelists.css.patch added

Patch

Changed 5 years ago by Sindre Sorhus

Attachment: ie.css.patch added

IE support

comment:1 Changed 5 years ago by Aymeric Augustin

Needs documentation: unset
Needs tests: unset
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

I like the idea.

Have you checked the result for RTL languages? Just set you LANGUAGE_CODE to "he" and see what happens. You may need to tweak rtl.css too.

Regarding the patch, could you:

  • upload only one diff with all the changes, relative the the "trunk" directory of Django's source tree?
  • avoid insignificant whitespace changes (you removed a newline at the end of ie.css)?

Thanks for your contribution!

Changed 5 years ago by Sindre Sorhus

Attachment: 16659.diff added

comment:2 Changed 5 years ago by Sindre Sorhus

Tested with "he" language code. Removed a superfluous float and created one diff. The changelist page is broken in RTL (the listfilter is above the list), but the cause is not this patch.

comment:3 Changed 5 years ago by Sindre Sorhus

Patch needs improvement: unset

comment:4 Changed 5 years ago by Adam Nelson

Patch needs improvement: set
Triage Stage: AcceptedReady for checkin

Applied patch and looks good.

comment:5 Changed 5 years ago by Adam Nelson

Patch needs improvement: unset

comment:6 Changed 5 years ago by Julien Phalip

Resolution: fixed
Status: newclosed

In [16854]:

Fixed #16659 -- Made the admin's date drilldown links in the changelist have a variable width to play nicer with languages with long month names.

comment:7 Changed 5 years ago by Julien Phalip

Thank you, mofle, for the report and patch, and sorry that I forgot to mention you in the commit message.

comment:8 Changed 5 years ago by Sindre Sorhus

No problem. Thanks for committing it ;)

Last edited 5 years ago by Sindre Sorhus (previous) (diff)

comment:9 Changed 5 years ago by Jacob

milestone: 1.4

Milestone 1.4 deleted

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