Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16659 closed Cleanup/optimization (fixed)

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

Reported by: mofle 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 mofle 3 years ago.
before.png (9.2 KB) - added by mofle 3 years ago.
after.png (9.2 KB) - added by mofle 3 years ago.
changelists.css.patch (300 bytes) - added by mofle 3 years ago.
Patch
ie.css.patch (357 bytes) - added by mofle 3 years ago.
IE support
16659.diff (1.5 KB) - added by mofle 3 years ago.

Download all attachments as: .zip

Change History (15)

Changed 3 years ago by mofle

Changed 3 years ago by mofle

Changed 3 years ago by mofle

Changed 3 years ago by mofle

Patch

Changed 3 years ago by mofle

IE support

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

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 3 years ago by mofle

comment:2 Changed 3 years ago by mofle

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 3 years ago by mofle

  • Patch needs improvement unset

comment:4 Changed 3 years ago by adamnelson

  • Patch needs improvement set
  • Triage Stage changed from Accepted to Ready for checkin

Applied patch and looks good.

comment:5 Changed 3 years ago by adamnelson

  • Patch needs improvement unset

comment:6 Changed 3 years ago by julien

  • Resolution set to fixed
  • Status changed from new to closed

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 3 years ago by julien

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

comment:8 Changed 3 years ago by mofle

No problem. Thanks for committing it ;)

Last edited 3 years ago by mofle (previous) (diff)

comment:9 Changed 3 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.