Opened 13 years ago

Closed 13 years ago

Last modified 13 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: dev
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 13 years ago.
before.png (9.2 KB ) - added by Sindre Sorhus 13 years ago.
after.png (9.2 KB ) - added by Sindre Sorhus 13 years ago.
changelists.css.patch (300 bytes ) - added by Sindre Sorhus 13 years ago.
Patch
ie.css.patch (357 bytes ) - added by Sindre Sorhus 13 years ago.
IE support
16659.diff (1.5 KB ) - added by Sindre Sorhus 13 years ago.

Download all attachments as: .zip

Change History (15)

by Sindre Sorhus, 13 years ago

Attachment: bug.png added

by Sindre Sorhus, 13 years ago

Attachment: before.png added

by Sindre Sorhus, 13 years ago

Attachment: after.png added

by Sindre Sorhus, 13 years ago

Attachment: changelists.css.patch added

Patch

by Sindre Sorhus, 13 years ago

Attachment: ie.css.patch added

IE support

comment:1 by Aymeric Augustin, 13 years ago

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!

by Sindre Sorhus, 13 years ago

Attachment: 16659.diff added

comment:2 by Sindre Sorhus, 13 years ago

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 by Sindre Sorhus, 13 years ago

Patch needs improvement: unset

comment:4 by Adam Nelson, 13 years ago

Patch needs improvement: set
Triage Stage: AcceptedReady for checkin

Applied patch and looks good.

comment:5 by Adam Nelson, 13 years ago

Patch needs improvement: unset

comment:6 by Julien Phalip, 13 years ago

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 by Julien Phalip, 13 years ago

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

comment:8 by Sindre Sorhus, 13 years ago

No problem. Thanks for committing it ;)

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

comment:9 by Jacob, 13 years ago

milestone: 1.4

Milestone 1.4 deleted

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